I'm trying to call up one of two menus from my index.tpl using smarty and php. The chosen menu will depend upon which page the user is linking from. Is this possible? I know I can't put the php directly into the tpl, so here is the code I am currently using which isn't doing what I want.
config.inc.php
Code: Select all
<?php
$serendipity['smarty']->assign('ref', $_SERVER['HTTP_REFERER']);
?>
Code: Select all
{if $ref == 'http://www.FIRST OF THREE ADDRESSES.html'}
{if $ref == 'http://www.SECOND OF THREE ADDRESSES.html'}
{if $ref == 'http://www.THIRD OF THREE ADDRESSES.html'}
//menu if the user is coming from 1 of 3 addresses
{else}
//menu for someone coming from anywhere else
{/if}
Sorry for being confusing. It just seems to be the only way for the time being. Can this be done??? If so how?
Thanks,
Dan