Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • Add-ons
  • Navigation & Tagging/Taxonomy
  •  
  • [Solved] Wayfinder -> How to show container only?#

  • 8271
    9

    dvio Reply #1, 5 months, 3 weeks ago

    Reply
    • Link to this post#1
    Hi, this is my first post.

    I want to show a navigation which show every container (only container) under a resource. How can I achieve that with wayfinder?

    Some container may have children or not.

    &level is not an option because a container may have different depth,
    Using Hide from menu also not an option.

    Edit:
    ========

    Solved by adding a new parameter, I called it &folderOnly. It still needs testing though
    Modified wayfinder.class.php attached

    ========

    Thanks,

    dvio
    Edited 5 months, 3 weeks ago by dvio


  • 33968
    700

    Lucas Reply #2, 5 months, 3 weeks ago

    Reply
    • Link to this post#2
    Not sure exactly what you were doing but you can specify either a class name or custom row template for resources that are a container:

    http://rtfm.modx.com/display/ADDON/Wayfinder

    Always better to try that first than to make code changes - it can be difficult to track what you've changed and then wonder why everything breaks when you upgrade some time later


  • 8271
    9

    dvio Reply #3, 5 months, 3 weeks ago

    Reply
    • Link to this post#3
    I introduced a new option &folderOnly and add1 to the getData query.

    the modification is here
    https://github.com/dvio/Wayfinder/commit/770551b104b966bdcb710853dc9f543bf0a1e619
    I don't know if it's the right way or else, but it's work for me.

    @Lucas thank you, yes I have tried the class and the template option, but I don't want to add extra function in the template since I will have a lot of resource, and I'm afraid it will affect the performance, will it?


  • 8271
    9

    dvio Reply #4, 5 months, 3 weeks ago

    Reply
    • Link to this post#4
    Anyway, I'm using &where=`{"isfolder":1}` right now (while waiting the parameter to be added to the master (I hope))

    I think using &where=`{"isfolder":1}` is saver and performance friendlier

    the call example:


    [[!Wayfinder? &startId=`17` &where=`{"isfolder":1}`]]
    Edited 5 months, 3 weeks ago by dvio


  • 13808
    39

    Josh Reply #5, 5 months, 1 week ago

    Reply
    • Link to this post#5
    Thanks for sharing that the 'Where' clause works with Wayfinder! Saved me heaps of time trying to solve the exact same thing.





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
dvio, jcurtis, okyanet

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy