Hey guys,
I’m using a single template to display landing, category, filtered category and detail page.
All is working well until we get to the pagination. I tried using the ‘MD Detect Page Type’ plug-in but it didn’t work for me.
I’ve added the PHP Conditional answer from this thread to help solve this:
http://ellislab.com/forums/viewthread/80605/
My code is:
<?php
global $IN;
$qstring = $IN->QSTR;
$seg2 = '{segment_2}';
if ($seg2 == '' OR preg_match("#(^|\/)P(\d+)#", $qstring)) { ?>
{embed="includes/landing_page"}
<?php } else { ?>
{embed="includes/category_page"}
<?php } ?>
<?php
global $IN;
$qstring = $IN->QSTR;
$seg4 = '{segment_4}';
if ($seg4 == '' OR preg_match("#(^|\/)P(\d+)#", $qstring)) { ?>
{embed="includes/filtered_category_page"}
<?php } else { ?>
{embed="includes/detail_page"}
<?php } ?>This is the closest I’ve got to making this work. I need to check ‘segment_2’ and ‘segment_4’. Both code segments work as they should individually but I need them to be one conditional statement on the page. Can someone help me do this please?
Thanks