test
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • intownwebdesign Friend
    #127050

    I like the header rotation feature so much I am putting it in the edenite template.

    My development site is:
    http://rubber.intownwebdesign.com/

    I think I have most of it worked out.

    I am able to display the header image correctly.

    I can not get the image to rotate based on the different main menu items.

    Having trouble with the function:

    $ja_headerimg = $ja_header_images [getCurrentMenuIndex() % count($ja_header_images)];

    Where does this information come from?

    What code am I missing?

    I can post what I have pasted into my ja_vars_1.0x.php file if needed.

    Thanks!

    Menalto Friend
    #243539

    Please do that, and post all steps you have done.

    intownwebdesign Friend
    #243569

    Thanks for the reply!

    I have the headers correctly changing with each page.

    I will post what I have done incase there is a way I can simplify the code I have added.

    http://rubber.intownwebdesign.com/

    1. In ja_vars_1.0x.php (in the edenite theme) I added the following code:
    I selected this code by searching through the rochea template looking for elements that related to the header image rotation.

    // Section to rotate the headers

    global $ja_color_themes, $ja_header_images, $ja_width_default, $ja_color_default,
    $ja_font_size_default, $ja_tool, $ja_menutype, $ja_template_path, $ja_template_absolute_path,
    $ja_headerimg, $ja_color, $ja_width, $ja_font_size, $ja_template_name;

    $ja_template_name = 'ja_edenite';

    #Header images: you can add more subheader images. Please refer to User Guide for full information
    $ja_header_images = array('sh01','sh02','sh03','sh04','sh05','sh06','sh07'); // Each sub header image will be assigned to each menu

    $ja_header_type = 1; // 0: no header image; 1: header image for each menu item; 2: random header

    # Define the template path ##########
    $ja_template_path = $mosConfig_live_site.'/templates/'.$ja_template_name;
    $ja_template_absolute_path = $mosConfig_absolute_path.'/templates/'.$ja_template_name;
    include ($ja_template_absolute_path."/ja_templatetools.php");

    $ja_headerimg = "";
    if ($ja_header_type == 1) {
    $ja_headerimg = $ja_header_images [getCurrentMenuIndex() % count($ja_header_images)];
    if (!is_file("$ja_template_absolute_path/images/headers/$ja_headerimg-bg1.jpg")) $ja_headerimg = $ja_header_images [0];
    }

    if ($ja_header_type == 2) {
    $ja_headerimg = $ja_header_images[rand (0, count($ja_header_images)-1)];
    if (!is_file("$ja_template_absolute_path/images/headers/$ja_headerimg-bg1.jpg")) $ja_headerimg = $ja_header_images [0];
    }

    2. I copied ja_templatetools.php from the rochea theme to the edenite theme.
    /templates/ja_edenite/ja_templatetools.php

    3. I created the headers folder and uploaded my images.
    /templates/ja_edenite/images/

    4. I updated index.php with the following code and updated the css with the correct image size:

    <!-- BEGIN: HEADER -->
    <!-- <div id="ja-header" class="clearfix"> -->
    <div id="ja-header" style="background: url(<?php echo "$ja_template_path/images/headers/$ja_headerimg-bg1.jpg";?>) no-repeat bottom left;">

    I am pretty sure those are the steps I took. It all seems to be working.

    Can some of the code I added to ja_vars_1.0x.php be removed?

    Is it bad to have ja_templatetools.php and ja_templatetools_1.0x.php being called at the same time?

    Is there a way to merge the two files together?

    Thanks!

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

This topic contains 3 replies, has 2 voices, and was last updated by  intownwebdesign 16 years, 9 months ago.

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