Free Sling polo shirts! (NOT)

We’ll be giving away nice Sling polo shirts at the end of my talk today, be there!

The complete source code of the mini blog application that I’m going to create, in stages, during the talk, is available below.

Update: slides are available on the conference website.

Stop press: the shirts are held by customs in Memphis, we hope to have them by Friday but there’s no guarantee…sigh

Update: the shirts have finally arrived, grab them at the Day booth at ApacheCon!

  Single page Sling blog demo, shows how content is defined
  by form fields, and the use of Sling.wizard and Sling.getContent.

  To test this, run the Sling launchpad/testing module with "mvn jetty:run",
  copy this script to /apps/blog/blog.esp (via the WebDAV mount at
  http://localhost:8888/) and open

  To add more fields to the posts, simply add them to the form below.

var title = currentNode.title ? currentNode.title : "";

  <title><%= title %></title>
  <script src="/system/sling.js"></script>
  <link rel="stylesheet" type="text/css" href="/sling.css"/>

  <h1>Sling microblog</h1>

  <div class="editor" style="float:right; width:69%">
	  <h2><%= title %></h2>
	  <form method="POST">
	    <input type="text" name="title" style="width:100%"/>

	    <textarea style="width:100%" name="text"></textarea>

	    <input type="submit" value="save"/>

	    <input type="hidden" name=":redirect" value="*"/>

  <div class="nav" style="float:left; width:30%;">
        <li><em><a href="/content/blog/*">[Create new post]</a></em></li>
	      var posts = Sling.getContent("/content/blog", 2);
	      for(var i in posts) {
	      	document.write("<li><a href='/content/blog/" + i + "'>" + posts[i].title + "</a></li>");


Comments are closed.

%d bloggers like this: