I created the route:
It works when it is one word but it does not show the query result when it is more than one.
For example:
https:domain.com/bp/myown - work
But
https:domain.com/bp/myown-business - does not work
I don’t know what is missing here.
sid
January 14, 2021, 7:16am
2
Hi,
The GET param should be like $_GET.id_business
instead of $_GET.businessid
I think.
Having hyphenated name in the parameter value should not cause any issues.
sid:
id_business
I changed it - It is not working at all.
sid
January 14, 2021, 1:59pm
4
What’s the server model here?
Also, can you share a link to this?
php -
https://1connect1.com/index.php
When you click on the name of the business: You will see
sid
January 14, 2021, 2:05pm
7
Not sure what that means.
Tried two businesses. This is what I see:
Both routes & params look fine. What the issue here??
P.S. There is something wrong with your logic. You are loading 4MB+ data via server connect. You should not need that much data to be downloaded unless this is a really specific use-case which needs that.
Teodor
January 14, 2021, 2:06pm
8
You are sending this to your server action:
?businessid=robert-barnes-and-associates-inc
are you using businessid
GET variable to filter the database? What is the content of the column you are trying to filter by?
I mean business name. SOrry
sid
January 14, 2021, 2:13pm
11
Sorry, that does not make sense either.
For a business named “College Park Eye Care”, the URL is https://1connect1.com/bp/college-park-eye-care .
What do you have in Business_Name
field in the DB for this particular business?
Teodor
January 14, 2021, 2:13pm
12
Well if you store your business names in the database like: my business name
it will never match the value you are sending my-business-name
Teodor
January 14, 2021, 2:14pm
14
You are comparing:
some-name
with some name
and they are NOT equal.
True.
Mean I have to send the name first with dash before displaying.
But what about if I use the id only but want the url to be cleaned
What do you suggest?
Url has the slugify element as you recommended in one the post.
Teodor
January 14, 2021, 2:23pm
17
Try using the humanize formatter to the value you are sending to the GET param:
<dmx-serverconnect id="serverconnect1" url="../../dmxConnect/api/Security/Search/BusinessProfile.php" dmx-param:businessid="query.id_business.humanize()" dmx-param:album="" dmx-param:servicecategory="form1.input1_group.value"
usually you send the uniquer business ID with the URL as well and use it to filter the records, so you don’t have issues with sending slugified value back to the db.
I did the humanize option;
https://1connect1.com/bp/the-shave-barbershop (does work)
https://1connect1.com/bp/musas-accounting-service (doesnot work) - ### Musa’s Accounting Service
Anything with the special characters such as & or ’ does not work.
What do you think about it?
Teodor
January 14, 2021, 2:34pm
19
That’s because humanize replaces them.
Maybe use replace instead of humanize …
dmx-param:businessid="query.id_business.replace('-', ' ')"
which will fix this problem.
But the most clear and error-proof way would be to send the unique record ID in the URL so you are using it to filter the records, not the name, like:
https://1connect1.com/bp/2/musas-accounting-service
then it won’t matter in what way is the text transformed in the URL.
So, I changed the url to https://1connect1.com/bp/72/lifetime-eyecare/
but the route path is /bp/:id_business/
so, I am not getting the page