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
  • Manager, Parser & the Core
  •  
  • [REVO] Possibility to dynamically populate TV input options..#

  • 33337
    3,901
    - MODX Special Forces
    Share and explore websites made in MODx by Zaigham's Web | Tweet @zaigham | Resource Center


    MODx Current | MODx on Git! | BUGS! | RTFM (Read the Fully awesome Manuals)

    Zaigham (aka zi) Reply #1, 1 year, 4 months ago

    Reply
    • Link to this post#1
    Hi guys,

    This is for MODX Revolution.

    I am looking to see if we can dynamically populate TV *input options values* based on currently edited resource, and those values will also come from the resource tree based on the criteria defined.

    For example, in a multi author, multi blog setup, every blog has a different categories. One way is to setup different templates for the different blogs and use different TVs with static input option values.

    The other way is to determine the current parent (blog homepage), where user is creating/updating the post and populate the values from its children categories, possibly under a "Categories" container. eg.
     @SELECT pagetitle,id WHERE parent = __current blog homepage's category container id__ 


    Looking forward to what you guys have to say about this, and how to do it.


  • 4172
    1,614
    xdbedit - create your own CMP to edit custom-tables with TV-input-types
    MIGX (multiItemsGridTV, sortable multirecord-TV)
    formit2db with autocreate schema&classes
    formit2resource
    custom-tv-input-type for revo:imagelistTV
    quickCMP - CMP for creating simple backend-'modules' per snippets
    bloX/Xedit - Ressource-Listing and frontend-sorting/editing....

    Bruno17 Reply #2, 1 year, 4 months ago

    Reply
    • Link to this post#2
    I think you can use a resource-list-TV with @EVAL - binding in input-option-values.
    You can run a snippet with
    @EVAL return $modx->runSnippet('getCategoryParent',array('resourceId'=>$modx->resource->get('id')));


    Let this snippet return your CategoryParent.

    On new Resources may be you have $_REQUEST['parent'], when you edit resource you have $modx->resource - object which you can use to get the infos you need.





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:
Bruno17, zaigham

 
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