-
AuthorPosts
-
snfctech Friend
snfctech
- Join date:
- February 2009
- Posts:
- 11
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
February 12, 2009 at 10:52 pm #138082The Userguide for Rochea mentions “dropline” – but, in fact, this template does not include a a dropline option (for some reason).
Is there a straight-forward way to integrate a dropline menu from another Joomlart template? For example, I took the ja_scriptdlmenu directory and DLmenu.class.php files from the Villadi template and put them in the Rochea ja_menus directory. Then I modified the templateDetails.xml and ja_vars.php to include this as an option. However, it looks like I probably have to make a lot of changes to the CSS.
Any suggestions? Or is this a lot of work and a big headache? I don’t understand why the Rochea template doesn’t include this in the first place – especially since it is mentioned in the userguide..
Thanks.
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
February 13, 2009 at 8:30 am #291062Hi snfctech,
Before install the template quickstart, you must add this menu to installationsqlmysqlsample_data.sql file
snfctech Friendsnfctech
- Join date:
- February 2009
- Posts:
- 11
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
February 13, 2009 at 6:28 pm #291175Hi JA Developer. Thanks for your reply.
1. The sample_data.sql file is filled with many tables. It’s not obvious to me what the SQL insert statement would look like to add the dropline menu. I don’t even know which table(s) need to be modified. Can you give me an idea?
2. Can’t I add this data to my current installation? It has already been modified quite a bit, and I would hate to have to do a fresh install.
Thanks.
snfctech Friendsnfctech
- Join date:
- February 2009
- Posts:
- 11
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
February 18, 2009 at 2:53 pm #292380@ja Developer: This thread should not have been marked “Answered.”
And, no offense, but I think your suggestion to modify the SQL sample data is incomplete and misleading.
So that others do not waste time with this: It seems that if you want to add a true mouse-over Dropline menu to your Joomlarts template (if it doesn’t come with it) is to just add the JS yourself. (I guess pure CSS would be better, but I modified the split menu, so if JS is disabled, the split menu behavior will still work.)
If anyone needs help with this, I’ll post some code snippets.
1 user says Thank You to snfctech for this useful post
imsleepy Friendimsleepy
- Join date:
- January 2009
- Posts:
- 451
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 94
- Thanked:
- 45 times in 1 posts
February 18, 2009 at 10:22 pm #292449Would love to see the snippets. Thanks!
ShannonN FriendShannonN
- Join date:
- July 2006
- Posts:
- 1947
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 16
- Thanked:
- 172 times in 49 posts
February 19, 2009 at 2:51 am #292473imsleepy;113370Would love to see the snippets. Thanks!
Hi Imsleepy
For some of teh best examples and code for css menus (free) go over to projectseven their css tutorials are very good, as a dreamweaver user you probably already know PVII 🙂http://www.projectseven.com/tutorials/css/index.htm
Hope you find this interesting, I always love Al and Gerrys stuff
Cheers ShannonNimsleepy Friendimsleepy
- Join date:
- January 2009
- Posts:
- 451
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 94
- Thanked:
- 45 times in 1 posts
February 19, 2009 at 3:32 am #292476<em>@ShannonN 113403 wrote:</em><blockquote>Hi Imsleepy
For some of teh best examples and code for css menus (free) go over to projectseven their css tutorials are very good, as a dreamweaver user you probably already know PVII 🙂http://www.projectseven.com/tutorials/css/index.htm
Hope you find this interesting, I always love Al and Gerrys stuff
Cheers ShannonN</blockquote>I will go take a look. Don’t use DW though.
ShannonN FriendShannonN
- Join date:
- July 2006
- Posts:
- 1947
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 16
- Thanked:
- 172 times in 49 posts
February 19, 2009 at 11:55 am #292529imsleepy;113406I will go take a look. Don’t use DW though.
Even with notepad you can code these ones 🙂
snfctech Friendsnfctech
- Join date:
- February 2009
- Posts:
- 11
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
February 23, 2009 at 6:45 pm #293101@imsleepy: Sorry for the late reply – I guess my user CP had the wrong email so I wasn’t notified of the thread reponses.
Here are some snippets:
Add a query to beginMenu() in the SplitMenu class to add a JS subnav array when the Menu is rendered.
[PHP]
// add property indicating this is a splitmenu
$this->menu_type = ‘split’;// add subnav as JS array
$db =& JFactory::getDBO();
$query = ”
SELECT id, parent, name, ordering, link FROM #__menu
WHERE parent
IN(
SELECT id
FROM #__menu
WHERE menutype=’mainmenu’
AND published=1
AND parent=0
)
ORDER BY ordering
“;
$db->setQuery($query);
$rows = $db->loadAssocList();
// index rows by parent id
$indexed_rows = array();
foreach ($rows as $r) {
if (array_key_exists($r[‘parent’],$indexed_rows)) {
array_push($indexed_rows[$r[‘parent’]],$r);
} else {
$indexed_rows[$r[‘parent’]][0] = $r;
}
}
echo ‘<script type=”text/javascript”> var subnavs = ‘ . htmlentities(json_encode($indexed_rows),ENT_NOQUOTES) . ‘</script>’;
[/PHP]
Then add a mouseover to the menu tag generation in the menu base class:
[PHP] $onmouseover = null;
if ($this->menu_type == ‘split’ && $tmp->parent == 0) {
// add mouseover JS to split-menu
$onmouseover = ‘ onmouseover=”showSubnav(this);” ‘;
}if ($tmp->url != null)
{
switch ($tmp->browserNav)
{
default:
case 0:
// _top
$data =
‘<a href=”‘.$tmp->url.'” ‘.$active.’ ‘.$id.’ ‘.$title.$itembg.$onmouseover.’>’.$txt.'</a>’;
…
[/PHP]I also added a showSelectedSubnav() method to the lower container to reset the subnav to the selected menu when the user mouses away. Here’s the JS:
[PHP]
function showSubnav(e) {
var subnav = document.getElementById(‘ja-subnav’);
// get currently selected nav (return when done with mouseover)
var anchor_str = e.toString();
var parent_id = anchor_str.match(/Itemid=(d{1,3})/)[1];subnav.innerHTML = getSubnavMarkup(parent_id);
}
function getSubnavMarkup(parent_id) {
// get nav subnavs from subnavs array (passed during nav rendering on server)
var nav_subnavs = subnavs[parent_id];var subnav_markup = ‘<div class=”sublevel”><ul >’;
for (var i=0; i<nav_subnavs.length; ++i) {
subnav_markup += ‘<li><a id=”menu’ + nav_subnavs[‘id’] + ‘”‘;
subnav_markup += ‘ title=”‘ + nav_subnavs[‘name’] + ‘”‘;
subnav_markup += ‘ href=”‘ + nav_subnavs[‘link’] + ‘&Itemid=’ + nav_subnavs[‘parent’] + ‘” >’;
subnav_markup += ‘ <span >’ + nav_subnavs[‘name’] + ‘</span></a></li>’;
}subnav_markup += ‘</ul></div>’;
return subnav_markup;
}function showSelectedSubnav() {
var menu_param = window.content.location.href.match(/Itemid=(d{1,3})/);
var subnav = document.getElementById(‘ja-subnav’);// clear subnav if no selected main nav
if (!menu_param) {
subnav.innerHTML = ‘<div class=”sublevel”><ul><li><a><span>Â </span></a></li></ul></div>’;
} else {
var selected_nav_id = menu_param[1];
subnav.innerHTML = getSubnavMarkup(selected_nav_id);
}}
[/PHP] -
AuthorPosts
This topic contains 9 replies, has 4 voices, and was last updated by snfctech 15 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum