Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Stuck with custom .ss

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

Page: 1
Go to End
Author Topic: 993 Views
  • raamklaza
    Avatar
    Community Member
    182 Posts

    Stuck with custom .ss Link to this post

    I have the following Holder and Page.

    But when i load the page i get this message:

    This page contains the following errors:
    error on line 140 at column 8: Opening and ending tag mismatch: div line 0 and body
    Below is a rendering of the page up to the first error.

    I can't find the problem :| I noticed there is an extra </div> at the and of the page...

    GamesHolder.ss
    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content

           <ul id="GamesList">
           <% control Children %>
           <li>
           <div class="gamesname"><a href="$Link">$Title</a></div>
           <div class="gamesphoto">$Photo.SetWidth(50)</div>
           <div class="gamesdescription"><p>$Description</p></div>
           </li>
           <% end_control %>
           </ul>
          
          $PageComments   

       <% if Menu(2) %>
          </div>
       <% end_if %>

    GamesPage.ss
    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Category
          $Description
          $Instructions
          $Content
          
          <div class="Tags">
          Tags: $Tags
          </div>
          
          $PageComments
          
       <% if Menu(2) %>
          </div>
       <% end_if %>

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: Stuck with custom .ss Link to this post

    Anyone?

  • theAlien
    Avatar
    Community Member
    131 Posts

    Re: Stuck with custom .ss Link to this post

    Well (based on the code you posted here) I guess it's just as the error-message tells you:
    You have to add an extra </div> at the end, and maybe you also have to close you're body with </body> (though that's kind of odd - it should already be done by page.ss).

    A little more explanation: you're div-structure is like this:

    <div class="typography">
    <div id="Content">
    <div class="gamesname"></div> // immediately closed
    <div class="gamesphoto"></div> // immediately closed
    <div class="gamesdescription"></div> // immediately closed
    </div> // closes #Content


    simpy count all div's and all /div's and you can see you're missing one. And in the structure above you'll see it's the one that closes .typography

    Do the same for gamespage.ss and it should be solved.

    993 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.