MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Oct 07, 2008, 03:03 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
modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Donate to MODx:
Donations
MODx Community Forums
»
Support
»
General Support
(Moderators:
zi
,
PaulGregory
)
»
Individual ids for list items in dropmenu
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: Individual ids for list items in dropmenu (Read 3491 times)
0 Members and 1 Guest are viewing this topic.
anselm1109
Jr. Member
Posts: 15
Individual ids for list items in dropmenu
«
on:
May 08, 2006, 11:34 AM »
I've been searching for this but can't seem to find anything.
Is there any way to make DropMenu assign individual id's for each list item in its output?
so the first list item's id could simply be listitem-1 and the next listitem-2 etc.
This would make it a lot easier to create style sheets and do some fun scriptaculous effects.
«
Last Edit: May 10, 2006, 09:30 AM by rthrash
»
Logged
sottwell
Documentation Team
Posts: 8,142
Re: Individual ids for list items in dropmenu
«
Reply #1 on:
May 08, 2006, 11:38 PM »
With a bit of creative hacking, it can be done. You have to set a variable to 0 before the loop, where the code generates the <li... tags add the id="item'.$variable.'... and then increment the variable at the bottom of the loop. Or you can simply use the $child['id'] value to make a unique ID, it depends on what you want to do with it. If there are going to be a lot of them that you want to do something with, and you want to process them in order, the first method would be better, while if you're just going to work with a few, the second would be easier to code, as well as being able to identify the menu item with the document it is pointing to. I used the second method here:
http://www.alandaniel.co.uk/builder.html
I could have used a hard-coded menu for the main four sections, with four DropMenu calls, but this way was more fun.
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
anselm1109
Jr. Member
Posts: 15
Re: Individual ids for list items in dropmenu
«
Reply #2 on:
May 09, 2006, 08:28 PM »
Thanks, I didn't think of using the $child['id'] value. That makes a lot of sense. I'm not really working on anything in specific, I'm just playing with the idea of using scriptaculous effects on a dropmenu. That's a lot easier when everything has id's.
Thanks for the tip!
Logged
whitehat
Jr. Member
Posts: 29
Re: Individual ids for list items in dropmenu
«
Reply #3 on:
May 21, 2006, 10:58 AM »
Quote from: sottwell on May 08, 2006, 11:38 PM
With a bit of creative hacking, it can be done. You have to set a variable to 0 before the loop, where the code generates the <li... tags add the id="item'.$variable.'... and then increment the variable at the bottom of the loop. Or you can simply use the $child['id'] value to make a unique ID, it depends on what you want to do with it. If there are going to be a lot of them that you want to do something with, and you want to process them in order, the first method would be better, while if you're just going to work with a few, the second would be easier to code, as well as being able to identify the menu item with the document it is pointing to. I used the second method here:
http://www.alandaniel.co.uk/builder.html
I could have used a hard-coded menu for the main four sections, with four DropMenu calls, but this way was more fun.
HI again,
I am sending you the template of my site and the css that will be used for the topmenu... I thought this would be more effective in order to explain to me what should I do
... if there should be any javascript involved with this, can you send me a sample 2?
Thanks,
Whitehat
the_templatecss.zip
(1.67 KB - downloaded 237 times.)
«
Last Edit: May 21, 2006, 11:03 AM by whitehat
»
Logged
whitehat
Jr. Member
Posts: 29
Re: Individual ids for list items in dropmenu
«
Reply #4 on:
May 21, 2006, 11:02 AM »
P.S This would be the final thing I need in order to finish this site....
Logged
kickass
Full Member
Posts: 159
Re: Individual ids for list items in dropmenu
«
Reply #5 on:
May 21, 2006, 01:18 PM »
Hmm, just a thought- if you can set this up so each item has its own ID, then for accessibility can it be set up for accesskeys in a similar manner?
I don't have the talent to do this, but if someone who is capable can do it and post this, it would be a REALLY awesome addition to the modx snippet stable (and REALLY kick some Joomla butt . . . )
Logged
"I'd love to change the world but I can't find the source code . . ."
Custom ModX Templates
sottwell
Documentation Team
Posts: 8,142
Re: Individual ids for list items in dropmenu
«
Reply #6 on:
May 22, 2006, 12:33 AM »
Already done. (the Search feature is sometimes very useful...)
http://modxcms.com/forums/index.php/topic,3031.0.html
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
whitehat
Jr. Member
Posts: 29
Re: Individual ids for list items in dropmenu
«
Reply #7 on:
May 22, 2006, 04:53 AM »
Quote from: sottwell on May 22, 2006, 12:33 AM
Already done. (the Search feature is sometimes very useful...)
http://modxcms.com/forums/index.php/topic,3031.0.html
I think we are just wasting time with these back and forth posts.... I did get the dropmenu hacked by you before thanks to your post 2 days ago... and replaced the old DropMenu and it works fine (It's returning ID's of the Documents).
The reason that I sent you the template and the css in my previous post is that I cant figure it out how to configure the CSS accordingly on inactive hover and active and how to call this css in the div tag of the topmenu and in the menu itself (see below in the code section).
And the second reason is that in the template other than calling:
Code:
<div id="navcontainer" style="position:absolute; width:752px; height:22px; z-index:2; left: 172px; top: 11px;" class="navcontainer">
[!DropMenu? &menuName=`top` &startDoc=`[*StartDoc*]` &levelLimit=`1` &topnavClass=`navcontainer` &here=`activeLink`!]
</div>
for the Top menu I dont know what to do.
Should there be specified something in the head section that would suggest to the dropmenu to get the pics for those id's.
And finaly CSS
(the css file would it look like this? see the attached file for the details).
Since you have already made this work it would help to actually put a post about the whole process of installation of this issue.. starting from DropMenu, DropMenu Template Calling and css sample ... this way the things would actually be more effective (but of course thats what I think).
Anyway I thank you for your continued support starting with multilingual support and all the rest... you never got tired of helping and I am greatefull for that I just Hope that you can find time to input me with the information that I mentioned in this post....
This would terminate my problems and my site would be finished and ready for publishing with a footer message on it that will say thanks to modx team and especially to Susan.
Cheers,
WhiteHat
css.zip
(0.47 KB - downloaded 239 times.)
Logged
kickass
Full Member
Posts: 159
Re: Individual ids for list items in dropmenu
«
Reply #8 on:
May 22, 2006, 08:15 AM »
Thanks Susan, though it would have been much easier to see if listed on the Repository Snippet list, which it isn't, at least not on the main list, which is the first place I look for special stuff.
Logged
"I'd love to change the world but I can't find the source code . . ."
Custom ModX Templates
sottwell
Documentation Team
Posts: 8,142
Re: Individual ids for list items in dropmenu
«
Reply #9 on:
May 22, 2006, 01:43 PM »
@kickass: I don't think they put hacks and modifications in the "repository" section, they are sort of unauthorized, use-at-your-own-risk things.
@whitehat: I don't understand your question. In the example link, the top-level menu item's dropdowns with the unique images are simply styled with a height and width and a background image.
Code:
...
#top ul.topnav li ul{
display:none;
clear:left;
position:absolute;
top:2.1em;
left:0;
width:184px;
height:120px;
border-top:1px solid white;
cursor:default;
}
...
#top ul.topnav li.category1 ul{
background:#ada86e url(menuimages/menu1.jpg) bottom left no-repeat;
}
...
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
whitehat
Jr. Member
Posts: 29
Re: Individual ids for list items in dropmenu
«
Reply #10 on:
May 22, 2006, 02:14 PM »
Quote from: sottwell on May 22, 2006, 01:43 PM
@kickass: I don't think they put hacks and modifications in the "repository" section, they are sort of unauthorized, use-at-your-own-risk things.
@whitehat: I don't understand your question. In the example link, the top-level menu item's dropdowns with the unique images are simply styled with a height and width and a background image.
Code:
...
#top ul.topnav li ul{
display:none;
clear:left;
position:absolute;
top:2.1em;
left:0;
width:184px;
height:120px;
border-top:1px solid white;
cursor:default;
}
...
#top ul.topnav li.category1 ul{
background:#ada86e url(menuimages/menu1.jpg) bottom left no-repeat;
}
...
Thanks nevermind I got it solved, in the next few days I will send you the complete templates and modifications made by me so you will see what I ment , Anyway the whole multilingual site is working perfectly thanks mostly to your input...
Thanks allot,
Cheers WhiteHat
Logged
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
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> 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ışı