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.

Template Questions /

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

Single page design


Go to End


6 Posts   2008 Views

Avatar
Stefdv

Community Member, 110 Posts

10 October 2012 at 2:55am

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 ?

Avatar
kaanuni

Community Member, 22 Posts

10 October 2012 at 3:50am

Edited: 10/10/2012 3:50am

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

Avatar
Stefdv

Community Member, 110 Posts

10 October 2012 at 6:29am

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>

Avatar
kaanuni

Community Member, 22 Posts

10 October 2012 at 8:23pm

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.

Avatar
Stefdv

Community Member, 110 Posts

11 October 2012 at 6:50am

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

tx a lot.

Avatar
kaanuni

Community Member, 22 Posts

12 October 2012 at 11:26pm

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.