Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Questions on added ImageField and Login/Lost Password Templates


4 Posts   1414 Views


7 November 2007 at 1:57pm 3 Posts

Okay I have two questions to ask -

First and foremost, I followed the second tutorial, extending a basic site, and at the bottom it talks about adding a "Staff" section with an associated image for each page. I've followed this tutorial and inserted the $Photo variable into my template/theme. However, if there isn't a photo that is defined when creating that page, the $Photo variable prints:

"<img src="/build/assets/" alt="" />", which results in a broken link. I'd like to prevent this, what's the best way?

Also, my second question, if I want to change the layout for the Lost Password and Log in pages what do I do? Do i create, for example, a and a in my Layout folder?



7 November 2007 at 2:25pm Forum Moderator, 628 Posts

You should be able to use the "if" construct in the templates, which is mentioned in the tutorials?


7 November 2007 at 2:28pm 3 Posts

Yes if what though? doing <% if $Photo %> translates to:

<% if <img src="/build/assets/" alt="" /> %>
Which results in an error.


8 November 2007 at 9:58am 230 Posts

You don't need the $ - it's <% if Photo %>