Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Latest tweets plugin not showing as enabled in twig

Solved by pamtbaau View solution

Started by Louis Cox 5 years ago · 2 replies · 372 views
5 years ago

Hi,

Perhaps someone can explain this to me, I seem to be struggling with Latest tweets.
Obviously I have all the relevant details from Twitter, and the plugin shows as enabled, and the config shows as enabled as well. Ive read through the docs from the developer and that is not helping either.

I want to display it in the sidebar. Looking at sidebar.html.twig, I constructed something like this assuming it at least display the title if the plugin was enabled.

{% if config.plugins.latest-tweets.enabled %}
<div class="sidebar-content">
<h4>{{ display title here }}</h4>
{% pull info here etc %}
</div>
{% endif %}

But this doesn't seem to work, its not displaying even the title. Looking in config there seems to be the latest-tweets relevant files, but again looking in the sidebar.html.twig it seems to be pulling bits of info, with some attributes like taxonomy there seems to be no relevant file in the config that I can see - config.plugins.taxonomylist.enabled in the code suggests that its looking in the config

Why is latest-tweets apparently not working?

Many thanks

5 years ago Solution

@louigi ,

{% if config.plugins.latest-tweets.enabled %} is evaluating the result of substracting the values 'config.plugins.latest' and 'tweets.enabled', which is probably not what you want.

If you want to evaluate a variable of a plugin containing a dash (-) in its name, you should use:
{% if config.plugins['latest-tweets'].enabled %}

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 99 16 hours ago
General · by pamtbaau, 21 hours ago
1 63 21 hours ago
General · by Andy Miller, 1 day ago
0 48 1 day ago
General · by Marcel, 12 months ago
6 357 5 days ago
General · by Duc , 6 days ago
3 45 6 days ago