Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » conditional check template rendering errror

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 328 Views
  • matt_misc
    Community Member
    1 Post

    conditional check template rendering errror Link to this post


    I have a gallery page that has_many gallery images as below


       static $has_many = array(
          'GalleryImages' => 'GalleryImage'

    And on the gallery page I making a check that if there are GalleryPages existing then use the control gallery to render into a unordered list.

    However when SS interprets the logic below (Code for rendering image stripped for testing) in GalleryPage.ss


          <% if GalleryImages %>
                    say hi

          <% end_if %>

    I get an this unexplained hyphen appearing at the start of the HTML output which means the page gets no styling in IE,

    -<!doctype html>

    I have tried other conditional checks for in the if and the HTML renders as expected.

    But at loss as to whether I am doing something wrong or if this is a bug. But also have the same problem when using

    <% control GalleyImages %>

    Any help would be much appreciated.

    I am also using dataobject_manager if that helps


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.