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
  • Creating & Repurposing Content
  •  
  • output filter based on previous or parent page ID -- possible??#

  • 30319
    374

    TomMLS Reply #1, 1 year, 8 months ago

    Reply
    • Link to this post#1
    I Hope I am posting to the correct forum.

    have a 'content' template which handles all my pages.

    I'd like to vary its content according to whether someone has clicked a link from the home page, which has a resource ID #1.

    That is, if the Resource ID == 1, use a particular chunk which contains particular placeholders.
    Otherwise display a different chunk with different placeholders.

    It would be something like:

    [[!*id:if=``:eq=`1`:then=``:else=``]]

    *id is for the current page, I need whatever is the way to designate the previous page's ID to know if it was 1 or not...it's the only source for going to the particular resource IDs involved...

    Would it be ?? Does this pre-defined TV exist?? I need to use the parent ID of the current ID to know what to do with this call.

    It seems like

    [[!*parent:if=``:eq=`1`:then=``:else=``]] would work
    This is for an announcements section, where each announcement section goes to its own announcement, whose parent ID is 1 (home).

    Thank you, Tom


  • 1778
    604

    anso Reply #2, 1 year, 8 months ago

    Reply
    • Link to this post#2
    Hi Tom,

    does exist, it treturns the ID of the imediate parent. So your [[!*parent:if=``:eq=`1`:then=``:else=``]] should work...

    you can also do

    [[!*parent:is=`1`:then=``:else=`` ]]

    Cheers


  • 17422
    221

    lolotlm Reply #3, 1 year, 5 months ago

    Reply
    • Link to this post#3
    hi,

    i search a documentation for all small function same : `is` or `if` etc...

    do you know where can i find these pages ?


  • 18373
    1,869
    Mark Hamstra
    Senior Developer, MODX Complete Team
    MODX, LLC

    Email: support@modx.com
    Twitter: @mark_hamstra
    Web: modx.com | Twitter: @modxcms | Facebook: modxcms, MODX.Nederland

    Also visit my Github profile, personal website and MODX Blog for more MODX goodness.

    Mark Hamstra - MODX Complete Team Reply #4, 1 year, 5 months ago

    Reply
    • Link to this post#4
    There's this page on the Docs: http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters

    But that doesn't show all the tiny output filters as you're saying.

    One thing's certain: all of them are in the code @ http://github.com/modxcms/revolution/blob/master/core/model/modx/filters/modoutputfilter.class.php


  • 17422
    221

    lolotlm Reply #5, 1 year, 5 months ago

    Reply
    • Link to this post#5
    Thanks a lot Mark,

    now i can work well :-)

    a good day

    Laurent


  • 12410
    104

    howster Reply #6, 5 months, 2 weeks ago

    Reply
    • Link to this post#6
    Hi guys how do I work with OR conditional please eg:

    [[!*resource:is=`1` :or`2`    :then=`hello`:else=`goodbye` ]]


    I want to say if resource id is 1 or 2 the say hello else say goodbye.
    THANKS!





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:
TomMLS, anso, howster, lolotlm, markh

 
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