Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • propedeutique Friend
    #137409

    Hi,
    Thanks first for this beautiful template!

    My question: I have created several header pictures and it works fine.
    But I’d like one of this header pictures to be systematically visible when an user opens the site.
    In other words, I don’t want that, when an user opens the site, to have a random picture but a specific one.

    Is it possible?

    The order of the header pictures doesn’t have any impact on which image is displayed first.

    Thanks for your help – Bye

    scotty Friend
    #287881

    I’ve been trying to learn some PHP lately so I’m really chuffed I got this to work.

    Anyway…

    Backup your templates index.php file first (just in case:p)

    Now open index.php and find on line 275…
    [php]<!– BEGIN: HEADER –>

    <div id=”ja-headerwrap”>

    <div id=”ja-header” class=”clearfix” style=”background: url(<?php echo $tmpTools->templateurl(); ?>/images/header/<?php echo $tmpTools->getRandomImage(dirname(__FILE__).DS.’images/header’); ?>) no-repeat top <?php if($this->direction == ‘rtl’) echo ‘left’; else echo ‘right’;?>;”>[/php]and change to…
    [php]<!– BEGIN: HEADER –>

    <div id=”ja-headerwrap”>
    <?php $menu = &JSite::getMenu(); ?>
    <?php if ($menu->getActive() == $menu->getDefault()) { ?>
    <div id=”ja-header” class=”clearfix” style=”background: url(<?php echo $tmpTools->templateurl(); ?>/images/header1/header1.jpg) no-repeat top <?php if($this->direction == ‘rtl’) echo ‘left’; else echo ‘right’;?>;”>
    <?php } else { ?>
    <div id=”ja-header” class=”clearfix” style=”background: url(<?php echo $tmpTools->templateurl(); ?>/images/header/<?php echo $tmpTools->getRandomImage(dirname(__FILE__).DS.’images/header’); ?>) no-repeat top <?php if($this->direction == ‘rtl’) echo ‘left’; else echo ‘right’;?>;”>
    <?php } ?>[/php]

    Note in the new text, /images/header1/header1.jpg is the path to the image you want to appear on the frontpage and you have to change it to suit yourself.

    This new code will always display that image on your frontpage and will randomise all other header images.

    propedeutique Friend
    #288673

    Thanks a lot for your help.
    It works fine!
    Bye

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

This topic contains 3 replies, has 2 voices, and was last updated by  propedeutique 15 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum