-
AuthorPosts
-
zdjl505 Friend
zdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 9, 2011 at 6:57 am #165014Hi,
When using standard joomla 1.5.23 & T3 Framework 2, there is a way to show image & text as menu title, but I can’t find way how to use image only (without text). Bellow are template modification to do that.
1. Image as background or not
By default ‘T3 Framework 2’ show image in menu as background. To use image only you need to show image as image instead of as background. Actually there is an option to change it as image. Open file pluginssystemjat3coretemplate.php & edit line 585,
Old:
[PHP]$japarams->set(‘menu_background’, 1); //0: image, 1: background[/PHP]
New:
[PHP]$japarams->set(‘menu_background’, 0); //0: image, 1: background[/PHP]2. Add parameter ‘Show Image Only’
Add parameter in ‘Parameters (JA Extended)’ tab of ‘Menu Item: Edit’ page for activate or deactivate ‘Show Image Only’ option. Open file pluginssystemjat3coreparamsparams.xml & insert this code after closing tag </param> of ‘mega_showtitle’.<param name="mega_imageonly" type="radio" default="0" label="Show Image Only" description="Show Image Only Desc">
<option value="0">No</option>
<option value="1">Yes</option>
</param>3. Add into language file
Add into language file label & description of new parameter ‘Show Image Only’. This is important if you want to translate in other language then English. Open file administratorlanguageen-GBen-GB.plg_system_jat3.ini & insert this code at line 369-370:SHOW IMAGE ONLY=Show Image Only
SHOW IMAGE ONLY DESC=Show Image Only as menu title4. Modify menu program
The last step is modify file pluginssystemjat3coremenubase.class.php, replace
Old code at line 350:
[PHP]$txt = ‘<span class=”menu-image”><img src=”‘.JURI::base(true).’/images/stories/’.$iParams->get(‘menu_image’).'” alt=”‘.$tmpname.'” title=”‘.$tmpname.'” /></span><span class=”menu-title”>’ . $tmpname . ‘</span>’;[/PHP]
with new code:
[PHP]if ($tmp->megaparams->get (‘imageonly’)) {
$txt = ‘<span class=”menu-image”><img src=”‘.JURI::base(true).’/images/stories/’.$iParams->get(‘menu_image’).'” alt=”‘.$tmpname.'” title=”‘.$tmpname.'” /></span>’;
} else {
$txt = ‘<span class=”menu-image”><img src=”‘.JURI::base(true).’/images/stories/’.$iParams->get(‘menu_image’).'” alt=”‘.$tmpname.'” title=”‘.$tmpname.'” /></span><span class=”menu-title”>’ . $tmpname . ‘</span>’;
}[/PHP]You can input image file at ‘Parameters (System)’ tab of ‘Menu Item: Edit’ page.
Regards,
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 9, 2011 at 7:12 am #395428Explain this in detail [ but I can’t find way how to use image only (without text). ]
zdjl505 Friendzdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 9, 2011 at 7:31 am #395435Hi Chavan,
I mean can’t find the way to use image only as menu title without doing this modification. To make clear about ‘image & text as menu title’ and ‘image only as menu title’ please see attached image.
-
chavan Friend
chavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 9, 2011 at 7:58 am #395442Post your site Url
zdjl505 Friendzdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 9, 2011 at 8:21 am #395452Sorry, it is still in localhost. BTW, are there normal way (without modification) to use image only as menu title?
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 9, 2011 at 9:24 am #395467you must add this css code to hide the text “text-indent: -999em;”
Without the site Url. I could not let you know which css code you need to do.
But try adding this css code to this file /plugins/system/jat3/base-themes/default/css/menu/mega.css
#ja-mainnav #menu1{
text-indent: -999em;
}
Note: If you Find my Post useful please click on the Thanks Icon1 user says Thank You to chavan for this useful post
zdjl505 Friendzdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 9, 2011 at 12:59 pm #395508Hi Chavan,
Thanks for your idea to use ‘text-indent:-999em’. Actually I don’t add your code to #ja-mainnav because all menu items will have no text. I just want only certain menu items to use image as menu title. Instead of your code, I add
.notextmenu{
text-indent: -999em;
}
to /plugins/system/jat3/base-themes/default/css/menu/mega.css. Then input that new css name (notextmenu) to ‘Additional class’ field at ‘Parameters (JA Extended)’ tab of ‘Menu Item: Edit’ page. This method (use css) also fulfill what I want with above modification.Regards,
zdjl505 Friendzdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 10, 2011 at 3:03 pm #395730Hi Chavan,
There is a little correction. The method ‘text-indent:-999em’ to make image only as menu title is not work for menu item that have sub menu (child). Actually, the method ‘text-indent:-999em’ is print menu title in far left (-999em) so do for their sub menus.
In my case, I want to use parent menu with image only and module below or sub menu is normal. For this purpose my modification is work.
Regards,
chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 11, 2011 at 3:11 am #395792Is everything is done? If not Please upload your site and post your site Url.
zdjl505 Friendzdjl505
- Join date:
- March 2011
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 2
- Thanked:
- 1 times in 1 posts
June 11, 2011 at 3:20 am #395795chavan Friendchavan
- Join date:
- October 2014
- Posts:
- 4612
- Downloads:
- 0
- Uploads:
- 110
- Thanked:
- 1440 times in 1290 posts
June 11, 2011 at 3:27 am #395798yes I can understand the issue. If there is a css issue it may differ from one to another. Thats why we are asking for your Site Url. This is would be more helpful to figure out the css issue. Please understand post you localhost site to live server and then provide your Url.
Please understand and do the Needful. Since we can suggest you accurately than assumption that I have done on my previous post.
AuthorPostsViewing 11 posts - 1 through 11 (of 11 total)This topic contains 11 replies, has 2 voices, and was last updated by chavan 13 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum