Jump to:

3432 Posts in 1025 Topics by 865 members

Template Questions

SilverStripe Forums » Template Questions » Single page design

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

Page: 1
Go to End
Author Topic: 672 Views
  • Stefdv
    Avatar
    Community Member
    110 Posts

    Single page design Link to this post

    I'm working on a Single page design.

    Now offcourse this means that all my pages are loaded at once, this is not the problem. With a control loop thru the Menu(1) i can put every $Content ( and $Form ) in the necessary Divs.
    The problem is when i need to login. I never get the login form. There is no security login..but i don''t get a warning that the page isn''t found..It just shows my homepage without a loginform.

    So the real question...can i make/use a custom login form ?

  • kaanuni
    Avatar
    Community Member
    22 Posts

    Re: Single page design Link to this post

    Did you remember to include $Form somewhere in your page template? You should post some code.

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: Single page design Link to this post

    Kaanuni, tx for your reply

    It's a one page side where the content of each page is placed inside a nested Div. I did place the $Content and $Form, but my loginform is not showing.

    Here's my code for Page.ss

    <body >

    <div id="header-wrapper">
       <header id="header-main">
       <h1 class="logo">SCMS</h1>
          
          <nav>
             <ul id="nav">
             <!-- $ pos gives me the position in the iteration, since i need the format 'page-nr' for my script -->
                <% control Menu(1) %>   
                   <li><a href="#page-$pos" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>   
                <% end_control %>         
           </ul>
          </nav>

       </header><!-- / Header Main -->
    </div><!-- / #Header Wrapper -->

    <% control Menu(1) %>
       <div class="hw" id="page-$pos">
       <% if Last %>
             <div class="elem-1">
                            <div class="elem-1-bg">
    </div>
                         </div>
                         <div class="elem-2">
                            <div class="elem-2-bg">
       </div>
                         </div>
                         <div class="elem-3">
                            <div class="elem-3-bg">
    </div>
                         </div>
                         <div class="elem-4">
                            <div class="elem-4-bg">
       </div>
                         </div>
                         <div class="elem-5">
                            <div class="elem-5-bg">
    </div>
                         </div>
                         <div class="elem-6">
                            <div class="elem-6-bg">
       </div>
                         </div>
                         <div class="elem-7">
                            <div class="elem-7-bg">
    </div>
                         </div>
                         <div class="elem-8">
                            <div class="elem-8-bg">
    </div>
                         </div>
                         <div class="hw" id="content-inner"> <!-- This is the actual content div -->
       <% end_if %>
    <% end_control %> <!-- this was the first run, to build the Div structure -->

    <!-- Now whe have to loop thru them again to place the Content -->
                         <% control Menu(1) %>
                         
                         <div class="page home" id="home">
                            <div class="page-info-wrap">
                            <div class="page-info">
                                  
                                     <div class="viewport">
                                        <div class="overview">

                                           $Content
                                           $Form
                                           $PageComments

                                        </div><!-- / .overview -->
                                     </div><!-- / .viewport -->
                                  
                               </div><!-- / .page-info -->
                         </div><!-- / .page-info-wrap -->
                         </div><!-- / .page home -->
                         <% end_control %>      
                      </div><!-- / #content-inner -->

    </div></div></div></div></div></div></div></div>

  • kaanuni
    Avatar
    Community Member
    22 Posts

    Re: Single page design Link to this post

    Try placing $Form outside of the <%control Menu(1) %> context. I'm pretty sure $Form is a controller method and in that context it is looking for a property called form in the model (db, has_one, has_many, etc...) So just move it outside the loop and it will probably show up.

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: Single page design Link to this post

    Ahh, that make's sence... Any thoughts on how ? lol

    tx a lot.

  • kaanuni
    Avatar
    Community Member
    22 Posts

    Re: Single page design Link to this post

    Just move $Form either between <!-- / #Header Wrapper --> and <% control Menu(1)% > or below the last <%end_control%>. You can then wrap it with whatever div's you want.

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