Forum

Thread tagged as: Problem

List/Detail page layout / dynamic issues

Hi

I am wanting to use the list-detail pages on a site but I've run into a couple of issues with using both the single list-detail option and the two-page list and detail pages.

  1. Single list-detail option This works really well for pages which will be dynamically generated and will have different names the only issue is that in the design the layout for the list is different to the detail layout. This means I will need to hide some of the regions which feature on the list page from the detail page. I'm not sure how to do this.

I suppose what I'm asking here can I have 2 different layouts for both the list page and detail page. If I could even hide some of the regions for the detail page that would be great. How would I go about doing this because I've tried a few different options and none of them has worked.

  1. Two page list and detail pages This works for the different layouts however it doesn't deal with pages which are dynamically created. In the example on the perch site page' => '/products.php', is named but all of the pages I have will be different names so I need this to pull the page name or ID which is dynamically created in here. But again I'm not sure where to start with this? Are there any tutorials or solutions on the perch site for this?

Thanks

Peter Meenagh

Peter Meenagh 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Sure, you can do whatever you wish, really. If you want to switch layouts, just check for which mode you're in:

if (perch_get('s')) {
    perch_layout('product.detail');
} else {
    perch_layout('product.list');
}

Thanks for this Drew, that has done the trick. Brilliant.