As per a suggestion from Michael Cornford, I replaced a grid with a template today. I just wanted to throw this out here in case anyone else has experience with Image File Reference Fields & Templates.
My Project - aka, the office - is image oriented. http://www.artformhomeplans.com is a site for marketing/selling home designs to people who are building houses. There is a lot of information that needs to be communicated about a plan - size, layout, expandability, etc. Until the future arrives, the best way to communicate this information is with pictures. Warning to the curious: artform is a version 11 application - still. I am currently porting to 12. And after the conference, part of my process is going to include replacing a lot of what you can see with templates because this site runs very slowly and I am not very good at optimizing. I am good, however, at debugging code. So do continue to throw those on the message board.
SO, I took the little, what I call, 3-card grid on our home page and replaced with a template. And, I must say, replacing a grid with a template is pretty much unicorns, rainbows, ice cream, cake, and tacos.
newShowcase.png
Back to the images part, I haven't seen anyone mention how to handle image file reference fields in a template. This is how I handled it (this, btw, is ALL of the code I had to write):
I used a5w_Decod_IFR for my image file reference fields. If anyone else has worked with IFRs in a template, I'd like to hear how you handled them.
---
Sarah
My Project - aka, the office - is image oriented. http://www.artformhomeplans.com is a site for marketing/selling home designs to people who are building houses. There is a lot of information that needs to be communicated about a plan - size, layout, expandability, etc. Until the future arrives, the best way to communicate this information is with pictures. Warning to the curious: artform is a version 11 application - still. I am currently porting to 12. And after the conference, part of my process is going to include replacing a lot of what you can see with templates because this site runs very slowly and I am not very good at optimizing. I am good, however, at debugging code. So do continue to throw those on the message board.
SO, I took the little, what I call, 3-card grid on our home page and replaced with a template. And, I must say, replacing a grid with a template is pretty much unicorns, rainbows, ice cream, cake, and tacos.
newShowcase.png
Back to the images part, I haven't seen anyone mention how to handle image file reference fields in a template. This is how I handled it (this, btw, is ALL of the code I had to write):
Code:
<%a5 dim sql as c =<<%sql% PRETEND THERE IS A SQL QUERY HERE Omitted for reasons %sql% dim cn as sql::Connection if (cn.open("::Name::conn") = .f.) then 'my project-specific error handling stuff end end if if (cn.execute(sql) = .f.) then 'my project-specific error handling stuff cn.close(); end end if dim tmpl as p tmpl.request = request tmpl.session = session tmpl.serversetting = serversetting dim template as c = <<%html% <div class="showcase"> <div class="title">{ds.data("TITLE")}</div> <div class="image"><a href="Plan.a5w?Plan_Name={ds.data("URL_NAME")}"><img src="{a5w_Decode_IFR(tmpl, ds.data("IMAGE"), "[PlanImages]")}"/></a></div> <div class="blurb">{ds.data("BLURB")}</div> </div> %html% dim rs as sql::ResultSet rs = cn.ResultSet result = a5_mergedataintotemplate(template,rs) cn.close() ?result %>
---
Sarah