Question

Photo of DJ Grick

0

Check in Lava Help

I am working to update our children's tags but for some reason still really struggle to write Merge fields. In the manual i see that I should have a #mindblown experience but that whole line doesn't make since to me. 

 

The Date field has never worked for us. I (foolishly) didn't save what it was by default, but tried changing it to:

 {{ 'Now' | Date:'M/d/yyyy' }} 

Which shows on the lables as:

 Now' | Date:'M/d/yyyy

 

I am also trying to figure out how to change location merge to show both room location and group name. I know I could just change the location names of each to say what "Sting Ray Room |3rd and 4th Grade" but  rooms change usages between our Sunday morning program and Wednesday night Awana so I would need each room in twice. 

I know I should probably break them into 2 different merge fields but I wanted them to be centered on the label rather then on two different lines. 

Original lava:

 {% for group in GroupType.Groups %}{% for location in group.Locations %} {{location.Name}}{% endfor %}{% endfor %}

I tried a few different things but most recently:

 {% for group in GroupType.Groups %} {% for name in GroupType.Groups %} {{group.name}} {% endfor %} {% endfor %} | {% for group in GroupType.Groups %}{% for location in group.Locations %} {{location.Name}}{% endfor %}{% endfor %}

 

Any tips or pointers? 

 

One other thing: two of my text fields are not using the space I allowed but are stacking each word on top of the previous. Has anyone else experienced this? How did you solve it? in Zebra Design I has said max of 40 characters but that doesn't seem to effect anything. 

  • DJ Grick

    I figured out the issue with the text field stacking. It happened with any field that is center aligned.

  • Photo of Michael Garrison

    0

    DJ,

    Sorry you haven't gotten any response from this question!

    It looks to me like your Date field is correct- the only thing I can speculate is that there's some non-printing character in there messing up the syntax ... or possibly the code has been copied and pasted from another source that might have auto-corrected the single quote mark to some higher-ascii character (like Word does). Have you tried deleting the MergeField and typing it over?

    As to your second question, it seems to me like you're trying the right thing...perhaps the extra white space between the tags is causing issues? I see that the default Location and Schedule Times fields don't have a space between the }{ characters beginning and ending the tags.

    Edit: It just occurred to me that singe the pipe (|) character has syntactical significance in Liquid/Lava, that might be messing things up as well. Try replacing it with a hyphen, colon, or another character. Just in case.

    Finally, I suspect that the text stacking issues you're describing are similar to what I've experienced. I described a fix when I found it here: http://www.rockrms.com/Rock/Ask/Using/Questions/351#a685

    The issue is that centered text doesn't seem to leave enough width for all the text to fit, and it doesn't break lines but does a carriage return with no line break (and adds a hyphen). So you can manually tweak the position and width of the field (viewing the results of your tweaks in near-realtime at http://labelary.com/viewer.html ) copy it back into your label file and re-upload it to Rock.

    • DJ Grick

      Awesome! The dates are working now!


      Now to figure out how to have the group name show. I did both of your suggestions but it didn't make an impact.


      Thanks for the help!!!!