Jump to:

23493 Posts in 18996 Topics by 2878 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: 324 Views
  • matt_misc
    Avatar
    Community Member
    1 Post

    conditional check template rendering errror Link to this post

    Hi

    I have a gallery page that has_many gallery images as below

    GalleryPage.php

       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

    GalleryPage.ss

          <% if GalleryImages %>
          
              <div>
                    say hi
              </div>    

          <% 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

    Cheers

    324 Views
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.