ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Use global variables with weblog data

January 24, 2008 6:03pm

Subscribe [1]
  • #1 / Jan 24, 2008 6:03pm

    oldgoldblack

    113 posts

    I know the following code doesn’t work because global variable assignments are parsed before anything else in the template, thus it has no data from weblog:entries to assign. I got that.

    BUT is there any way I can work around this? Any way to have a dynamic variable parsed after/within weblog tags?

    This is in the header of a weblog entry template…

    {exp:weblog:entries require_entry="yes" limit="1"}
    
    {related_entries id="issue"}
    {assign_variable:img_dir="http://data.blah.com/images/{what}"}
    {/related_entries}
    
    {/exp:weblog:entries}

    Then use img_dir through the rest of the template?

  • #2 / Jan 24, 2008 8:09pm

    oldgoldblack

    113 posts

    Could I use PHP? I’m completely PHP-ignorant, but I’d be willing to use it if I have to…

    EDIT: OR an embed? Further reading just further confused me.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases