Creating a Simple Content Driven Site
From bemoko developer wiki
EXERCISE - Creating a Simple Content Driven Site
- Summary: Create a simple content driven site in bemokoLive
- Level: Basic
Get the Site
- Check out the source from SVN into your bemokoLive sites directory.
- cd ~/bemoko/sites
- svn co http://bemoko.googlecode.com/svn/sites/exercise_simple_content/trunk exercise_simple_content
- Or download (coming soon) and extract the site into your bemokoLive sites directory.
- Access the page on your bemokoLive install, e.g. http://localhost:8080/live/exercise_simple_content/i
You can also simply browse the source.
How does it work?
The YamlReader plugin has been registered in the site-config.xml
<content-sources> <source name="site" plugin="YamlReader" scope="request"> <param name="filepath">data/site.yaml</param> </source> </content-sources>
Site content has been created in the file data/site.yaml and the content has been referenced in the HTML template 320/home.html and the root/home.html, e.g.
<h1>${content.site.home.title}</h1> <div class="details">${content.site.home.mobile.welcome}</div>
Note that different content is provided for both small and large screen.
