• Free Domain Names with Yearly hosting

You are here: Home Joomla Joomla Forums

spacer
Welcome, Guest
Please Login or Register.    Lost Password?

Problem with Parent Items with no Subitems
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Problem with Parent Items with no Subitems
#1038
Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 0  
Hi, first of all let me congratulate you for this accordion menu. It is what I was looking for, but I have a problem and I hope you can help me.

I’m using “Joomla! 1.5.18 Stable” with the menu version 0.9.7.15N, which I downloaded from www.simplebydesign.co.uk/images/fbfiles/...s/accordionmenu.zip.
I don’t know why but at the web page I think the current version is 0.9.6.15N.

I’m trying to use this accordion menu with a menu like this.

*Item1
-Subitem1.1
-Subitem1.2
-Subitem1.3
*Item2
*Item3
-Subitem3.1

The first problem I’ve encountered is that I get three error messages like these:

Notice: Undefined variable: row in ***modulesmod_sbd_rollmenumod_sbd_rollmenu.php on line 725

Notice: Trying to get property of non-object in ***modulesmod_sbd_rollmenumod_sbd_rollmenu.php on line 725

Notice: Trying to get property of non-object in ***modulesmod_sbd_rollmenumod_sbd_rollmenu.php on line 367

Line 725 is: $GLOBALS['sSBDRollMenudEBUG'][$row->id]['header'] = "Added as Custom Tag";
And Line 367: if($my->gid){, which refers to the type of user.

I can comment this and the problem disappears but I’d like to know if that’s important.

And the main problem: I get a message like this with the Parent options that don’t have subitems:
Notice: Undefined index: 48 in ***modulesmod_sbd_rollmenumod_sbd_rollmenu.php on line 557
>Item2

The 48 index is the ItemID of the menu option.

I don’t know what to do to solve this issue. I want the parent options with subitems to open by clicking them and the parent options with no subitems to go to the URL by clicking them, so this is my module configuration:

Mouse Over Action: Version 1 (requires CSS mod)
Use Mouse Over: No
Use Mouse Out: No
Top Menu as Link: No
Show Top Menu link: Never
Expand Top Menu: No
Expand One Level Menu: No

Do you have an idea about how to solve it? Any help is appreciated!

Thank you very much for your time and sorry for the long post!
carbosoc (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#1039
Re:Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 0  
I forgot to say that on Line 557 (the one of my main problem) I have:

if( $params->get( 'use_mouseover' ) == 0 && $params->get('top_linkclick' ) == 0 && !isset( $children[$row->id] ) && !is_array( $children[$row->id] ) && $params->get( 'noextramenu' ) == 0 ){

The problem seems to be that there’s nothing on $children at the parent item index when it doesn’t have any subitem (logic). But I want to know what can I do to solve this. Of course I could turn off the “display_errors” property on the PHP, but I don’t know if that would be a good idea…

Maybe it's a stupid question

PS: I’ve tried to edit my main message but I can’t… The path of the files is wrong. Of course it is modules/mod_sbd_rollmenu/mod_sbd_rollmenu.php
carbosoc (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#1040
Re:Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 14  
Hi,

Sorry for the delay, don't worry about the long post - its nice to get a long fault description (even though its not nice getting a long fault description )

With regard to you problems please can you try this version - hopefully it will have caught all the errors - please let me know if I missed one.

You will need to back up any CSS you may have altered in the modules CSS.

Many Thanks
File Attachment:
File Name: mod_sbdrollmenu_083.zip
File Size: 23097
SimpleByDesign (Admin)
Moderator
Posts: 435
graph
User Offline Click here to see the profile of this user
Gender: Male Birthdate: 1977-09-21
The administrator has disabled public write access.
 
#1041
Re:Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 0  
Thanks for your fast replay!

I’ve tried your new version and most of the problems have disappeared, including the main problem. But I’m still getting this one:

Notice: Trying to get property of non-object in ***modulesmod_sbd_rollmenumod_sbd_rollmenu.php on line 442

Line 442 has:

if($my->gid){

It seems to be the same problem as before regarding to the user type, but well, I think I can comment that because it seems to me that the variable intUserType is not used for the moment, is it?

Thanks so much for your help!

I want to add that I’ve been modifying some parts of the module in order to be able to change the class “a-m-t-n” in the onMenuMouseover function –as you do with “a-m-t”- (because IE didn’t let me use CSS with “a-m-t-n:hover”) and the code is very understandable and intuitive. That’s a big advantage!
carbosoc (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#1042
Re:Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 14  
Oops sorry missed that one - though I didn't get an error message so do you have permissions set on your menu?

If you add the following line to the module just above the line with the error it should fix your error message:

Code:

$my =& JFactory::getUser();


There is also another reference about line 192 for $my, if you add the same code above the SQL creation code this will make sure no error is produced here - though currently that part of the code should not be used, but maybe better to be safe ....

I would be interested to see you code when you have finished.

Many Thanks
SimpleByDesign (Admin)
Moderator
Posts: 435
graph
User Offline Click here to see the profile of this user
Gender: Male Birthdate: 1977-09-21
The administrator has disabled public write access.
 
#1043
Re:Problem with Parent Items with no Subitems 1 Year, 5 Months ago Karma: 0  
What do you mean with permissions on the menu? All my menus are public, none of them is restricted but it doesn’t matter anymore. Thanks to your code I don’t have any problem now

I would be interested to see you code when you have finished.

If you’re referring to what I said about my modification I did nothing important because I’m a newbie here I’ve just added a new function in the javascript file which is identical to “function getDT(e)” but just changing the line 30
Code:

if(YUD.hasClass(dEl,'a-m-t')){ found  = true ; break;};

for
Code:

if(YUD.hasClass(dEl,[b]'a-m-t-n'[/b])){ found  = true ; break;};


For example:
Code:

function getDTnoChildren(e)
{
var dEl = YUE.getTarget(e);
if( (e.tagName + '').toUpperCase()=='DD' )
{
var dt = e.previousSibling ;
while(dt)
{
if(dt.tagName &&  dt.tagName.toUpperCase() == 'DT'){break;};
dt = dt.previousSibling
};

if(!dt || dt.tagName.toUpperCase() != 'DT'){return;}
else{return (dt.tagName==='DT')?dt:null};
}
else if(e.clientX)
{
var found = false;
while( dEl.parentNode)
{
//this is the only change
if(YUD.hasClass(dEl,'a-m-t-n')){ found  = true ; break;};
dEl = dEl.parentNode;
};
if(!found){return null}
else{return (dEl.tagName==='DT')?dEl:null };
};
};



And then in lines 221 and 240, “var onMenuMouseover = function(e)” and “var onMenuMouseout = function(e)”, I changed the first checking
Code:

if(!dMenuTitle){return;};

for this one:
Code:

if(!dMenuTitle){
dMenuTitle = getDTnoChildren(e);
if(!dMenuTitle) {return;};
}



If I’m not wrong with this modification we can change the class of the parent items with no children to know if it is hovered. As I’d told you I need that because IE6 only supports the hover attribute on <a> elements so I couldn’t use “a-m-t-n:hover”.

The problem now is that I can’t use the compressed javascript file because I don’t know how to change it But that's not a big problem.

Again, thank you very much for this wonderful module and for your help! And sorry for my English
carbosoc (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Copyright © Simple By Design Limited