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.

How to create template variables?

August 02, 2011 7:18pm

Subscribe [3]
  • #1 / Aug 02, 2011 7:18pm

    opel

    160 posts

    I am using the CE image plugin inside an {exp:query tag} but having a problem. CE requires a tag with a complete url path, however the SQL result only pulls back the file name, for some reason it does not parse the {file_dir3} that is stored in the database cell.

    What I am trying to do inside the exp tag is basically to append the fill path on to the select result, and create a new variable that I can put into the CE tag parameters.

    My code is below but not sure what I’m missing, any help please. I tried the preload tag thats in the manual but with no joy.

    {exp:query limit="5" pagination="bottom" sql="SELECT t.entry_id, t.title, t.url_title, d.field_id_7 AS event_summary, d.field_id_8 AS event_date, d.field_id_9 AS event_flyer, d.field_id_10 AS event_facebook FROM `expsc_channel_titles` AS t NATURAL JOIN `expsc_channel_data` AS d WHERE d.channel_id = 3 AND CAST(d.field_id_8 AS UNSIGNED) >= (unix_timestamp(Now())) - 86400 ORDER BY d.field_id_8 ASC"}
            
        {if no_results}
        
        <strong>There are no events at the moment but there will be soon.</strong>
        {/if}
            
            <h2>{title}</h2>
    
    <p>        {exp:ce_img:single src="{event_flyer}" max="300" allow_scale_larger="yes"}<br />
            {exp:ce_img:pair src="/images/events/{event_flyer}" width="200" height="130" crop="yes" }<br />
            <a href="http://{made_url}" title=" View {title} photo">_            {made}_        </a><br />
            {/exp:ce_img:pair}

  • #2 / Aug 03, 2011 12:06am

    LMO

    203 posts

    Hi opel,

    A quick search on devot-ee.com returned this plugin: http://devot-ee.com/add-ons/parse-filedirectories
    Looks like this should help you with your issue.

  • #3 / Aug 03, 2011 8:47am

    Sue Crocker

    26054 posts

    Thanks for the assist, VIM Interactive.

    opel I’ve also created global variables for {file_dir1} and the like. What ever works for you. Let us know!

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

ExpressionEngine News!

#eecms, #events, #releases