We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54277
    • 8 Posts
    We created an university website via ModX.
    One question needs you help.
    how to link "View All News" (on department pages) links to filtered news?


    Currently, we used a chunk to show related news on department template, it works.
    [[$xjtlu.latest-news-text-links-department? &blockId=`news` &department=`[[*id]]`]]

    This is the chunk of xjtlu.latest-news-text-links-department
    [[pdoResources?
    &parents=`[[++newsId]]`
    &limit=`4`
    &tpl=`xjtlu.pr.latest-news-text-row`
    &sortby=`{"publishedon":"DESC"}`
    &where=`{"template:=":18}`
    &toPlaceholder=`latestNews`
    &includeTVList=`relatedDepartments`
    &tvFilters=`relatedDepartments==%[[+department]]%`
    ]]

    [[+latestNews:notempty=`
    <div class="latest-news" [[+blockId:notempty=`id="[[+blockId]]" data-waypoint="[[+blockId]]"`]]>
    <div class="contain">
    <h2>[[%xjtlu_news? &language=`[[++cultureKey]]`]]</h2>

    <ul>
    [[+latestNews]]
    </ul>

    <p><a href="[[~[[++newsId]]]]" class="read-more"><span>[[%xjtlu_viewallnews? &language=`[[++cultureKey]]`]]</span></a></p>
    </div>
    </div><!--//.latest-news-->
    `]]

    I think we need to edit the following code,
    <p><a href="[[~[[++newsId]]]]" class="read-more"><span>[[%xjtlu_viewallnews? &language=`[[++cultureKey]]`]]</span></a></p>
      • 3749
      • 24,544 Posts
      See what this gives you:

      [[pdoResources?
          &parents=`[[++newsId]]`
          &limit=`20`
          &tpl=`xjtlu.pr.latest-news-text-row`
          &sortby=`{"publishedon":"DESC"}`
          &where=`{"template:=":18}`
          &toPlaceholder=`latestNews`
      ]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting