Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • gpaynter Friend
    #124210

    Hi there,

    I am currently building a site based on the Rochea template at http://nwt.edu.au/index.php

    I am also a rank beginner with PHP so I am trying to get a hold of how things work.

    Currently there is a function that rotates the header images from an array:

    <blockquote>#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’); // Each sub header image will be assigned to each menu</blockquote>

    depending on the “CurrentMenuIndex”

    The main coding for this function is in ja_templatetools.php as follows:

    <blockquote>function getCurrentMenuIndex(){
    global $Itemid, $database, $mosConfig_shownoauth, $my;
    //Get top menu id;
    $id = $Itemid;
    $menutype = ‘mainmenu’;
    $ordering = ‘0’;
    while (1){
    $sql = “select parent, menutype, ordering from #__menu where id = $id limit 1”;
    $database->setQuery($sql);
    $row = null;
    $database->loadObject($row);
    if ($row) {
    $menutype = $row->menutype;
    $ordering = $row->ordering;
    if ($row->parent > 0)
    {
    $id = $row->parent;
    }else break;
    }else break;
    }
    if ($mosConfig_shownoauth) {
    $sql = “SELECT count(*) FROM #__menu AS m”
    . “nWHERE menutype='”. $menutype .”‘ AND published=’1’ AND parent=0 and ordering < $ordering”;
    } else {
    $sql = “SELECT count(*) FROM #__menu AS m”
    . “nWHERE menutype='”. $menutype .”‘ AND published=’1’ AND access <= ‘$my->gid’ AND parent=0 and ordering < $ordering”;
    }
    $database->setQuery($sql);

    return $database->loadResult();
    }</blockquote>

    I would like to change the way this image rotation works so that the images rotate for the individual content items linked from the “Training Programs” link in the mainmenu along the top.

    EG I want the http://nwt.edu.au/index.php?option=com_content&task=view&id=25&Itemid=42 item to have its own image, and then http://nwt.edu.au/index.php?option=com_content&task=view&id=17&Itemid=32 to have its own image… and so on for all content items linked from that menu.

    I know this is a lot to chew on as a beginner. Can anyone give me any pointers?

    Thanks in advance!

    napalm73 Friend
    #235328

    hi…
    just looked at your site and it seems that you have managed to do that, am I right?
    I need to do something similar as I want to change the header according to the sub-menu instead of the main menu items. How did you do it at the end?
    .isk.

    mfcphil Friend
    #235352

    When I used this template I made lots of copies of the original template then save different images in the image folders of each template then assigned each template to its own sections 😉 So in your case you could name one of your templates Aged Care and another Training Advisory you then simply add your age care images to that folder then assign that template to the aged care pages.

    napalm73 Friend
    #236100

    hi… thanks for your reply. i didn’t know that you could use multiple template at once. so you must use according to the “section” created in joomla, is this correct? each template/header is paired with a section.
    let me know if i got this right!
    .isk.

    mfcphil Friend
    #236225

    you copy a template for which part of the site or page/pages you need, rename it to suit and upload the new images you want to the new templates image folder, as long a you have it assigned to the correct page/pages you will be fine.You can copy as many templates as you want.

    When I used Rochea I had about 10 seperate rochea templates for each product, so I could used different headers.

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

This topic contains 5 replies, has 3 voices, and was last updated by  mfcphil 16 years, 10 months ago.

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