Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • yasinsah Friend
    #136762

    Hi all,

    I have to following problem:

    I am not using the Janews mods on my site. Instead of this I use a third Party component. However, I have to create external links to get the menulink. When i do this, the color assignment does neither work when i hover nor when I click on the menu and activate it. It stays blank.

    Once again i do not use the janews mods. when I use it it works but i use another component.

    I tried several things with template.css and color themes css files but couldn’t find the solution.

    Could one of the admin take a closer look. please !

    Sherlock Friend
    #285552

    Dear yasinsah !
    Color scheme ( set color for section or category blog menu) is gotten params of JA news module if you don’t use ja news module you can’t use colors option.

    Please open ja_templatetools_1.5.php file in templates/ja_teline_ii folder, go to line 281 :


    function getThemeForSection () {
    .................

    this is function to get color for menus. you must modify this function to customize color following component, I am sorry for not being of much help in this case.

    willyram Friend
    #286919

    This worked for me:

    In file ja_templatetools_1.5.php in the templates/ja_teline_ii folder:

    Replace function getThemeForSection (the last function in the file)

    with the following:


    function getThemeForSection () {
    //get the most parent menu id
    $query = "select params from #__modules where `module`='mod_janews'";
    $database =& JFactory::getDBO();
    $database->setQuery($query);
    $params = new JParameter($database->loadResult());
    $catorsec = $params->get('catorsec');
    $itemids = $params->get('itemids');
    $catids = $params->get('catid');

    global $Itemid;
    $mid = $Itemid;
    $pid = $mid;
    $menu = &JSite::getMenu();

    if(!$menu) return;
    if($catorsec==0) {
    while ($pid) {
    $mid = $pid;
    $pmenu = $menu->getItem($mid);
    $pid = $pmenu?$pmenu->parent:0;
    }
    }
    //Get menu item
    $menuitem = $menu->getItem($mid);
    //parse link
    $urls = parse_url($menuitem->link);
    $querystring = $urls['query'];
    $output = null;
    parse_str ($querystring,$output);
    $sectionid = 0;
    if($output['view']=='section'){
    $sectionid = $output['id'];
    }
    else if($output['view']=='category'){
    $catid = $output['id'];
    if($catorsec==0) {
    $sectionid = $this->getSectionId($catid);
    }
    else {
    $sectionid = $catid;
    }
    }
    if($sectionid) {
    if(!$sectionid) return '';
    if ($catids) {
    $catids = preg_split('/[n,]|<br />/', $catids);
    }else {
    return '';
    }
    for ($i = 0; $i < count($catids); $i++) {
    $temp = split(':',$catids[$i]);
    if(isset($temp[0]) && $temp[0]==$sectionid) {
    return isset($temp[1])? '-'.trim($temp[1]):'';
    }
    }
    } else if ($itemids) {
    $itemids = preg_split('/[n,]|<br />/', $itemids);
    for ($i = 0; $i < count($itemids); $i++) {
    $temp = split(':',$itemids[$i]);
    if(isset($temp[0]) && $temp[0]==$mid) {
    return isset($temp[1])? '-'.trim($temp[1]):'';
    }
    }
    } else
    return '';
    }

    Then on file mod_janews.xml in modules/mod_janews folder:

    Right after line beggining with

    <param name="catid" type="textarea" cols="30" rows="10"

    Add:

    <param name="itemids" type="textarea" cols="30" rows="10" default="" label="Menu Itemids for non-blogs" description="Indicate themes to use for non-blog menu-items, enter same as above: line by line. In each line, put Menu ItemId and color theme, seperated by a : (Example: 14:orange and so on). Works only for top-level menus" />

    Usage:

    Go to mod_janews module options, you will find a new box called “Menu Itemids for non-blogs”

    There, you can input the IDs of the top-level menus (from the menu option in joomla) and associate it with a color theme as before.

    This could be done with a template override, if anyone can explain the override, will appreciate.

    Hope this helps…
    Willieram.

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

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

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