Forum

Thread tagged as: Question, Problem, Configuration

Search results using two page list and detail

I've got a two page list and detail page working where I got a second page detailing single items in a repeater.

So a show catalogue would be ...

https://domain.com/catalogue.php?s=collectionname

This shows a page with repeater list of individual products...

Clicking one of those in the repeater goes to a shop.php page...

https://domain.com/shop.php?s=collectionname&p=productname

So ideally when performing a search I want this individual product name rather than the whole collection page which might have 10 products because In the region options I've got...

/catalogue.php?s={slug}

Where I need the second slug in...

/shop.php?s={slug}&p={mysecondslug}

Can this second slug be done?

(Adding another {slug} from the repeater just repeats the first.)

David Owen

David Owen 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think so. What's being returned by search is the content item, which contains the repeater. All search knows is that this one item is the result. It can return the slug because the slug is a property of the item. It doesn't know that the match came from deep down within a particular repeater item.

I did try using the ID's {my-repater-id-as-slug} in the hope it might work. I assume as the ID is in the repeater nothing works so far.

Drew McLellan

Drew McLellan 2638 points
Perch Support

A repeater contains multiple items, so the ID of the repeater doesn't narrow it down.

Repeaters aren't really intended for major content items.

That's OK. I'm probably pushing list and detail too far which might been better using "categories"?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's hard to say what you're best doing without having a more full overview of the solution. All I can say is the limitation you're hitting up against is due to pushing repeaters beyond their intended application.