Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • danhgarcia Friend
    #149057

    Hello, I have sections that are not using the com_content component but I would still like for those sections to use the color configured in the Ja News2 module.

    How can I do that? Can I set a default color for each section without using the Ja News2 module?

    Thanks.

    Anonymous Moderator
    #334193

    Hi danhgarcia

    We are using colors from sections in ja news module for our template

    I am sorry for not being of much help in the case.

    danhgarcia Friend
    #334234

    <em>@JA Developer 166905 wrote:</em><blockquote>Hi danhgarcia

    We are using colors from sections in ja news module for our template

    I am sorry for not being of much help in the case.</blockquote>

    Ok so there is no way to hack this? Any help whatsoever would be useful. I mean, the CSS files are there, all you have to do is make the code change somewhere….I would think anyway.

    Thanks.

    Saguaros Moderator
    #334373

    hello danhgarcia!

    this is a heavy customization i have not many time to do this for u, at the moment . i only give you simple step to you begin to customize this:

    1) open the file: templates/ja_telineiii/libs/ja.template.helper.php and find codes:

    [PHP]
    function getThemeForSection () {
    //get the most parent menu id
    $query = “select params from #__modules where `module`=’mod_janews2′”;
    $database =& JFactory::getDBO();
    $database->setQuery($query);
    $params = new JParameter($database->loadResult());
    $sections = $params->get(‘sections’, ”);
    if (!$sections) return ”;

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

    if(!$menu) return;
    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’];
    $sectionid = $this->getSectionId($catid);
    }

    if($sectionid) {
    $sectionids = preg_split(‘/[n,]|<br />/’, $sections);
    for ($i = 0; $i < count($sectionids); $i++) {
    $temp = split(‘:’,$sectionids[$i]);
    if(isset($temp[0]) && $temp[0]==$sectionid) {
    return isset($temp[1])? ‘-‘.trim($temp[1]):”;
    }
    }
    }
    return ”;
    }
    [/PHP]

    pls try to get knowledge from above codes.

    Good luck

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

This topic contains 4 replies, has 3 voices, and was last updated by  Saguaros 14 years, 1 month ago.

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