MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Dec 04, 2008, 01:14 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
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
:Read
Frequently Asked Questions (FAQ)
MODx Community Forums
»
Support
»
General Support
(Moderators:
zi
,
PaulGregory
)
»
custom class for the dropmenu's <LI>
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: custom class for the dropmenu's <LI> (Read 2803 times)
0 Members and 1 Guest are viewing this topic.
grunt_lord
Full Member
Posts: 202
"Doing the most out of nothing"
custom class for the dropmenu's <LI>
«
on:
Mar 30, 2006, 01:49 PM »
Hi!
I want to use Lightbox Gone Wild to show my website content, but to do so I would need to have a custom class added to the <li> of the dropmenu. How can I do it ??
thanks in advance,
Blaise
Logged
Blaise Bernier
www.medialdesign.com
- Solutions for small business, hosting, design and more!
rthrash
Foundation
Posts: 9,575
Re: custom class for the dropmenu's <LI>
«
Reply #1 on:
Mar 30, 2006, 09:27 PM »
Hmmm... describe what you want in a feature request and we'll see if it can happen for the next release (bugtracker request that is...)
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.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (097 Wiki)
|
Fisheye SVN Browser
heliotrope
Coding Team
Posts: 2,447
Re: custom class for the dropmenu's <LI>
«
Reply #2 on:
Mar 31, 2006, 02:57 AM »
Hi,
I've made a couple of changes in dropMenu to achieve this.
I've posted the tip in french Forum.
I copy and Paste the way I've realized the hack.
Hope this help.
Create a new TV called -> idCssMenu (text)
Duplicate DropMenu and made these changes
- Added after line 224:
Code:
$myTv = $modx->getTemplateVar('IdCssMenu',$fields='*',$child['id']);
- line 262 (<p> tags are specifics to my needs)
Code:
($myTv !='' ) ? $idCss = 'id="'.$myTv['value'].'": $idCss ='';
$output .= " <li $idCss class=\"$hereClass". ($numChildren == 0 ? ' last' : '')."\">$itm<p>".$child['introtext']."</p></li>$ie";
- and line 297
Code:
<li $idCss $class>$itm$desc</li>$ie";
EDIT: I guess you 'll have to modidfy more lines after 262 because I didn't need to custom sublevel
«
Last Edit: Mar 31, 2006, 03:10 AM by heliotrope
»
Logged
Made with MODx :
traduction en ligne
|
agence de traduction
|
copadel, fruits et légumes
|
Provence
|
Dictionnaire en ligne
Professional Website:
dixsix, communication interactive
grunt_lord
Full Member
Posts: 202
"Doing the most out of nothing"
Re: custom class for the dropmenu's <LI>
«
Reply #3 on:
Mar 31, 2006, 03:44 PM »
It's not a bad idea! But i was wrong... I needed a class in the link, not the <li>... Anyway, Scotty Delicious is working on an extended version of the Drop Menu and he is supposed to include that specific feature!
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
Re: custom class for the dropmenu's <LI>
«
Reply #4 on:
Mar 31, 2006, 07:02 PM »
Quote from: grunt_lord on Mar 31, 2006, 03:44 PM
It's not a bad idea! But i was wrong... I needed a class in the link, not the <li>... Anyway, Scotty Delicious is working on an extended version of the Drop Menu and he is supposed to include that specific feature!
And....
Revision 0.1 is done. You can check it out here:
http://modxcms.com/forums/index.php/topic,3724
later
-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.
heliotrope
Coding Team
Posts: 2,447
Re: custom class for the dropmenu's <LI>
«
Reply #5 on:
Apr 01, 2006, 01:25 AM »
@ grunt_lord
I thought that you wanted to set a different class to each <li> that's why I proposed this hack. :-)
Logged
Made with MODx :
traduction en ligne
|
agence de traduction
|
copadel, fruits et légumes
|
Provence
|
Dictionnaire en ligne
Professional Website:
dixsix, communication interactive
grunt_lord
Full Member
Posts: 202
"Doing the most out of nothing"
Re: custom class for the dropmenu's <LI>
«
Reply #6 on:
Apr 01, 2006, 02:07 AM »
hehe... at first i thought i wanted to modify the <LI> too
Logged
Blaise Bernier
www.medialdesign.com
- Solutions for small business, hosting, design and more!
Dimmy
Testers
Posts: 1,824
Я не говорю по-русски 私は日本語を話さない
Re: custom class for the dropmenu's <LI>
«
Reply #7 on:
Apr 01, 2006, 04:19 AM »
Dit Ryan not give an example a while ago (I searched can not find it any more) to use the &pre and the &post tag to generate a custom style tag for eacht document depending on the id?
somthing like &pre=`<span class=[*id*]>` &post=`</span>` not sure if it was this but it would grab the id number of that menu item so if you would have page 1,2,3,4,5 tbe listed in dropmenu than the class would automaticly be 1,2,3,4,5
but I can not recall it by hart anymore and I can not find the original post.
Logged
"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
rthrash
Foundation
Posts: 9,575
Re: custom class for the dropmenu's <LI>
«
Reply #8 on:
Apr 01, 2006, 07:59 AM »
That would actually put in the id of the current document, but that would indeed work. You could also create a unique ID by using the counter in the for loop though.
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.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (097 Wiki)
|
Fisheye SVN Browser
sottwell
Documentation Team
Posts: 8,170
Re: custom class for the dropmenu's <LI>
«
Reply #9 on:
Apr 02, 2006, 06:48 AM »
I've done that when I wanted to have a different background for each main menu item. I simply added an incrementing variable into the MakeMap loop and appended it to the LI class specified in the snippet options when the <li... tag is being generated.
Quote
<ul class="topnav">
<li class="category1">Item One
...submenu
</li>
<li class="category2">Item Two
...submenu
</li>
<li class="category3">Item Three
...submenu
</li>
<li class="last category4">Item Four
...submenu
</li>
</ul>
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
Dimmy
Testers
Posts: 1,824
Я не говорю по-русски 私は日本語を話さない
Re: custom class for the dropmenu's <LI>
«
Reply #10 on:
Apr 03, 2006, 01:44 AM »
Quote from: sottwell on Apr 02, 2006, 06:48 AM
I've done that when I wanted to have a different background for each main menu item. I simply added an incrementing variable into the MakeMap loop and appended it to the LI class specified in the snippet options when the <li... tag is being generated.
Quote
<ul class="topnav">
<li class="category1">Item One
...submenu
</li>
<li class="category2">Item Two
...submenu
</li>
<li class="category3">Item Three
...submenu
</li>
<li class="last category4">Item Four
...submenu
</li>
</ul>
could you post the change here and the sntippet call?
Logged
"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
sottwell
Documentation Team
Posts: 8,170
Re: custom class for the dropmenu's <LI>
«
Reply #11 on:
Apr 03, 2006, 07:15 AM »
Depending on the version number your line numbers may vary.
Line 217:
Code:
$categoryNumber = 1; // initialize li class number - sottwell
//loop through and process subchildren
foreach ($children as $child) {
// figure out if it's a containing category folder or not
Line 277:
Code:
// it's an empty folder and using Category Folders
if ($useCategoryFolders && $itsEmpty) {
$class .= ($class ? ' ' : '').$categoryClass.$categoryNumber; // append li number - sottwell
}
and line 298:
Code:
$class = '';
$categoryNumber++; // increment li class number - sottwell
}
}
$output .= "</ul>$ie";
Snippet call:
Code:
[[DropMenu?startDoc=`49`]]
I only wanted this for empty top-level folders, so that's where I added the number variable. You can see where I used this
here
. Each top-level li has a different background image. The "category" class is automatically added to empty folders; you can of course change the name in the snippet call with &categoryClass.
«
Last Edit: Apr 03, 2006, 07:23 AM by sottwell
»
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
Dimmy
Testers
Posts: 1,824
Я не говорю по-русски 私は日本語を話さない
Re: custom class for the dropmenu's <LI>
«
Reply #12 on:
Apr 05, 2006, 06:07 AM »
Nice this is exacly what i need aswhell
Logged
"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
=> Internationalization
===> Bulgarian
===> Chinese
===> Czech
===> Dutch
===> French
===> German
===> Irish
===> Italian
===> Japanese
===> Polish
===> Portuguese
===> Russian
===> Slovak
===> Spanish
===> Swedish
===> Persian - فارسي
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> QuickEdit
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Web Design and Development
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
Czech Community
-----------------------------
=> Oznámení
===> Důležitá oznámení/novinky
===> Bezpečnost
=> Podpora
===> FAQ (často kladené otázky)
===> Instalace
===> Moduly, pluginy, "snippets & code" (šablony zdrojových kódů)
===> Design & Šablony
=> Dokumentace, tutoriály (návody) a překlady
===> Dokumentace
===> Tutoriály (návody)
===> Překlady (lokalizace)
=> Komunita
===> Oznámení
===> Představte se, prosím
===> Ukázky práce
===> Různé aneb cokoli co se jinam nehodí
-----------------------------
Bulgarian Community
-----------------------------
=> Поддръжка
===> Често задавани въпроси
===> Инсталация
===> Модули, Плъгини, Снипети и код
===> Дизайн и Шаблони
=> Документация, Ръководства и Превод
===> Документация
===> Ръководства
===> Превод
=> Общество
===> Съобщения
===> Представете се
===> Представете сайта си
===> Дискусии извън MODx
-----------------------------
Dutch Community
-----------------------------
=> Ondersteuning
===> Veel gestelde vragen
===> Modules, Plugins, Snippets & Code
===> Design & Templates
=> Documentatie, Tutorials en Vertalingen
===> Documentatie
===> Tutorials
===> Vertalingen
=> Community
===> Aankondigingen
===> Stel jezelf voor
===> Site Showcase
===> De stamkroeg
-----------------------------
Finnish Community
-----------------------------
=> Tuki
===> UKK
===> Asennus
===> Moduulit, liitännäiset, koodinpätkät
===> Ulkoasu/Sivustopohjat
=> Dokumentaatio, oppaat ja käännökset
===> Dokumentaatio
===> Käännökset
===> Oppaat
=> Yhteisö
===> Tiedotteet
===> Esittele itsesi
===> MODx sivustosi
===> Kahvihuone
-----------------------------
Filipino Community
-----------------------------
=> Suporta
===> Kadalasang tanong
===> Instalasyon
===> Moduler, Maidadagdag, Karagdagang mga Code
===> Desenyo at Templates
=> Dokumentasyon, Mga Turo, Mga Salin
===> Dokumentasyon
===> Mga Turo
===> Mga Salin
=> Kumunidad
===> Anunsyo
===> Ipakilala ang sarili
===> Ang Galing ng pinoy
===> Tsismisan atbp
-----------------------------
French Community
-----------------------------
=> Support
===> FAQ
===> Installation
===> Module, plugin, snippets
===> Design/Templates
=> Documentation, Tutoriels et Traductions
===> Documentation
===> Traduction
===> Tutoriels
=> Communauté
===> Annonces
===> Présentez vous
===> Vos sites
===> Le Bistrot Français
-----------------------------
German Community
-----------------------------
=> Support (de)
===> FAQ (de)
===> Installation (de)
===> Module, Plugins, Snippets & Code (de)
===> Design & Templates (de)
=> Dokumentation, Tutorials und Übersetzung
===> Dokumentation
===> Tutorials (de)
===> Übersetzung
=> Community (de)
===> Ankündigungen
===> Stellt Euch vor
===> Beispielseiten
===> Off Topic / Verschiedenes
-----------------------------
Irish Community
-----------------------------
=> Tacaíocht
===> CC Ceisteanna Coitianta
===> Breiseáin (cláir bhreise), Snippets & Comhaid
===> Suiteáil
===> Dearadh & Teimpléid
=> Doiciméid, Teagascóireacht agus Aistriúchán
===> Doiciméadú
===> Teagascóireacht
===> Aistriúchán
=> Pobal
===> Fógraí
===> Cuir Tú Féin in Aithne
===> Gailearaí an Láithreáin
===> Caifé / An Tábhairne / Ábhar Cainte Eile / Ilghnéitheach
-----------------------------
Italian Community
-----------------------------
=> Supporto
===> FAQ
===> Installazione
===> Moduli, Plugin, Snippet e altro codice
===> Web Design e Template
=> Documentazione, Tutorial e Traduzione
===> Documentazione
===> Tutorial
===> Traduzione
=> Comunità
===> Annunci
===> Presentazioni
===> Siti in vetrina
===> Chiacchiere in libertà
-----------------------------
Japanese Community
-----------------------------
=> サポート
===> 良くある質問
===> インストール
===> モジュール・プラグイン・スニペット・本体
===> デザインやテンプレート
=> マニュアル・テュートリアル・翻訳
===> マニュアル
===> 事例集、テュートリアル
===> 日本語化
=> コミュニティ
===> お知らせ
===> MODxサイト展示場
===> 自己紹介
===> 雑談
===> 国産リソース
-----------------------------
Persian Community
-----------------------------
=> پشتيباني
===> راهنما
===> نصب
===> ماژول , پلاگین ها , کد ها و جزییات
===> طراحی و قالب ها
=> مستند سازی , آموزش ها و ترجمه ها
===> مستند سازی
===> آموزش ها
===> ترجمه ها
=> انجمن ها
===> اخبار
===> معرفی کردن خود
===> نمایش دادن سایت ها
===> بحث های عمومی و سایر موضوعات
-----------------------------
Polish Community
-----------------------------
=> Wsparcie
===> FAQ
===> Instalacja
===> Moduły, pluginy, snipety i kod
===> Wygląd i szablony
=> Dokumentacja, tutoriale i tłumaczenie
===> Dokumentacja
===> Tutoriale
===> Tłumaczenie
=> Społeczność
===> Ogłoszenia
===> Przedstaw się
===> Twój serwis WWW
===> Hyde Park
-----------------------------
Portuguese Community
-----------------------------
=> Suporte
===> FAQ - Dúvidas Frequentes
===> Instalação
===> Módulos, Plugins, Snippets e Código
===> Design e Templates
=> Documentação, Guias e Traduções
===> Documentação
===> Guias
===> Traduções
=> Comunidade
===> Anúncios
===> Apresente-se!
===> Bar da esquina (fora de tópico)
===> Portfólio de Sites
-----------------------------
Russian Community
-----------------------------
=> Поддержка
===> ЧАВО (FAQ)
===> Установка
===> Модули, плагины, сниппеты и код
===> Дизайны и шаблоны
=> Документация, Уроки, Перевод
===> Документация
===> Уроки
===> Перевод
=> Сообщество
===> Объявления
===> Представьтесь публике
===> Галерея сайтов
===> Диван
-----------------------------
Scandinavian Community
-----------------------------
=> Support
===> Frågor och svar
===> Installation
===> Moduler, plugins, snippets och kod
===> Design & sidmallar
=> Dokumentation, guider och översättningar
===> Dokumentation
===> Guider
===> Översättningar
=> Webbgemenskap
===> Meddelanden
===> Presentera dig själv
===> Visa upp dina webbsidor
===> Ordet fritt
-----------------------------
Spanish Community
-----------------------------
=> Soporte
===> FAQ
===> Instalación
===> Modulos, Plugins, Snippets & Código
===> Diseño y plantillas
=> Documentación, Tutoriales y Traducciones
===> Documentatción
===> Tutoriales
===> Traducciones
=> Comunidad
===> Anuncios
===> Presentaciones personales
===> Muestra de sitios
===> El Café
-----------------------------
TÜRKÇE (Turkish)
-----------------------------
=> Destek
===> SSS
===> Kurulum
===> Modüller, Pluginler, Snippetlar & Kodlar
===> Dizayn & Temalar
=> Belgeleme, Eğitmenler ve Çeviri
===> Belgeleme
===> Eğitmenler
===> Çeviri
=> Topluluk
===> Duyurular
===> Kendinizi Tanıtın
===> Site Vitrini
===> Konu Dışı