Skip to content

Instantly share code, notes, and snippets.

<article>
{% for post in page.posts %}
<h2>{{ post.title }}</h2>
{{ post.body }}
{% endfor %}
</article>
template : post
title: Home
posts :
- title: This is my first post
body: Testing out Caret cms :)
- title: This is my second post
body: Lorem ipsum dolor ist...
{% extends 'default.html' %}
{% block main %}
<h1>{{page.title}}</h1>
{{ page.body | markdown }}
{% endblock %}
@almonk
almonk / Analytics.module
Created June 20, 2011 10:49
Google Analytics module for Processwire
<?php
class Analytics extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'Google Analytics',
'version' => 101,
'summary' => 'Adds some quick hooks for the Google Analytics Service',
@almonk
almonk / FacebookLike.module
Created June 2, 2011 10:22
Facebook Like module for Processwire
<?php
class FacebookLike extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'Facebook Like Button',
'version' => 101,
'summary' => 'Display Facebook like buttons on your Processwire site.',
@almonk
almonk / usage_example.js
Created May 31, 2011 11:02 — forked from jgwhite/with-history.js
Simple pushState wrapper
$(document).bind("WithHistory.urlDidChange", function() {
$.ajax(window.withHistory.url(), {
dataType: "html",
success: function(response) {
var body = response.match(/<body.*?>([\s\S]+?)<\/body>/)[1];
var tmp = $("<div />");
tmp.html(body);
var newContent = tmp.find("#pagecontent").html();
$("#pagecontent").animate({ opacity: 0 }, 250);