ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE Twitter Timeline 1.4.2 issue

April 24, 2011 10:11pm

Subscribe [3]
  • #1 / Apr 24, 2011 10:11pm

    Hello,

    I am trying to use the Twitter Timeline 1.4.2 first party addon but am running into issues with the API rate limit being reached too quickly.
    Is there some kind of

    {if no_results}
    variable inside the
    {exp:twitter_timeline}

    loop so that I can at least put up a “we’ll be right back.” type of message up if there are twitter issues?

    Also, it seems I cannot make the

    screen_name=""
    parameter be populated by a Global Variable. Whenever I try this (global var is {twitter_username} content of which is “thecve”) and integrate this into the tag as
    {exp:twitter_timeline screen_name="{twitter_username}"}

    I got no output as it seems the plugin is trying to actually use {twitter_username} as the screen_name and not the parsed output of {twitter_username}.

    As soon as I hardcode the twitter name, things work as expected.
    Is this the correct behaviour or a bug? It was my understanding that global vars would be early parsed so I assumed by the time the plugin runs it would utilize the output of the global var and not the global var including its curly braces itself.

    I also tried using an {embed} from which to call the twitter timeline loop and embedding the username via the embed but this didn’t help either.

    Any help would be much appreciated.

    Cheers,
    Jannis

    PS: EE version: You are running the latest version of ExpressionEngine: Version 2.1.3 Build 20110405

  • #2 / Apr 24, 2011 10:24pm

    giusi

    94 posts

    Hi,

    you can use a Snippet for the twitter user name.

  • #3 / Apr 24, 2011 10:40pm

    Yes, I am aware of that, however since I am giving a client restricted access to some variables that are plain text output (global vars) so that he can updated these things himself, I cannot give him access to Snippets as these include functional snippets of EE code that I cannot allow him to touch.

    Regardless, I find it strange that snippets work but global variables won’t. Aren’t Global Vars parsed earlier than snippets even? So by the time the plugin is being run the global var should have become plain text anyway?

    Thanks for your answer though, much appreciated.

  • #4 / Apr 24, 2011 10:49pm

    giusi

    94 posts

    Hi

    Global Variables are parsed with Snippets, embed etc. *but* user defned global variables are parsed at the end.

    From the user guide

    Snippets are expanded at a very early stage on each template, making it possible for them to hold dynamic content, ExpressionEngine tags, other variables, PHP, etc. They shine when you need to reuse dynamic information, but don’t need the extra overhead of access control or separate preferences of an embedded template. User-defined Global Variables are the polar opposites, expanded at the very end of all template parsing, and should be used for static text, HTML, JavaScript, and other static content that would not affect other tags and variables on the template.

  • #5 / Apr 24, 2011 10:55pm

    Aha! Thanks for that, that explains a lot 😊
    I better rewrite some of these bits then.

  • #6 / Apr 25, 2011 2:27pm

    Sue Crocker

    26054 posts

    Hi, Jannis. I couldn’t tell from this thread, do you still require assistance?

  • #7 / Apr 25, 2011 4:17pm

    Hi Sue,
    I think I’m alright actually, giusi’s help sorted the bits out that were puzzling me 😊

    Thanks for checking though,
    please feel free to close this thread.

    Jannis

  • #8 / Apr 25, 2011 4:45pm

    Sue Crocker

    26054 posts

    Glad to hear it. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases