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

  • 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? – Stephen Callender Oct 20 '13 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 Oct 20 '13 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 Oct 20 '13 at 13:11
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}
  • oh didn't know that. How inefficient. – CreateSean Oct 20 '13 at 13:01
  • 4
    Well, it does avoid variable name conflicts. – Low Oct 20 '13 at 13:03

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.