Forum

Thread tagged as: Question

list with detail on same page... possible?

Is it possible with list : detail to have list and selected detail on same page? i.e. a list of options say in one div, click on any item in list, detail shows in separate div on same page? I can do regular list and detail, just trying to get my head around this one! Perch, not Runway

Charlie Elsey

Charlie Elsey 0 points

  • 3 years ago

Thanks Clive, yes I had seen that and I guess it is the best way to go... I was looking for a solution where you can still see the 'list' on the same page in one div while the selected 'detail' shows in another, which if I understand the info you reference is not the case.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

I was looking for a solution where you can still see the 'list' on the same page in one div while the selected 'detail' shows in another

If I understand correctly, you want the list to always be included regardless of whether you are in detail mode.

The solution referenced by Clive has the following code to determine whether you are in detail or list mode. As is, it only displays the list if you are not in detail mode:

if (perch_get('s')) {
    // Detail mode
} else {
    // List mode
    perch_content_custom('Products', array(
        'template' => 'product_listing.html',
    ));
}

Modify it to always include the list first:

// List
perch_content_custom('Products', array(
    'template' => 'product_listing.html',
));

if (perch_get('s')) {   
    // Detail mode
}

Thanks Hussein I will give that a go, I hoped it was something as simple as that (me being simple I like simple) :)