Forums / Templates, Stylesheets, Page Layout / which file calls tpl_index_product_list.php?

which file calls tpl_index_product_list.php?

Views: 2,357

Results 21 to 22 of 22
8 May 2013, 7:28 AM
#21
enochian avatar

enochian

New Zenner

Join Date:
Jan 2009
Posts:
33
Plugin Contributions:
0

which file calls tpl_index_product_list.php?

I think I might have worked it out. After rereading the thread I tried a few things and then tried this:

$flag = FALSE;
switch (TRUE) {
  // is current category 10 
  case ($current_category_id == 10):
    $flag = TRUE;
    break;
}
if ($flag == TRUE) {
$tpl_page_body = 'tpl_index_document_list.php'; 
} else { 
$tpl_page_body = 'tpl_index_product_list.php'; 
}  

This seems to work. I am no expert on these things so if this is not correct please let me know.

Thanks

8 May 2013, 7:55 AM
#22
enochian avatar

enochian

New Zenner

Join Date:
Jan 2009
Posts:
33
Plugin Contributions:
0

Re: which file calls tpl_index_product_list.php?

In case anyone is interested I actually shortened the code as gjh42 did from this:

enochian:

$flag = FALSE;
switch (TRUE) {
// is current category 10
case ($current_category_id == 10):
$flag = TRUE;
break;
}
if ($flag == TRUE) {
$tpl_page_body = 'tpl_index_document_list.php';
} else {
$tpl_page_body = 'tpl_index_product_list.php';
}



To this:

if ($current_category_id == 10) {
$tpl_page_body = 'tpl_index_document_list.php';
} else {
$tpl_page_body = 'tpl_index_product_list.php';
}


Thanks