Upload
paul-delbar
View
1.780
Download
5
Tags:
Embed Size (px)
DESCRIPTION
The first ever public demo of one|content
Citation preview
one|contentjoomla! on steroids
j and beyond 2010paul delbar, delius
objectives
explain why we built one|contentexplain the basic conceptsshow a simple demotalk about advanced featuresget feedback, comments, suggestions, …
why ? tell me why !
example: mgxbymaterialise.com
complex product catalog website
example: axolot.nl
IT training supplier
example: 11.be
consortium of non-profits working in the south
example: 11.be
everything is related to most other things
example: hdp.be
corporate site for HR services company
complex content construction strategies
content projection (everything is an article)makes it difficult for customers to manage content
hacking com_contentsimply never a good idea
developing a number of com_whatevercontent takes on average 2 days per content typevery flexible, but complex to build and hard to maintain
use a CCK extensiondo not address content relations very well (sic)
what if we could …
build structured content sites in a declarative styleusing concepts the customer understands alreadywith minimal codingintegrating content from any data source
using a toolkit that is CMS-agnosticis suited for an integrator (not for end-users)is mildly extensible (but not a framework)
the one|content vision
really everything, likearticlescountriesspeakersinventory itemsorderssearchesusers
content-based navigationoften the most logical way
content-based viewsbuild a consistent UIOO view concept
everything is content. content is everything.
the content cloud
corporate website
campaignwebsite intranet divisional
website application
local data
shared contentnon-CMS data
the basic concepts
representing real-world concepts
schemes
a scheme defines the meta-structure of an item
attributes individual data values, not visual types !
model
a model is an instance of a schemehas specific values for each attribute
comparison using com_content article view : shows one modelcategory blog view : shows a list (selection) of models
relations
in real life, stuff is related to other stuffdifferent types of relations
categorization : categories, topicscomposition: regions, subregions, countriesreflexive: hierarchies, graphs
other projection techniquessections, categories, ...tags
view
an OO approach to viewsfor every scheme, build (at least)
a detail view : introducing nanoScripta list view : link to the detail view
admin viewlist viewedit view
controller
controller taskslistdetailedit/adddelete
how to access the content com_onemod_nanonano content plugin and one package
MVC elements
let’s demo !
nanoScript basics
overall principle
PHP-level library (autoloaded)similar to Smarty (but better, haha)
any content can contain nano tags (eg. HTML, XML, ...)the parser constructs a script execution treeuse: instantiate, load script, inject data, execute
<?php
$ns = new nScript();$ns->load( ‘template.html’ );$ns->set( ‘conference’, ‘J and Beyond’ );
echo $ns->execute();
example
tags and expressions
unary tagsbinary tags (closures)can be extended (class hierarchy)
used for things like {tidy}…{/tidy}
{set release = 1.6}
{if release > 1.5} <h1>Congratulations on releasing version {= release} !</h1>{else} <p class="late">Still at 1.5 !</p>{endif}
variables
handles a number of formatsscalar variablesarraysobjects
expressions
The temperature is {= temp} degrees.
The second competitor's name is {= competitor[1]}.
The address is {= person->address}.
The order total is {= order->net + order->vat}.
control structures
the usualif, then, elsewhile, endwhileloop
{if count(entries) > 0} <ul>The nominees for extension of the year are {loop entries e} <li>{= e->name]}</li> {endloop}</ul>{endif}
structured HTML
section tag@ tagnamespaces
{section QUESTION title} <div class="question"> <h1 class="question">{= title}</h1> </div>{endsection}
<img src="{@ icon:question}" />{@ QUESTION "Why did we develop one ?"}
nanoScript search path
sets folder sequence / hierarchy to checkapplications of it
could be used to implement template overrideslanguage-dependent script loading
packages
makes nanoScript extensible withhelper functionalityJoomla functions
{if count(entries) > 0} <ul>The nominees for extension of the year are {loop entries e} <li>{= e->name]}</li> {endloop}</ul>{endif}
custom nodes
extend the syntax with unary or binary nodesuseful examples
tidyExcel or PDF generator
<p>Comment:</p><div> <h1>{= entry->title}</h1> {tidy} {= entry->introText} {= entry->fullText} {endtidy}</div>
the nanoScript content plugin
placed inside an articlesimilar to a content plugin, but more genericmakes content extremely dynamic
how would you use this ?show content depending on the user access level
access user info using a packageinclude one|content views
advanced topics
with real-life examples
more controller stuff
selecting modelshow does the select task work ?the query object
influencing selectionsfiltersquerying multiple related schemes
what about performance (caching, joins, …)building a custom model factory
building a multi-scheme search form
similar to the edit formdifferent widgets
can include operators (like, begins with, …)find items related to one or more of …
example from MGX
permissions : an open permissions system
controller permissionsform permissionsbuild your own terms
behaviors
search and the search plugin (search behavior)slugcalendargooglerss
other examples of behaviors publishversioningmultilingualwikiclass
stores and factories
data resides in different placesthe Joomla/Nooku databaseother MySQL tablesSQL Server, Oracle, …behind a SOAP service
schemes and storesseparates the logical and physical layers
stores and strategiesencapsulate the data-level adapter
custom controllers and admins
framework-like extensionstask-oriented
duplicatepublish
wizard-likeduplicateimport/export
build semantic admins
thanks !