MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Nov 21, 2008, 07:34 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
»
Development & Coding
»
In Development
(Moderators:
zi
,
PaulGregory
)
»
Tree Javascript Menu (like the manager document tree)
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: Tree Javascript Menu (like the manager document tree) (Read 2678 times)
0 Members and 1 Guest are viewing this topic.
bunk58
Committed to MODx
Posts: 984
David Bunker
Tree Javascript Menu (like the manager document tree)
«
on:
May 24, 2008, 11:32 AM »
Someone on the forum asked about a js tree menu like in the Manager document tree and I remembered I'd done one previously.
It doesn't use the excellent Wayfinder and offers limited features, but maybe of use to some.
See it in action on my
sandbox
.
The zip has instructions, it's very straightforward to install.
dtree.zip
(12.76 KB - downloaded 209 times.)
«
Last Edit: May 24, 2008, 01:04 PM by bunk58
»
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
Wiki Articles :
Custom DB table to custom placeholders
Website :
U.K. based MODx development
MotSmart
MODx RTL Guru.
Moderators
Posts: 848
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #1 on:
May 25, 2008, 02:14 AM »
Cool !, Thanks for sharing
Logged
[
Search
] [
Add-ons
] | [
MODx Lovers Don't miss this link!
]
[
Documentation
] [
Wiki
]
[
Persian support forum
]
[
RoadMap
] [
SVN
] [
RTL SVN Branch
] [
Development
] [
Trac
] [
FishEye+Crucible
] [
Confluence
] | [
My Google Code
]
[برای دسترسی به راهنمای فارسی به
» وبگاه مادایکس فارسی «
و یا به
» انجمنهای پشتیبانی فارسی مادایکس «
مراجعه کنید]
A Person is Either your Brother in Faith or Your Equal in Humanity. - Imam Ali.
# Discover Islam
. | # Discover Middle East @
PressTV
.
snow889
Jr. Member
Posts: 40
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #2 on:
Jul 11, 2008, 09:36 AM »
wow! very nice one!
But i have a question!
. Im not in Javascript very much so i cant do it myself......
I wonder if its possible to open the menu tree without clicking on the "+" sing. I would prefer if the document tree would open by just clicking on the container...
Thanx for reply!
zven
Logged
http://www.schneegruppe.de
snow889
Jr. Member
Posts: 40
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #3 on:
Jul 11, 2008, 09:56 AM »
another question...
How are the elements of the menu sorted? Seems like they are in a weired order...
greez
zven
Logged
http://www.schneegruppe.de
bunk58
Committed to MODx
Posts: 984
David Bunker
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #4 on:
Jul 11, 2008, 11:10 AM »
The order of the menu is set in the snippet as Menu Index, Ascending, but could be changed to whatever you want.
Not sure about opening on clicking the doc/folder rather than the + sign, I'll have a look at the JavaScript and report back.
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
Wiki Articles :
Custom DB table to custom placeholders
Website :
U.K. based MODx development
snow889
Jr. Member
Posts: 40
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #5 on:
Jul 16, 2008, 05:31 AM »
thanx - the menu is working flawlessly - but has anyone an idea how to open the menu just by clicking on the link and not on the plus sign?
Logged
http://www.schneegruppe.de
bunk58
Committed to MODx
Posts: 984
David Bunker
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #6 on:
Jul 16, 2008, 08:57 AM »
Do you mean clicking on the folder icon to open the sub menu?
You couldn't click on the link to open the sub menu because the link is to open the parent page.
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
Wiki Articles :
Custom DB table to custom placeholders
Website :
U.K. based MODx development
snow889
Jr. Member
Posts: 40
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #7 on:
Jul 16, 2008, 09:01 AM »
Jeah i want to click on the link to open the menu and the document which is clicked... is this not possible?
Logged
http://www.schneegruppe.de
bunk58
Committed to MODx
Posts: 984
David Bunker
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #8 on:
Jul 16, 2008, 09:30 AM »
I don't think it's possible with this JavaScript.
The closest I can get is by setting
Code:
useCookies: true,
on line 36 of the dtree.js file, which means when you've clicked the + sign and then clicked through to a sub page the sub menu stays open.
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
Wiki Articles :
Custom DB table to custom placeholders
Website :
U.K. based MODx development
ganeshXL
Testers
Posts: 1,501
Re: Tree Javascript Menu (like the manager document tree)
«
Reply #9 on:
Oct 11, 2008, 02:47 PM »
It would be good to output a regular non-JS inside <noscript> for search machines etc... e.g.
Code:
<?php
/* Simple version of the tree type javascript menu by bunk 58 (David Bunker) 24/05/08 */
$siteName
=
$modx
->
config
[
'site_name'
];
$nojsOutput
=
'<noscript>'
;
$jsOutput
=
''
;
$jsOutput
.=
'<script type="text/javascript">
<!--
d = new dTree(\'d\');
d.add(0,-1,\'Your Menu\');'
;
$result
=
mysql_query
(
'SELECT * FROM `modx_site_content` WHERE `published`="1" AND `hidemenu`="0" AND `deleted`="0" ORDER BY `menuindex` ASC '
);
while(
$row
=
mysql_fetch_array
(
$result
)) {
$jsOutput
.=
'd.add( '
.
$row
[
'id'
] .
' , '
.
$row
[
'parent'
] .
' , \''
.
$row
[
'pagetitle'
] .
'\', \'[~'
.
$row
[
'id'
] .
'~]\');'
.
"\n"
;
$url
=
$modx
->
makeUrl
(
$row
[
'id'
]);
$nojsOutput
.=
"<a href='$url'>{$row['pagetitle']}</a><br />"
;
}
$jsOutput
.=
'
document.write(d);
//-->
</script>'
;
$nojsOutput
.=
'</noscript>'
;
return (
$jsOutput
.
"\n"
.
$nojsOutput
);
?>
(untested)
or, well, do the noscript part simply with Wayfinder...
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
=> 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ışı