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

Support archive

How to pass values Into Site Header Variable

vacquah 13 Jul 2012 17:31 question, complete

I have set my site header as an early parsing Low Variable :

{exp:low_variables:parse var="lv_global_html_header"}

Previously, I was using:

{embed="_embeds/_header" url_title="{segment_2}" title="Home"}

Now, I can't figure out how to pass the values of title="home" and url_title="{segment_2}" into the required fields inside the Low Variable. In the Variable, I am using the values to set the title value of the page.

I have read Lows article about using preloads and still can't figure it out. I have tried using {preload_replace:pre_title="Home"}, then set the title in the variable as {pre_title}. Also not sure how to set the url_title as a preload. Didn't work.

I suspect I am not doing something right. Any help will be appreciated. Thanks

ps: I am also not able to save variables as files . I have set a folder that you can write to - and tried different path settings - nothing shows up when I save the variable as files. Perhaps some guidance on the format of the path will help ( no examples in docs).

Replies

  1. Low 13 Jul 2012 21:10

    If you're useing LV 2.3+ and you're using Textarea variable types, you can use preparse parameters/vars.

    See http://gotolow.com/addons/low-variabl...

  2. vacquah 13 Jul 2012 22:13

    I am using v 2.3.0. Just found about preparse going through the documentation again. Still can't get it to work. On the main template , I have this:

    {exp:low_variables:parse var="lv_global_html_header" preparse:url_title="{segment_2} preparse:pre_title="Home"}

    And in the "lv_global_html_header" variable, I have this:

    {if segment_2 == ""} {pre_title}
    {if:else} {title} {/if}

    When using embeds, I used to have the above as:

    {exp:channel:entries channel={embed:channel} limit="1" disable="...." rdf="off"}

    {if segment_2 == ""} {embed:title}
    {if:else} {title}{/if}

    {/exp:channel:entries}

  3. Low 14 Jul 2012 09:53

    Is that all you have in the LV? No channel entries tag? Can you perhaps paste the exact code in a http://pastie.org -- GetSat can mess up the code somewhat. Like the preparse:url_title="{segment_2}" is missing the closing quote.

  4. vacquah 14 Jul 2012 15:52

    Here is my entire html header - which is what is in the "lv_global_html_header" variable: http://pastie.org/4255943

    And here is what I have on my templates , where the variable in used:

    {exp:low_variables:parse var="lv_global_html_header" preparse:url_title="{segment_2} preparse:pre_title="Stay"}

  5. Low 14 Jul 2012 16:23

    There's still an unclosed parameter there. Make sure the tag's like this:

    {exp:low_variables:parse var="lv_global_html_header" preparse:url_title="{segment_2}" preparse:pre_title="Stay"}

  6. vacquah 14 Jul 2012 16:50

    My sincere apologies. That is what it was. Should have checked my code well before posting here. thx.

  7. Low 15 Jul 2012 12:28

    No probs. Glad it's working now.