test
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • TAnne Mills Friend
    #143580

    Hi,

    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,
    T

    TAnne Mills Friend
    #314819

    More 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,
    T

    TAnne Mills Friend
    #314820

    This 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 Moderator
    #314821

    Hi tanne,

    Glad you figured it out, if you could provide us the URL of the site with the above feature, may be we can shift this thread to tutorials /tips.

    regards

    Arvind

    TAnne Mills Friend
    #314822
    Arvind Chauhan Moderator
    #314823

    Thanks 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

Viewing 6 posts - 1 through 6 (of 6 total)

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