Results 1 to 3 of 3

Thread: News articles without additional elements

  1. #1
    User tetrijeb's Avatar
    Join Date
    04-19-12.
    Location
    Bosnia&Herzegovina
    Posts
    98

    Default News articles without additional elements

    Hello,

    I am using news_latest.html5 on my homepage to show the latest news, obviously

    What I want to do, is to remove "more" link when the news article has no additional elements (just a news teaser). I use that kind of articles for short notices (just 1-2 sentences). In which way I should change the template to filter those articles.

    This is the code from news_latest.html5

    Code:
    <?php if ($this->hasText || $this->hasTeaser): ?>
        <p class="more"><?= $this->more ?></p>
      <?php endif; ?>
    I can't indetify relation between tl_news and tl_content/tl_article table. Where are those elements from news archive placed in database?

    Contao 3.5 is used
    Last edited by tetrijeb; 08/01/2016 at 22:10.

  2. #2
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    331

    Default

    Just remove $this->hasTeaser from the condition. i.e.
    PHP Code:
    <?php if ($this->hasText): ?>
      <p class="more"><?= $this->more ?></p>
    <?php endif; ?>

  3. #3
    User tetrijeb's Avatar
    Join Date
    04-19-12.
    Location
    Bosnia&Herzegovina
    Posts
    98

    Default

    That's it!

    Thanks.

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
  •