Sign up Sign in Samples Blog services contact support
Layout

custom layouts

Layout rules allow you to choose a layout for any set of cards.  And with a little knowledge of HTML and inclusions, you can easily create your own layouts.

 
+example

Here are all of the layouts in use on wagn.org:

 
+howto

A *layout rule works like any other rule (see the rules documentation to learn about navigating to and editing rules).

 

Here is the layout card currently in use on wagn.org.  ("Bruce" is just the name we gave this skin because it sounds like "bruise"; our skin is black and blue.)

(See raw HTML syntax)

 

Notice how the layout uses standard Inclusion Syntax.   These inclusions work just like any normal inclusion -- it simply includes those cards.

 

For a layout to function correctly, it must include these two cards:

  • {{*head}} -- without this inclusion, javascript won't work, so your Wagn will lose all its dynamic functionality
  • {{_main}} -- this "contextual name" determines where the main card goes.  For example, if you go to a card named "Hot Dog", then the Hot Dog card will appear where this inclusion shows up in the layout.   Without this inclusion, every card with this layout will look the same.

 

Note: the default view for cards included anywhere outside the main card is core, rather than the usual content.

 

+tips
  1. If you manage to break your Wagn while messing around with layouts, try adding ?layout=blank to the end of your url.  This will give you access to a functioning, built-in layout
  2. This trick is often most useful in combination with a custom view (eg "edit" or "options").
  3. Similarly, you can test layouts before using them by adding "?layout=[layout name]" at the end of most URLs.

 

+discussion

Hey Guys! I'm excited about the new layouts infrastructure!

 

Simple. Elegant. Flexible. Just like wagneering. Well Done! I look forward to playing with it more.


This is amazing! I am so glad to find this. I was considering Semantic MediaWiki for a project, but the ease and grace of Wagn is superb, as with this custom layout feature. Well done! Excellent crafting!

  --Patrick (Not signed in).....Sun Oct 25 14:58:07 -0700 2009


Great job. Getting very close to the 'Everything-is-a-Card' meme.

  --WG (Not signed in).....Mon Oct 26 08:52:55 -0700 2009


Layouts now work with any set, not just *all.

  --John Abbe.....Tue Apr 27 02:24:59 -0700 2010


The list (in +examples) of "all" layouts isn't complete, and I can't think of a way to get all layouts, since some (e.g. mobile) aren't referred to by a +*layout card. Ideas?

  --John Abbe.....Thu Jan 27 16:34:09 -0800 2011

 

Tickets relevant to Layout