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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Questions on added ImageField and Login/Lost Password Templates


Go to End


3 Posts   1736 Views

Avatar
convan23

3 Posts

7 November 2007 at 1:57pm

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 LostPassword.ss and a LogIn.ss in my Layout folder?

Thanks,
Conrad

Avatar
Sigurd

Forum Moderator, 628 Posts

7 November 2007 at 2:25pm

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

Avatar
convan23

3 Posts

7 November 2007 at 2:28pm

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

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