Dec 04, 2008, 12:20 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Donate to MODx: Donations
Pages: [1] 2   Go Down
  Print  
Author Topic: DropMenu. if SelfAsLink = false  (Read 5274 times)
0 Members and 1 Guest are viewing this topic.
openagate
Committed to MODx
*****
Posts: 770



« on: Dec 21, 2005, 07:58 PM »

Any element of menu, if current page, -- isn't a link. SelfAsLink no more:)
Correct snatch of code by just add
$itm .= ((!$selfAsLink && ($child['id'] == $modx->documentIdentifier)) || ($itsEmpty && $useCategoryFolders)) ?
for
elseif ($isFolder && $inside):

Code:
/////////////////////////////// If at the top level
if (!$inside)
{
$itm .= ((!$selfAsLink && ($child['id'] == $modx->documentIdentifier)) || ($itsEmpty && $useCategoryFolders)) ?
                                        $pre.$child[$textOfLinks].$post . (($debugMode) ? ' self|cat' : '') : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$pre.$child[$textOfLinks].$post.'</a>';
$itm .= ($debugMode) ? ' top' : '';
}
/////////////////////////////// it's a folder and it's below the top level
elseif ($isFolder && $inside)
{
   
$itm .= ((!$selfAsLink && ($child['id'] == $modx->documentIdentifier)) || ($itsEmpty && $useCategoryFolders)) ?
$pre.$child[$textOfLinks].$post . (($debugMode) ? 'subfolder T': '') : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$pre.$child[$textOfLinks].$post.'</a>'. (($debugMode) ? ' subfolder F' :'');       
}
/////////////////////////////// it's a document inside a folder
else
{
$itm .= ($child['alias'] > '0' && !$selfAsLink && ($child['id'] == $modx->documentIdentifier)) ? $child[$textOfLinks] : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$child[$textOfLinks].'</a>';
$itm .= ($debugMode) ? ' doc' : '';
}
Logged

rthrash
Foundation
*
Posts: 9,577



WWW
« Reply #1 on: Dec 22, 2005, 01:12 AM »

What is not happening that you expect to happen?
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
openagate
Committed to MODx
*****
Posts: 770



« Reply #2 on: Dec 22, 2005, 07:30 AM »

So...

The site has some levels, for example:

--Level 1(start)
---------Level 11(end)
---------Level 12
----------------Level 121(end)
----------------Level 122
-----------------------Level 1221(end)
-----------------------Level 1222(end)
-----------------------Level 1223(end)
----------------Level 123(end)
---------Level 13(end)


& SelfAsLink = false

it would be desirable, that when we are at the Level 12
or at the Level 122, an active element of the menu would not be a link.
At the start or end Level -- all right -- SelfNotAsLink.

I hope, that I state clearly . English - not  my native language. Smiley



 
Logged

rthrash
Foundation
*
Posts: 9,577



WWW
« Reply #3 on: Dec 22, 2005, 08:12 AM »

The way the self as link should function in my mind is to turn off only for the page you're on. Was it not doing that properly?
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
openagate
Committed to MODx
*****
Posts: 770



« Reply #4 on: Dec 22, 2005, 09:57 AM »

The way the self as link should function in my mind is to turn off only for the page you're on.

Yes, I think so... and for ANY page we're on.

Was it not doing that properly?

No, if not make the small amendment which I have offered.

See up: If we're on the page "Level 122" and SelfAsLink = false, I  don't wanna have  page link  itself.
 
Logged

rthrash
Foundation
*
Posts: 9,577



WWW
« Reply #5 on: Dec 22, 2005, 10:04 AM »

Out of curiosity, which version of DropMenu are ou using? (from which MODx version)
« Last Edit: Dec 22, 2005, 10:07 AM by rthrash » Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
openagate
Committed to MODx
*****
Posts: 770



« Reply #6 on: Dec 22, 2005, 10:06 AM »

oops!

I wrote:
"active element of the menu"

I mean:
"the page we're on"

Logged

openagate
Committed to MODx
*****
Posts: 770



