All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

low variables + wygwam + assets

GMJ 9 Aug 2012 15:40 question, complete

I have a low variable setup as an 'asset' field in order to link to a certain PDF. I then use that low variable in a wygwam field.

ATTEMPT 1
If I use:
href="{lv_order-form}">Download order form

It outputs:
href="{filedir_1}/name.pdf">Download order form

ATTEMPT 2
If I use:
href="{exp:low_variables:parse var="lv_order-form"}">Download order form

It outputs:
href=" &# 123; exp:low_variables:parse var="lv_order-form" &# 125; "

If I go back into wygwam to make an update it then changes the link to href="{exp:low_variables:parse var=">Download order form

STATS
Low variables 2.3.1
Assets 1.2.1
Wygwam 2.5
EE 2.5.5

Any help is much appreciated.

Replies

  1. Low 10 Aug 2012 07:42

    The output of your first attempt is correct -- an Assets field needs the Tag syntax for extra processing, like the filedir replacements.

    The second attempt probably won't work because tags aren't allowed in fields. You can ask Pixel & Tonic to be sure.

    You could use attempt 1 again and use something like parse file paths to replace those {filedir_1} markers.

  2. GMJ 10 Aug 2012 09:07

    Hi Low

    I tried the parse file paths - no luck.

    Brandon and I weren't able to get it going either: https://getsatisfaction.com/pixelandt...

    Thanks for trying

  3. Stephen 24 Feb 2013 16:09

    Just came across this issue myself. A shame that the Assets variable type isn't as compatible with Low Variables as I'd hope it to be.

    I've gone with the Select Files variable type instead for now.

  4. Low 26 Feb 2013 09:25

    How about this? Use the method in attempt 2 (the tag syntax) and then use Low Replace to change the entities back to curly braces.

    So inside the Wygwam field:

    href="{exp:low_variables:single var='lv_order-form'}"


    And in the template:

    {exp:low_replace find="{|&#125" replace="{|}" multiple="yes"} 
    {my_wygwam_field}
    {/exp:low_replace}

  5. Stephen 26 Feb 2013 18:48

    Sorry Low, I think I've chimed in on a thread that wasn't the exact same issue as I was having, but just a similar one.

    I was just using Low Variables with an Assets variable type (not Wygwam).

  6. Low 26 Feb 2013 19:36

    Then always use the Tag syntax, not the Variable syntax, so the {filedir_X} get parsed.

  7. Stephen 26 Feb 2013 20:25

    Hmm, not sure how I didn't spot/figure this out, but just did that and it's now working great, thanks. :-)

  8. Lea Alcantara 9 Mar 2013 01:45

    Hi Low, so I was having issues with this and so I used the tag syntax -- at first it didn't look like it worked. However, here's the weirdest thing:

    Saving twice makes it work.

    That is, I go through assigning the file via Assets and WYGWAM field in Low Variables. When I press save, it tells me that it can't find assets_lib. However, without making ANY other changes, I save the Variables group I have open again.

    I refresh the page that previously gave me an assets_lib error and voila, it's perfectly associated.

    Why? I'd like clients to be able to press Save once. :)

  9. Low 9 Mar 2013 07:55

    Hi Lea, I'm afraid this is a P&T issue... The Wygwam/Assets fields take care of any loading of libraries and stuff. Have you contacted Brandon and his about this?

  10. Lisa Wess 11 Mar 2013 18:25

    Lea emailed this morning, so I'll be looking at this today. Thank you Low and Lea!

  11. Low 11 Mar 2013 20:48

    Thanks Lisa! Let me know if you need anything from my end.