3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1205 Views |
-
Jquery One Page scrolling site

28 March 2012 at 10:40pm
Hi
i'm trying to implement a jquery powered one page website into silverstripe, i have a static website that uses this but would really like to get this working as a cms editable site.
Basically im stumped with getting the menu to work because it's made up of anchor links that animate up the relevent section. i've looked at using redirector urls and this works but really want to show the relevent link as active when on a section.
below is how the menu would be set up if on a static html website:
<ul id="navigation">
<li><a class="active" href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#blog">Blog</a></li>
<li><a href="#contact">Contact</a></li>
</ul>I really hope someone can help me with this, it would be great to get this type of site working within silverstripe.
Thanks
Tamara
-
Re: Jquery One Page scrolling site

3 April 2012 at 11:51pm Last edited: 3 April 2012 11:52pm
Assuming you create your page sections as separate pages in the backend, one way you could build your navigation is
<ul id="navigation">
<% control Menu(1) %>
<li><a href="#{$URLSegment}">$Title</a></li>
<% end_control %>
</ul>and then display your page content by looping again through all pages and outputting them sequentially like this:
<div id="content">
<% control Menu(1) %>
<div id="$URLSegment">
$Content
</div>
<% end_control %>
</div>
| 1205 Views | ||
|
Page:
1
|
Go to Top |