« Reply #7 on: Dec 22, 2005, 10:10 AM »

Out of curiosity, which version of DropMenu are ou using? (from which MODx version)

MODx 0.9.0 (x9)
Logged

openagate
Committed to MODx
*****
Posts: 770



« Reply #8 on: Dec 29, 2005, 06:00 AM »

New MODx's DropMenu without problem:)
Logged

rthrash
Foundation
*
Posts: 9,577



WWW
« Reply #9 on: Dec 29, 2005, 08:37 AM »

Thanks for the update opengate and glad it's working now. Smiley
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
openagate
Committed to MODx
*****
Posts: 770



« Reply #10 on: Dec 29, 2005, 10:02 PM »

Yeh Smiley &

thank folks -- & who has created, & who helps to develop the MODx!
Logged

yoomai
Full Member
***
Posts: 247



WWW
« Reply #11 on: Jun 13, 2006, 09:13 AM »

This problem is still valid in 0.9.2.1.: If a document is a folder AND it's below the top level AND you want it not to be a link (selfAsLink=`false`) then DropMenu fails. Like topic starter wrote, change the original code at lines 238 - 245
Code:
// it's a folder and it's below the top level
elseif ($isFolder && $inside)
{
   
$itm .= ($itsEmpty && $useCategoryFolders) ?
        $pre.$child[$textOfLinks].$post . (($debugMode) ? 'subfolder T': '') :
        '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$pre.$child[$textOfLinks].$post.'</a>'. (($debugMode) ? ' subfolder F' :'');       
}
to
Code:
// it's a folder and it's below the top level
elseif ($isFolder && $inside)
{
   
$itm .= ((!$selfAsLink && ($child['id'] == $modx->documentIdentifier)) || ($itsEmpty && $useCategoryFolders)) ?
$pre.$child[$textOfLinks].$post . (($debugMode) ? 'subfolder T': '') : '<a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'">'.$pre.$child[$textOfLinks].$post.'</a>'. (($debugMode) ? ' subfolder F' :'');       
}
and you're done.

Thank you, openagate!
Logged

ddmobley
Jr. Member
*
Posts: 12


« Reply #12 on: Jun 13, 2006, 10:22 PM »

DropMenu also displays inconsistent with regard to "selfAsLink" activated.  If "selfAsLink" is set to true then the "here" class for the parent document is discarded.  If you are styling a menu with CSS using the "here" label, it shouldn't matter whether or not "selfAsLink" is active or not.  But DropMenu discards "here" for the parent document in the menu tree if "selfAsLink" is set to "true".
Logged
yoomai
Full Member
***
Posts: 247



WWW
« Reply #13 on: Jun 14, 2006, 04:48 AM »

DropMenu also displays inconsistent with regard to "selfAsLink" activated.  If "selfAsLink" is set to true then the "here" class for the parent document is discarded.  If you are styling a menu with CSS using the "here" label, it shouldn't matter whether or not "selfAsLink" is active or not.  But DropMenu discards "here" for the parent document in the menu tree if "selfAsLink" is set to "true".
http://modxcms.com/forums/index.php/topic,2609.msg17880.html#msg17880
Logged

davidm
Marketing & Design Team
*
Posts: 6,780


The best way to predict the future is to invent it


WWW
« Reply #14 on: Jun 14, 2006, 06:05 AM »

DropMenu also displays inconsistent with regard to "selfAsLink" activated.  If "selfAsLink" is set to true then the "here" class for the parent document is discarded.  If you are styling a menu with CSS using the "here" label, it shouldn't matter whether or not "selfAsLink" is active or not.  But DropMenu discards "here" for the parent document in the menu tree if "selfAsLink" is set to "true".

I happen to encounter this very problem and it's driving me nuts Sad !
I didn't connect it to the selfAsLink parameter, I'll try to set it to false see if it solves it... thanks for pointing that out !

I have tried the hack from Cino, but it only works with activeTreeOnly hack and I don't want that...


Thanks for the pointer !
« Last Edit: Jun 14, 2006, 06:08 AM by davidm » Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.6 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!