-
AuthorPosts
-
January 6, 2009 at 1:19 am #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 FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
January 9, 2009 at 7:20 am #285552Dear 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.
1 user says Thank You to Sherlock for this useful post
willyram Friendwillyram
- Join date:
- August 2008
- Posts:
- 16
- Downloads:
- 9
- Uploads:
- 1
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 17, 2009 at 8:27 pm #286919This 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. -
AuthorPosts
This topic contains 3 replies, has 3 voices, and was last updated by willyram 15 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum