Results 1 to 3 of 3

Thread: News list module filtered by news archive

  1. #1
    User
    Join Date
    11-24-13.
    Posts
    44

    Default News list module filtered by news archive

    Hi,
    I have 30 news archives and 1 page 'blog.html' with inside a news list module that take alla news from all of these archives.
    Since I don't want to create 30 news list module and 30 pages, how can I filter blog.html with something like a parameter (for example ?archive=archive_name)?
    Or have you any other idea?

    Thanks!!

    Davide

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    You can use the HOOK newsListFetchItems https://github.com/contao/core/blob/...sList.php#L199

    Then filter the news items in your callback with e.g.
    PHP Code:
    if(\Input::get('myVar') === 'myValue')
    {
      
    // do something

    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    User
    Join Date
    11-24-13.
    Posts
    44

    Default

    Hi Andreas,
    I've solved using news_categories extension and setting a default category for each user, but your solution will be useful in another case, thank you!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •