RandyC Posted May 25, 2009 Share Posted May 25, 2009 So im wanting to play with the page title thing. I want to be able to add an icon for each page, they do the page title with a function: {$pagetitle} im curious is there a way to make a custom one like: {$pageicon} Thanks, Randy 0 Quote Link to comment Share on other sites More sharing options...
siforek Posted May 25, 2009 Share Posted May 25, 2009 The default template uses: "templates/{$template}/images/{$filename}.png" If that doesn't work for you then let me know what your desired output is and I'll write it for you 0 Quote Link to comment Share on other sites More sharing options...
RandyC Posted May 26, 2009 Author Share Posted May 26, 2009 not quite what i want, I don't want to have to pick the icon for each page, I want to put {$pageicon} right next to the {$pagetitle} in the header.tpl file and then set the icon via the language files. 0 Quote Link to comment Share on other sites More sharing options...
siforek Posted May 26, 2009 Share Posted May 26, 2009 not quite what i want, I don't want to have to pick the icon for each page, I want to put {$pageicon} right next to the {$pagetitle} in the header.tpl file and then set the icon via the language files. I'm not sure exactly what you mean by putting it right next to the title? If you want to set it using the language files you could do: <img src="templates/{$template}/images/{$LANG.pagenameicon}.png" Or something like that.. If that's not what you want perhaps let me know what the desired output source would look like 0 Quote Link to comment Share on other sites More sharing options...
RandyC Posted May 26, 2009 Author Share Posted May 26, 2009 Nope i want the image to change per page and only have to put one line on one page. For example: I have this setup for the title of my sidebar area: If you look in the header.tpl file at the bottom it says '{$pagetitle}' this is what gives the page its title in the main content area, I want to put '{$pageicon}' next to that line and have it work exactly the same was as the pagetitle one but with images instead. 0 Quote Link to comment Share on other sites More sharing options...
siforek Posted May 26, 2009 Share Posted May 26, 2009 Nope i want the image to change per page and only have to put one line on one page. For example: I have this setup for the title of my sidebar area: If you look in the header.tpl file at the bottom it says '{$pagetitle}' this is what gives the page its title in the main content area, I want to put '{$pageicon}' next to that line and have it work exactly the same was as the pagetitle one but with images instead. The $pagetitle is within <title> tags. You can't put an image there. Just like in the default template try putting this in the header: <img src="templates/{$template}/images/{$filename}.png" alt="{$pagetitle}" /> Obviously change the file extension to jpg, gif, if needed. you could also use css classes as well: <div id="{$filename}"> <div class="icon"></div> </div> #contact .icon { display: block; width: 50px; height: 50px; background: url(images/icons/contact.gif); } 0 Quote Link to comment Share on other sites More sharing options...
RandyC Posted May 27, 2009 Author Share Posted May 27, 2009 Yes I know it is in the header but it is also in the main content, open your 'header.tpl' file and go to the VERY BOTTOM of it, you will find something along the lines of this: <h2>{$pagetitle}</h2> You know when your at the homepage of your WHMCS at the top it says "Portal Home" thats generated by using the pagetitle code. 0 Quote Link to comment Share on other sites More sharing options...
siforek Posted May 27, 2009 Share Posted May 27, 2009 Yes I know it is in the header but it is also in the main content, open your 'header.tpl' file and go to the VERY BOTTOM of it, you will find something along the lines of this: <h2>{$pagetitle}</h2> You know when your at the homepage of your WHMCS at the top it says "Portal Home" thats generated by using the pagetitle code. Well not in "mine" as I've completely recoded most of it, but I get what you're saying. If you're talking about just creating the smarty variable "{$pageicon}", then in your header you could do this: {php} global $smarty; $title = $smarty->get_template_vars('pagetitle'); $pageicon = "<img src=\"images/".basename($_SERVER['PHP_SELF'], ".php").".gif\" alt=\"".$title."\" />"; $smarty->assign('pageicon', $pageicon); {/php} Then "{$pageicon}" would output <img src="images/index.gif" alt="Portal Home" /> That what you're looking for? 0 Quote Link to comment Share on other sites More sharing options...
RandyC Posted May 27, 2009 Author Share Posted May 27, 2009 I think so will try it out later. Thanks 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.