-
AuthorPosts
-
September 7, 2008 at 10:47 pm #133085
How can I disable the menu descriptions, so instead of getting….
Home
Welcome to the frontpageI just get ….
Home
on the top menu links.
Thanks!
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 8, 2008 at 1:59 am #269264Hi
You go to Menus-> Main menu, then choose Home menu to edit
You will see a paramater is Page title
2753
you can change as you wantSeptember 8, 2008 at 5:42 am #269362Menalto FriendMenalto
- Join date:
- May 2007
- Posts:
- 4736
- Downloads:
- 0
- Uploads:
- 43
- Thanks:
- 2
- Thanked:
- 531 times in 361 posts
September 8, 2008 at 6:19 am #269396IF you open the template folder/ja_menus/Base.class.php and find line 243 to 250 and remove it:
[PHP] //Add page title to item
if ($level == 0 && $this->getParam(‘menu_title’)) {
if ($this->getPageTitle($iParams)) {
$txt .= ‘<span class=”menu-desc”>’. $this->getPageTitle($iParams).'</span>’;
} else {
$txt .= ‘<span class=”menu-desc”>’. $tmp->name.'</span>’;
}
}[/PHP]It should work i think , just remember to backup the file before you do it.
3 users say Thank You to Menalto for this useful post
September 8, 2008 at 1:45 pm #269491Would it be possible to use the “title alias” parameter being shown instead of the “page title” as described above?
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 9, 2008 at 3:07 am #269610Hi pgrandmontagne !
to show alias on description span , you can do it following way below :
open base.class.php file in templates/ja_olivine/ja_menus folder , find following code section at about line 244 :
if ($level == 0 && $this->getParam('menu_title')) {
if ($this->getPageTitle($iParams)) {
$txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
} else {
$txt .= '<span class="menu-desc">'. $tmp->name.'</span>';
}
}
change to :
if ($level == 0 && $this->getParam('menu_title')) {$txt .= '<span class="menu-desc">'. $tmp->alias.'</span>';
}
September 9, 2008 at 8:12 pm #269817<em>@hainn84 78711 wrote:</em><blockquote>Hi pgrandmontagne !
to show alias on description span , you can do it following way below :
…
</blockquote>Hello hainn84,
I’ve done what you said, description span is empty now.
Maybe you can check the code again, please?jernejc Friendjernejc
- Join date:
- July 2008
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 2
- Thanked:
- 5 times in 4 posts
September 10, 2008 at 9:26 pm #269991The title alias would be a great solution for Joomla 1.0 as the page title parameter isn’t so common. Unfortunately the code fix above didn’t work for me either.
jernejc Friendjernejc
- Join date:
- July 2008
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 2
- Thanked:
- 5 times in 4 posts
September 10, 2008 at 10:21 pm #269994For the title alias to be written out as the menu item description you need to add these lines:
//jernej
$sql="select title_alias from jos_content where id=$tmp->componentid";
$db=mysql_query($sql);
$x=mysql_fetch_assoc($db);
$title_alias=$x["title_alias"];
in ja_olivine/ja_menus/Base.class.php ( line 218 ) right after:
$data = null;
$tmp = $item;
And then replace $tmp->name here ( line 243 or 249ish after you add the code above ):
if ($level == 0 && $this->getParam('menu_title')) {
if ($this->getPageTitle($iParams)) {
$txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
} else {
$txt .= '<span class="menu-desc">'. $tmp->name.'</span>';
}
}
with: $title_aliasSo it looks like this:
if ($level == 0 && $this->getParam('menu_title')) {
if ($this->getPageTitle($iParams)) {
$txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
} else {
$txt .= '<span class="menu-desc">'. $title_alias.'</span>';
}
}
The problem was that there is no “title_alias” field in the “jos_menu” table. So we have to get the value from the “jos_content” table.
This only solves the problem while you have ordinary content links. On the other hand though, most custom components have a parameter box on the right when you link them into a certain menu.
So if you want to set the page title parameter in that case, you just write into that box: “header=Your page title here” ( without the ” ), and that’s about it.
PS: that sql query above is a bit long, so if anyone knows an easier way, please share.. 🙂
1 user says Thank You to jernejc for this useful post
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 11, 2008 at 2:48 am #270040thanks jernejc !
your post is very helpful !trinhnfs Friendtrinhnfs
- Join date:
- March 2007
- Posts:
- 56
- Downloads:
- 3
- Uploads:
- 2
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
September 18, 2008 at 6:26 am #271111Hi
Could you show me the easy way to disable the menu descriptions. I has done but nothing changed.
Thanks and Best Regards
Trinh
Nathan L Zabaldo FriendNathan L Zabaldo
- Join date:
- September 2014
- Posts:
- 12
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 2 times in 1 posts
September 19, 2008 at 2:53 am #271248Another alternative:
In Base.class.php around line 133 in the function genMenuItem:
Below the code:
$data = null;
$tmp = $item;Add the Code:
$sql = 'select alias from jos_menu where id = ' . $tmp->id;
$db = mysql_query($sql);
$x = mysql_fetch_assoc($db);
$title_alias = $x["alias"];Then in the same genMenuItem function around line 165:
Change the //Add page title to item code to:
//Add page title to item
if ($level == 0 && $this->getParam('menu_title')) {
if ($this->getPageTitle($iParams)) {
$txt .= '<span class="menu-desc">'. $title_alias.'</span>';
} else {
$txt .= '<span class="menu-desc">'. $title_alias.'</span>';
}
}If you want to get rid of the alias and menu description code altogether just comment out the //Add page title to item block.
September 23, 2008 at 10:11 am #271870Hi,
I’ve made changes as described in this post.
Seems I’ve got some sql problems:<blockquote>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/www/root/main/praxis/joomla1/templates/ja_olivine/ja_menus/Base.class.php on line 220</blockquote>
Anybody can help me?
Thanks a lot!jernejc Friendjernejc
- Join date:
- July 2008
- Posts:
- 22
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 2
- Thanked:
- 5 times in 4 posts
September 23, 2008 at 12:08 pm #271886Did you enter the title alias in your Joomla backend? The problem might occur because that field is empty.
September 23, 2008 at 1:30 pm #271893title alias is not empty and i’ve made no code-changes but yours :confused:
-
AuthorPosts
This topic contains 16 replies, has 7 voices, and was last updated by jernejc 16 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum