Dec 04, 2008, 01:06 AM *
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: [Snippit] DropMenu 1.2- set .class and rel for <a> tags.  (Read 6114 times)
0 Members and 1 Guest are viewing this topic.
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« on: Mar 31, 2006, 05:30 PM »

DropMenu Mod 1.2

This is a modification to the MODx DropMenu Snippit.
It adds the ability to set a CSS class and the HTML relationship for the <a> tags in DropMenu, i.e. :

<li><a href="contact-us.html"  class="nameofclass" rel="relationship"  title="Contact us through this web form">Contact Us</a></li>

Set in snippet as [[DropMenu? &linkClass=`nameofclass`]].  When specified in the snippet call, it adds the `class="nameofclass"` as seen above in red.  If it is not specified, there is no change to the Drop menu snippet, so you don't have to worry about it outputting empty class calls i.e. `class=" "`.

*** edit *** April 3rd 2006

Set in snippet as [[DropMenu? &rel=`relationship`]].  When specified in the snippet call, it adds the `rel="relationship"` as seen above in blue.  If it is not specified, there is no change to the Drop menu snippet, so you don't have to worry about it outputting empty rel tags, i.e. `rel=" "`.

This is very beta, so please back up your original DropMenu before you use this.  If you use this, please post whether it works for you or it doesn't.

enjoy,

-sD-
scottyDelicious

* DropMenu_1-2.txt (15.02 KB - downloaded 353 times.)
« Last Edit: Apr 03, 2006, 03:35 PM by ScottyDelicious » Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #1 on: Mar 31, 2006, 06:10 PM »

I should add, that the focus... the inspiration for this snippet is lightBox-gone-wild.  This adds support for lightBox gone wild to MODx.  In order to open a link up in a new lightbox with this javaScript, you add `class="lbOn"` to your <a> tags.  With this modification to the DropMenu snippet, anyone can add lightBox gone wild to their site!

http://particletree.com/features/lightbox-gone-wild/

-sD-
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
grunt_lord
Full Member
***
Posts: 202


"Doing the most out of nothing"


WWW
« Reply #2 on: Mar 31, 2006, 09:13 PM »

It's perfect for what I need!  I just need to do that :

[[DropMenuEx?linkClass=lbOn]]

and all the pages are shown in Lightbox...  you have to create a special template for these documents, but it's not a big deal when the menu generates itself!
Logged

Blaise Bernier

www.medialdesign.com - Solutions for small business, hosting, design and more!
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #3 on: Mar 31, 2006, 09:24 PM »

Cool Blaise!

Let us all know when you get your site running! (As of this post, it only shows the construction page).

-sD-
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
rthrash
Foundation
*
Posts: 9,575



WWW
« Reply #4 on: Mar 31, 2006, 11:23 PM »

ScottyD, please link to this thread in the tracker in the DropMenu project. Thanks!
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.
aour
Moderators
*
Posts: 835



« Reply #5 on: Apr 01, 2006, 02:46 AM »

Hi

I try it and I have one error :
Code:
PHP error debug
  Error: Missing argument 28 for MakeMap()
  Error type/ Nr.: Warning - 2
  File: D:\xampp\htdocs\projet\modx091\manager\includes\document.parser.class.inc.php(691) : eval()'d code
  Line: 200
 
Logged

Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #6 on: Apr 03, 2006, 12:04 AM »

hmmm?

Aour, I got this error the first time I edited it, because I didn't put the variable in all the maps.  When I made sure it was listed in all the map areas, it worked without problems.

Is anyone else having this issue?

Aour, can you tell me a bit about your server environment?

-sD-
scottyDelicious
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
aour
Moderators
*
Posts: 835



« Reply #7 on: Apr 03, 2006, 01:53 AM »

Hi

I do my test locally with Xampp :

Apache/2.0.54 (Win32)
PHP/5.0.4
MySQL 4.1.13

MODx 0.9.1 (rev 646)

I switch to PHP/4.4.0 but it's the same result
« Last Edit: Apr 03, 2006, 01:56 AM by aour » Logged

Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #8 on: Apr 03, 2006, 02:16 AM »

I am sorry Aour, but I am unable to recreate the error using the file attached to the first post.  Would you humor me, and re-download it from the first post?

-sD-
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
grunt_lord
Full Member
***
Posts: 202


"Doing the most out of nothing"


WWW
« Reply #9 on: Apr 03, 2006, 02:24 PM »

Hi!  Now that I got the custom class in the links, I would need to add a custom 'rel' attribute...  would it be possible??

thanks a lot!

bye,

Blaise
Logged

Blaise Bernier

www.medialdesign.com - Solutions for small business, hosting, design and more!
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #10 on: Apr 03, 2006, 03:34 PM »

Ok Blaise, your feature has been added to my DropMenu mod.

download `DropMenu_1-2.txt` from the first post. and call as
[[DropMenu? &rel=`lightbox`]] to use this for your lighbox idea.

later

-sD-
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #11 on: Apr 03, 2006, 04:54 PM »

ScottyD, please link to this thread in the tracker in the DropMenu project. Thanks!


No Problem.

the bug/feature tracker task is here:
http://modxcms.com/bugs/task/326

-sD-
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
aour
Moderators
*
Posts: 835



« Reply #12 on: Apr 04, 2006, 03:05 AM »

I do a new test with the 1.2

Same probleme. To test your code, I created a new snippet "MenuList" to keep the official "DropMenu" safe.

I decide to test it with the name "DropMenu" and now, it's OK.

Why it's impossible to use it with a different name?
Logged

grunt_lord
Full Member
***
Posts: 202


"Doing the most out of nothing"


WWW
« Reply #13 on: Apr 04, 2006, 10:13 AM »

Quote
Why it's impossible to use it with a different name?

C'est étrange... j'utilise le snippet avec un autre nom : DropMenuEx (extended)  et tout va pour le mieux...  Autres symptomes??
Logged

Blaise Bernier

www.medialdesign.com - Solutions for small business, hosting, design and more!
aour
Moderators
*
Posts: 835



« Reply #14 on: Apr 04, 2006, 12:13 PM »

Salut Grunt

Non aucun autre symptome. Cela ne fonctionne pas avec le nom "MenuList" que ce soit en php4 ou 5 avec la version 1.1 ou 1.2.
Avec le nom DropMenuEx cela pas nom plus.

Snippet name DropMenu:
With this syntax : [[DropMenu? &menuName=`navbar` &topnavClass=`navbar` &startDoc=`3` &levelLimit=`1`]] it's OK

Snippet name DropMenuEx:
With this syntax : [[DropMenuEx? &menuName=`navbar` &topnavClass=`navbar` &startDoc=`3` &levelLimit=`1`]] Same error

With this syntax : [[DropMenuEx? &startDoc=`3` ]] It's Ok
Logged

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!