Posted by OnthegOinOz on November 13, 2012 at 10:21am
Hi,
I am have a great deal of trouble placing a login button/image in the header of my D7 install. I can get the login image to appear on the front page and any page that is domainname/page, but as soon as it goes domainname/page/subpage or domainname/node/No# it disappears.
Any ideas? I'm sure i just do not know how to put the code in correctly or possibly on appropriate page.
This is what I have on the page.tpl.php....
<div id="page-wrapper">
<div id="page">
<header id="header" role="banner" class="clearfix">
<div class="header-indent">
<div class="section-1 clearfix">
<div id="login"><a href="https://ourdomain" title="Support and Account Login"><img src="sites/all/themes/theme611/login.png" alt="my image"></a></div>
<div id="call">call sales on <span>phne number</span></div>
<div class="col1">
<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
</a>
Comments
Tried devel_themer?
It sounds like you're getting good results with one theme template but that template isn't applying to all content on your site. Have you tried the devel_themer module (http://drupal.org/project/devel_themer)? This module provides some in-page tools to help you see easily which templates and/or theme functions are building the current page.
- TwoMice
Hi, thanks for your response.
Hi,
thanks for your response. I'll try the module suggested.
I think it has to do with the sub pages. For example, I noticed that I created a block with an image in it and enabled it to be viewed on mydomain/page and it worked. Both image and block title could be seen.
But when I enabled it to be seen mydomain/page/subpage the title could be seen and image could not.
To get the image to be seen on the subpage I had to create a new block with title and image, and make the link to the image "../sites/all/themes/theme611/xyz.png" rather than "sites/all/themes/theme611/xyz.png"
Which is why I mention it being to do with the subpages.
Any insight appreciated.
seems to be the page.tpl.php page
Hi,
I have installed the dev theme module and I seem to have the correct tpl page that I am adding the login button but still it does not work.
I think it has more to do with my previous post and the reference to sub pages. If the page currently being viewed drops down a level, i.e. to a sub page... mydomain/page/subpage its like its looking for images in actual subfolders that do not exist, which is why in the block example I previously gave using the ../ seem to work.
That cannot obviously be done on a page.tpl.php as its common across all pages. and even then, whilst I was on the subpage and manually tried to edit in firebug it did not work?
Any further suggestions? It seems unless I am using it incorrectly, that Drupal does not respond well to subpages... which seems unusual?
subpages not showing images unless ../ is used?
I have confirmed it is definitely related to the subpages and the relationship to images requiring the ../ in front i.e. "../sites/all/themes/theme611/login.png" to make it work on subpages.
This is annoying.
Is there a way perhaps to create some sort of php call for the image in the tpl file or fix drupal to work properly with sub pages?
Thanks
Ok... just to close this off.
Ok... just to close this off.
It seems to get it to work everywhere i need to use the full site link for images and then they work on subpages.
I got in touch with the template makers and they made this suggestion and it seem to work.
Thanks