Creating a Simple Content Driven Site

From bemoko developer wiki

Jump to: navigation, search
EXERCISE - Creating a Simple Content Driven Site
Summary: Create a simple content driven site in bemokoLive
Level: Basic

Get the Site

  1. 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
  2. Or download (coming soon) and extract the site into your bemokoLive sites directory.
  3. 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.