-
AuthorPosts
-
TAnne Mills Friend
TAnne Mills
- Join date:
- September 2014
- Posts:
- 88
- Downloads:
- 28
- Uploads:
- 6
- Thanks:
- 38
- Thanked:
- 14 times in 1 posts
August 17, 2009 at 5:36 am #143580Hi,
Can someone tell me how to test the page (via URL or article ID), so I can change the logo displayed in the header on different pages of the website?
Thanks,
TTAnne Mills FriendTAnne Mills
- Join date:
- September 2014
- Posts:
- 88
- Downloads:
- 28
- Uploads:
- 6
- Thanks:
- 38
- Thanked:
- 14 times in 1 posts
August 18, 2009 at 1:45 am #314819More info:
I was thinking it could be done in the index.php file of the template.
Something like:
if ($thisPage) {
logo1
} else {
logo2
}I just need help in figuring out how to determine which page is being displayed/rendered (i.e the $thisPage bit).
Thanks,
TTAnne Mills FriendTAnne Mills
- Join date:
- September 2014
- Posts:
- 88
- Downloads:
- 28
- Uploads:
- 6
- Thanks:
- 38
- Thanked:
- 14 times in 1 posts
August 20, 2009 at 3:45 am #314820This is how you can do it:
In the index.php file for your template:
look for this line
if ($tmpTools->getParam(‘logoType’)==’image’) {And then replace the following lines:
<h1 class="logo">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1>
With this:
$currentURL = $tmpTools->getCurrentURL(); //Get the current URL
if ($currentURL =='/index.php?option=com_content&view=article&id=6&Itemid=7') {
//Replace the bit after index.php? with the correct URl for the page you want to alter the logo on - NOTE the
// ampersands need to be written as &
?>
<h1 class="logo logo2">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1>
<? } else {?>
<h1 class="logo">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1>
<? } ?>
You will also then need to add the following to your template.css file
h1.logo2 a {
background: url(../images/logo2.gif) no-repeat !important;
display: block;
height: 100px;
width: 260px
You will probably then have to use Firebug to check the css and adjust padding etc around the logo2 (unless your logo2 is identical in size to your main logo).
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
TAnne Mills FriendTAnne Mills
- Join date:
- September 2014
- Posts:
- 88
- Downloads:
- 28
- Uploads:
- 6
- Thanks:
- 38
- Thanked:
- 14 times in 1 posts
August 20, 2009 at 6:29 am #314822See – http://www.poolcolourguard.com.au
The Spa ColourGuard page (http://www.poolcolourguard.com.au/index.php?option=com_content&view=article&id=6&Itemid=7) has the altered logo.
1 user says Thank You to TAnne Mills for this useful post
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
August 20, 2009 at 6:42 am #314823Thanks tanne,
I have moved a copy of this thread to Tutorial Forums >> http://www.joomlart.com/forums/topic/how-to-implement-different-logo-on-different-pages/
Have also modified the title for easy understanding.
I have also modified your posts in the Tutuorial thread to make it comprehensive and upto the point. Hope you wont mind.
Would close this thread, as the copy has been created in the tutorial forums.
Thanks a lot.
Arvind
-
AuthorPosts
This topic contains 6 replies, has 2 voices, and was last updated by Arvind Chauhan 15 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum