MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Dec 04, 2008, 02:34 PM
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
:Donate to MODx:
Donations
MODx Community Forums
»
Support
»
General Support
(Moderators:
zi
,
PaulGregory
)
»
How to get DropMenu to *display* the hidemenu=1 items
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: How to get DropMenu to *display* the hidemenu=1 items (Read 3753 times)
0 Members and 1 Guest are viewing this topic.
The Man Can!
Testers
Posts: 296
How to get DropMenu to *display* the hidemenu=1 items
«
on:
Jan 04, 2006, 12:57 AM »
Hi all. I'm going crazy trying to get this to work. All I want is to have DropMenu
display
the items with "Show in Menu"
unchecked
, and
hide
those with it checked.
From the code it looks as simple as changing (line 190)
Code:
function filterHidden($var) {
return (!$var['hidemenu']==1);
}
to
Code:
function filterHidden($var) {
return (!$var['hidemenu']==0);
}
but that outputs the exact same thing! I'm so confused. Even when I remove that whole function, and line 201 too, it still outputs the same thing. The page is non-cacheable, the snippet is in [! !], I've refreshed the site. I can't think of anything else.
«
Last Edit: Jan 04, 2006, 01:49 AM by The Man Can!
»
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
Dimmy
Testers
Posts: 1,826
Я не говорю по-русски 私は日本語を話さない
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #1 on:
Jan 04, 2006, 06:28 AM »
try this:
remove the ! (! means "if not")
Code:
function filterHidden($var) {
return ($var['hidemenu']==1);
}
original it will see if hidemenu in $var is not the same as 1 then it shows the items.
by removing the ! it wil see if hidemenu is the same as one and then show the items.
good luck
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
The Man Can!
Testers
Posts: 296
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #2 on:
Jan 04, 2006, 09:59 AM »
Thanks Dimitri. I actually tried that as well and it doesn't change the behaviour of the snippet at all. ? Unless I'm going crazy...
No, I just checked again, it displays the exact same thing regardless of 0 or 1, ! or not. (I'm using 0.9.1 now but I had been trying this on 0.9.0 with the same results.)
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
The Man Can!
Testers
Posts: 296
Major issue with multiple modded versions of DropMenu on same page
«
Reply #3 on:
Jan 06, 2006, 01:38 AM »
Ok, this is odd.
Short Answer:
Changing the 1 to a 0
does
indeed work, but not if another non-modified DropMenu snippet is called prior to the modded snippet call.
Long Answer:
One of the sites I'm working on has a main nav on the left (vertical), and a subnav across the top (horizontal). Check it out here: 209.126.144.59.
The left DropMenu is modded to display weblinks correctly (called as DropMenuTMC), the subnav is a regular DropMenu, and on the Course/Member page, I'm calling a third DropMenu (named OrgList) modded to
show
the "don't show in menu" items.
Guess what:
Whatever the code that is in the first DropMenu call gets called for all three dropmenus
regardless the modified code that's actually called, and regardless the names of the snippets. If I change the DropMenuTMC (leftnav) to show hidden items, all three menus show hidden. I change it back, all three menus show the non-hidden items.
Anybody want to confirm this? For the time being, I'm making the 0/1 value that I need changed as a value that's passed to the snippet, so I can use actually use the same snippet for all three, but this seems like it could be a pretty ugly issue for anybody that needs differently modded dropmenus on the same page.
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
The Man Can!
Testers
Posts: 296
Re: Major issue with multiple modded versions of DropMenu on same page
«
Reply #4 on:
Jan 07, 2006, 07:25 PM »
This doesn't work either:
Quote from: The Man Can! on Jan 06, 2006, 01:38 AM
For the time being, I'm making the 0/1 value that I need changed as a value that's passed to the snippet
So... If you pass a 1 into the first DropMenu call, then a 0 into the second, they both get 1s.
Just in case you want to see the code:
Code:
$showHidden = (!isset($showHidden)) ? '1' : "$showHidden";
if (!isset ($MakeMap_Defined)) {
function filterHidden($var) {
return (!$var['hidemenu']==$showHidden);
}
This is driving me nuts. Anybody have any ideas on how to make this work? Thanks!
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
rthrash
Foundation
Posts: 9,577
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #5 on:
Jan 08, 2006, 08:50 AM »
Brett, can you file this in the bugtracker so it doesn't slip by without resolution. That's really odd... :/
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
The Man Can!
Testers
Posts: 296
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #6 on:
Jan 09, 2006, 04:33 AM »
Roger that Ryan. It's been added, but I think I did a pretty lame job of concisely describing the problem
My PHP is pretty bad, but does it perhaps have something to do with
Code:
global $MakeMap_Defined;
? I think my next step is to start renaming functions and see if I stumble on the issue.
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
rthrash
Foundation
Posts: 9,577
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #7 on:
Jan 09, 2006, 08:20 AM »
I think it's time to probably isolate this into a proper class as was done on the MemberCheck snippet.
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
The Man Can!
Testers
Posts: 296
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #8 on:
Jan 17, 2006, 11:31 PM »
Thanks for those tips, Ryan. I was reluctant to put it in the bugtracker until I got it working (trying to save you guys the extra work
), and I just got it.
In case anybody else stumbles on this thread with the same problem, I was able to get around it by changing the names of the following functions:
MakeMap
MakeMap_Defined
filterHidden
filterEmpty
I just added a 2 to the end of each function and all is well. Now I have one folder with two entirely separate menus.
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
rthrash
Foundation
Posts: 9,577
Re: How to get DropMenu to *display* the hidemenu=1 items
«
Reply #9 on:
Jan 18, 2006, 12:20 AM »
Thanks Brett!
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
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ışı