We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20349 ☆ A M B ☆
    • 453 Posts
    Hi all!

    Can it be done to have somekind of filter (choosed from homepage with drop-down menu) that would show only news listed with certain tags (something like categories with tag’s).

    Example:
    - I have 5 categories with news- category1 ,category2 etc.
    - each category is "filtered" with a certain tag (category1 = "category1" tag)
    - when I choose some filter (non-related with categories) from drop-down menu (example: clubbing) that should show all news with clubbing tag associated with it)
    - filter must be active (until user choose another filter) through all pages and categories
      BASE - Web Design Studio
      MODX Ambassador

      Website
      • 20349 ☆ A M B ☆
      • 453 Posts
      Any ideas?

      Maybe with sessions or something.... huh
        BASE - Web Design Studio
        MODX Ambassador

        Website
        • 7231
        • 4,205 Posts
        filter must be active (until user choose another filter) through all pages and categories
        I don’t understand this part, but the rest can easitly be done using Dittos tagging features.

        Check out the different options for &tagMode. This is like filtering but based on tags.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 20349 ☆ A M B ☆
          • 453 Posts
          I have 2 MAIN filters that would filter ALL news in ALL categories depending on the combination of those 2.

          For example:
          User choose these filters on homepage: "family" and "region 1"
          Then, all of the news are filtered, thus showing ONLY those which are tagged with family and region 1 (excluding the rest)

          If a user selects other combination of filters, like: "with friends" and "region 2"
          it would display the news across the site showing only those which are tagged with with friends and region 2 (excluding the rest)


          I managed to acomplish that with adding some custom code into the wayfinder.inc.php (for the menu because this is when tags are lost if a user clicks another category)

          Still testing it.... undecided


          P.S. with Dittos tagging features I made categories
            BASE - Web Design Studio
            MODX Ambassador

            Website
            • 37747
            • 50 Posts
            Hi Mproject,
            First of all, if you haven´t already, check out this article: http://wiki.modxcms.com/index.php/Category_Tagging_with_Ditto
            And then what I would do is create a folder, unpublished, called something like "News Categories", inside news categories create your 5 documents: Category 1, Category 2, Category 3 etc etc.
            In category 1 content area you are going to make a ditto call that just calls the Category 1 tagged news items, eg.
            [!Ditto? &summarize=`5` &total=`20` &tpl=`ditto_articles` &paginate=`1` &alwaysshow=`1` &sortBy=`createdon` &sortDir=`DESC` &trunc=`1` &truncLen=`300` &commentsChunk=`` &displayArchive=`1` &paginateAlwaysShowLinks=`1` &descendentDepth=`1` &tagDelimiter=`,` &tagData=`tvcategoryOptions` &tagMode=`onlyTags` &tags=`Category 1`!]
            And continue like that in each document, and then wherever you want a dropdown to those items just create it by styling a wayfinder call that starts at the document id of your "News categories" pages.
            Hope that made sense!
            Good luck