Do a search for slug

Hi,

I would like to extract the item #2 of that url that is a Slug name to do a “Do a search for” with that Slug : bien-être
https://www.mysite.com/version-test/studio/bien-être

I use Get Data from page URL > Path segments as list > item #2
The value returned is encoded: %C3%AAstre
The search doesn’t work then.

Any idea how could i retrieve the Slug from the URL to initiate a search please?
(i want to be able to share that url to anyone and that should load a studio type from that search from Slug: https://www.mysite.com/version-test/studio/bien-être)

Hi there,

If I’m understanding correctly, you need the page ‘studio’ to display the data from the slug value.

On the page ‘studio’ properties, set its datatype to that of whatever the datatype is of your slug values. Now any slug in the URL after /studio will automatically load on the page.

Thank you @msgiblin , that’s exactly what i need, i did not know that worked that way.
And what if i need my list of studios to display on that url:
https://www.mysite.com/version-test/studio/ , without slug as a parameter?

Theres a few ways you could approach this.

The first I thought of is you could have a repeating group on the page that is hidden by default, and a condition that says 'When this page’s Studio is empty, make it visible, and its datasource ‘Do a search for Studios’.

that is ok but i mean before that, when i need to do a “Go To Page Studio” from index page from ex. but without data to send, it raises an error if left empty.
Capture d’écran 2024-08-07 à 18.12.45

Ah yes… the way I currently deal with this is I created essay was essential a default thing, and put conditions on the page that when that page’s thing is (default thing), I show / hide groups accordingly.

On the go to page action, Data to Send, I do a search for that datatype, where the UniqueID is the ‘default’ thing’s UniqueID: first item.

Again, might not be the best for your use case but Id recommend playing around with some of this and seeing if it gets you closer to what you’re looking for.

sounds good solution.
Thank you @msgiblin

@msgiblin i found another way to do it without requesting the database i think (no WU needed).
Capture d’écran 2024-08-07 à 18.40.19

in fact one needs to use “open an external website” like this:
Capture d’écran 2024-08-07 à 19.52.28