Type
magento2-module
Twitter feed.
magento2-module
MIT
None
None
None
None
None
Twitter feeds using the most popular TwitterOAuth PHP library.
Multiple configuration options giving you full control over your tweets. Global integration option available along with an easy to use widget.
Recommended installation through composer, within your Magento root directory enter the following:
composer require alvis/magento2-twitter
php bin/magento module:enable Alvis_Core
php bin/magento module:enable Alvis_Twitter
You may also need to re-compile:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
You will need to create a Twitter app to get your API credentials. Please use the following steps as a guide:
The module configuration can be found through the main menu under Alvis. As a minimum please ensure you enter your screen name, consumer key, consumer key secret, access token and access token secret.
Multiple settings available giving you full control over your tweets including:
Multiple settings for when tweets include images:
Display tweets based off a search query, used when displaying searched tweets.
By default Twitter displays in the main content.
Extend the layout within your theme <VendorName>/<ThemeName>/Alvis_Twitter/layout/default.xml
.
Move xml block:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="alvis_twitter.latest" destination="footer" after="-" />
<move element="alvis_twitter.mentions" destination="footer" after="-" />
<move element="alvis_twitter.search" destination="footer" after="-" />
</body>
</page>
Remove xml block:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="main">
<referenceBlock name="alvis_twitter.latest" remove="true" />
<referenceBlock name="alvis_twitter.mentions" remove="true" />
<referenceBlock name="alvis_twitter.search" remove="true" />
</referenceContainer>
</body>
</page>
Update xml block arguments:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="alvis_twitter.latest">
<arguments>
<argument name="title" xsi:type="string">New Block Title</argument>
</arguments>
</referenceBlock>
</body>
</page>
Override the default templates within your theme create the following files:
<VendorName>/<ThemeName>/Alvis_Twitter/templates/tweets.phtml
<VendorName>/<ThemeName>/Alvis_Twitter/templates/widget/tweets.phtml
The original contents of the files can be found under:
<Root>/vendor/alvis/magento2-twitter/view/frontend/templates/tweets.phtml
<Root>/vendor/alvis/magento2-twitter/view/frontend/templates/widget/tweets.phtml
Alternatively you can use the Twitter Feed widget which has the following settings available:
Currently no styling is provided with the module, please create your own.