We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51382
    • 53 Posts
    Hi,

    I have a local events website and am trying to create a way to filter by tv (i.e. event type) via a dropdown menu. I have figured out how to filter, but it involves creating a duplicate chunk for each of the 10 tags --> which I would then have to edit their pages individually if I ever wanted to change the way the list of events (chunk) on the homepage looks.

    Is there a way to filter via &tvFilters without having to create separate chunks?

    getPage snippet inside a chunk that displays on the index.html
    [[!getPage? &elementClass=`modSnippet` &element=`getResources` &parents=`9` &depth=`1` &limit=`20` &pageVarKey=`page` &includeTVs=`1` &includeContent=`1` &sortby=`unpub_date` &sortdir=`ASC` &tpl=`eventlist` &tvFilters=`Food` ]]


    Dropdown List Option:
    <li><a href="/food" class="small" data-value="Food" tabIndex="-1"><input type="checkbox"/> Food</a></li>


    Thank you for any ideas.

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      you can get url-params with a snippet or with fastField-tags.
      For example with getReqParam:

      &tvFilters=`category==[[!getReqParam? &name=`event_category`]]`


      if your url-param is
      &event_category=Food


        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 51382
        • 53 Posts
        Quote from: Bruno17 at Mar 17, 2016, 02:13 AM
        you can get url-params with a snippet or with fastField-tags.
        For example with getReqParam:

        &tvFilters=`category==[[!getReqParam? &name=`event_category`]]`


        if your url-param is
        &event_category=Food



        Thanks Bruno. I'll look into fastField