Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sashainparis/5758984 to your computer and use it in GitHub Desktop.
Save sashainparis/5758984 to your computer and use it in GitHub Desktop.
Allow to use Create.js for Symfony/Cmf/BlogBundle. Place the xml file in the Resources/rdf-mappings directory. Below is a example file template for the Post content.
<type
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
typeof="sioc:Post"
>
<children>
<property property="dcterms:title" identifier="title" tag-name="h1"/>
<property property="sioc:content" identifier="body" />
</children>
</type>
{% extends "SymfonyCmfBlogBundle::default_layout.html.twig" %}
{% block content %}
{% createphp post as="rdf" %}
<div {{ createphp_attributes(rdf) }}>
<div class="row-fluid">
<div class="span6">
{% if prevPost %}
<a href="{{ path(prevPost, {'slug': prevPost.slug}) }}">&lt;&lt; {{ prevPost.title }}</a>
{% endif %}
</div>
<div class="span6" style="text-align: right">
{% if nextPost %}
<a href="{{ path(nextPost, {'slug': nextPost.slug}) }}">{{ nextPost.title }} &gt;&gt;</a>
{% endif %}
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h1 {{ createphp_attributes( rdf.title ) }}>{{ createphp_content( rdf.title ) }}</h1>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<p><i>Posted on: {{ post.date.format('Y-m-d H:i:s') }}</i></p>
</div>
<div class="span6" style="text-align: right">
<i>{% trans from "SymfonyCmfSimpleCmsBundle" %}Tagged{% endtrans %}:</i>
<i>{% include "SymfonyCmfBlogBundle:Blog:tags_inline.html.twig" %}</i>
</div>
</div>
<div class="row-fluid">
<div class="span12" {{ createphp_attributes( rdf.body ) }}>
<div {{ createphp_attributes( rdf.body ) }}>{{ createphp_content( rdf.body )|nl2br|raw }}</div>
</div>
</div>
</div>
{% endcreatephp %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment