3

I'm trying to access the entry_id of an entry (one only) selected with Low Variables, to use as a parameter in a channel entries tag.

The entries are stored in site A. The template is in site B.

Other SE solutions involve using the variable syntax instead of the tag syntax, however, that syntax only works with the Low Variables 'select' variable type, which does not allow selections across MSM sites.

  • The Playa variable type does allow selections across MSM sites but I can't figure out how to use that to output the entry id's as an early-parsed parameter in the channel entries tag. Whatever I try produces nothing.

  • I have tried setting up the variable in site A using the select variable type and then using the variable syntax in Site B template, but it doesn't allow me to pull info from site A using that syntax.

  • I have tried using the :parse syntax with site A selected. If I use this outside the channel:entries tag it works and outputs the correct entry_id, but using it inside the entries tag:

    {exp:channel:entries site="default_site" channel="project_news|projects" limit="1" entry_id="{exp:low_variables:parse var='default_site:gv_ft-featured-stories'}" orderby="date" sort="desc" dynamic="no" disable="category_fields|member_data|pagination"}

    Doesn't work - it just produces:

    entry_id="M10o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr"

  • I have enabled early parsing in the variable settings.

Any advice appreciated.

3

OK - got it working by using :parse in a tag pair around the channel:entries tag:

{exp:low_variables:parse var='default_site:gv_ft-featured-stories'}
{exp:channel:entries site="default_site" channel="project_news|projects" limit="1" entry_id="{gv_ft-featured-stories:data}" orderby="date" sort="desc" dynamic="no" disable="category_fields|member_data|pagination"}{title}
...
{/exp:channel:entries}
{/exp:low_variables:parse}

There might be other/better ways but this is working for me.

| improve this answer | |
  • 1
    Yes, using the parse tag like this is designed to avoid parsing issues like the one you're facing. You could have also used the solution in your original question, but added with parse="inward" to the channel:entries tag, to force the parameter value (which is the tag) to be parsed first. – Low Feb 17 '14 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.