Skip to main content

Module

1 / Create a module

Once you have created your accounts, create the corresponding module. Go to Themes > Front end modules of theme ID x (gear icon) and create a new module.

As module type, select Newslist under News. Select the news archives you want to show in your Social Feed stream. With the field Total number of items you can limit the number of posts. If you want a pagination, fill in the field Items per page.

As the news template, select news_social_feed. As the custom template, select mod_newslist_social_feed. Under image settings, adjust the image size as needed.

Under Social Feed settings you can set the maximum text length and the number of columns, enable/disable Masonry and show/hide images.

Extended template for Twitter

To link hashtags and mentions, select the news template news_social_feed_extended. In addition, the checkbox Link hashtags and mentions must be enabled in the Social Feed account.

You find a demo here: https://demo.pdir.de/social-feed-extended-template.

So far this only works for Twitter posts and not yet for Facebook and Instagram posts.

2 / Place the module

After creating the module, place it anywhere you like.

3 / Template adjustments

If you use Contao 4.4 or 4.5, the post image is not linked by default. If you want to link the image, adjust the template news_social_feed.html5 as follows.

<a href="<?= $this->url ?>" target="_blank">
    <?php if ($this->addImage && $this->sfImages): ?>
        <?php $this->insert('image', $this->arrData); ?>
    <?php endif; ?>
</a>

4 / Customize the stylesheets

You can change the path to the stylesheets in the template mod_newslist_social_feed. This requires at least version 2.5.2 of the Social Feed module.

<?php  $GLOBALS['TL_CSS']['social_feed'] = 'bundles/pdirsocialfeed/css/social_feed.scss||static'; ?>