3

I'm working with the grid fieldtype for the first time and attempting to build out a home page slider the same way I would typically do with matrix and low variables.

I have triple checked cell names (and copy/pasted to template code) yet the slider is not displaying the images as expected. My code is here:

{exp:low_variables:pair var="lv-home-slider"}
  <img src="{slide}" alt="{caption}"/>
{/exp:low_variables:pair}

But on the front end it outputs the following.

<img src="{slide}" alt="{caption}" >

<img src="{slide}" alt="{caption}" >

I've tried setting this variable to early parsing which as expected didn't change a thing. Have attached a screenshot of the grid settings in Low Variables.

enter image description here

3
  • I don't why it would matter, but what happens if you use {exp:low_variables:parse var="lv-home-slider" multiple="yes"} tag pair instead? Commented Oct 20, 2013 at 12:53
  • 3
    The multiple="yes" parameter only applies to variable types that have Options set in its settings, like Checkbox Group and Select variable types. Also, Sean, if you're using the Tag syntax for a variable, early parsing is irrelevant, and it's actually better to leave it disabled.
    – Low
    Commented Oct 20, 2013 at 12:57
  • Hat tip to anyone reading this in the future. I was getting the following error Fatal error: Call to a member function parse_type() on a non-object in /home/hagwil/public_html/hvcsys/expressionengine/fieldtypes/textarea/ft.textarea.php on line 73 due to one of my cells being a textarea. Once I changed it to text input all was good.
    – CreateSean
    Commented Oct 20, 2013 at 13:11

1 Answer 1

6

The variables inside the field need to be prefixed with the Grid variable name, like this:

{lv-home-slider:slide}
{lv-home-slider:caption}
2
  • oh didn't know that. How inefficient.
    – CreateSean
    Commented Oct 20, 2013 at 13:01
  • 4
    Well, it does avoid variable name conflicts.
    – Low
    Commented Oct 20, 2013 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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