peeta Posted July 14, 2008 Share Posted July 14, 2008 I want to use a javascript to open a div popup on the homepage only. The div and the initialization script are in footer.tpl so it tries to execute on all pages. I need something like this {if is_homepage} show this {/if} Can anyone guide me on this? Thanks 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 14, 2008 Share Posted July 14, 2008 If you mean the support home try this: {if $pagetitle == 'Support'} <!-- Code here --> {/if} 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted July 14, 2008 Author Share Posted July 14, 2008 I use that now but I have a long title 'Turnkey Webhost with free website template and E-commerce package' which is subject to change so I wanted something which could identify just the home page. Is it not possible? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 14, 2008 Share Posted July 14, 2008 I think there is a post here that has coding that will recognise the pages... 0 Quote Link to comment Share on other sites More sharing options...
Redsign Posted July 15, 2008 Share Posted July 15, 2008 You can use the javascript window.location function: if(window.location == "index.php"){ } Although I'm not sure if this will work with the query strings. You could always put the code in the template file for the homepage only? Ben 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted July 15, 2008 Author Share Posted July 15, 2008 I have spent considerable time searching for anything related to page recognition and nothing useful is coming up. Does anyone know of the thread which BAJI26 is referring? 0 Quote Link to comment Share on other sites More sharing options...
charliez Posted July 15, 2008 Share Posted July 15, 2008 Does using: { if $pagetitle eq 'Company - Home'} helps you? I am assuming that you just want to do something on the home page. I am also looking for something that identifies the page via URL.... but have not found anything get too... 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted July 15, 2008 Author Share Posted July 15, 2008 baji26 already suggested that method and I explained why I didn't want to use it. If it remains the only method then I have no choice but I'd rather something else. My entire website is WHMCS so the home page title is quite long (something to do with SEO). Maybe if there was an editable file in the root called homepage.php then I could possibly assign a variable like $smarty->assign('homepg', $true); and then use {if $homepg}stuff{/if} 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.