Aug 222011
 

I’ve written a small plugin that allows to format poems properly. It adds capabilities to center-align, left-align or right-align a text or to add indent of the text.
This is done by adding divs and calculating the text-extends within PHP. It supports templating, so the layout of the poem depends on the template that was chosen.
This plugin uses the [ poem] shortcode.

The background pictures for the poems are loaded from Wikimedia. If you want to use this plugin, make sure that you’re allowed to use these pictures or create your own templates.

As usual for all my projects, this is also hosted on GitHub in my personal space. You can download it from here.

I’m always happy to get your feedback on this via email.

Examples

One Column

[ poem template="one_column" author="Ipsme Lore" date="08.15.4711" title="one column"] 
Your text goes here
and here 
and here
[ /poem]

[poem ipsum template=”one_column” author=”Ipsme Lore” date=”08.15.4711″ title=”one column”] [/poem]

Two columns

[ poem template="two_columns" author="Ipsme Lore" date="08.15.4711" title="two columns"] 
Text for column 1 goes here
and here 
and here
#2# now we switch to column2
this is written in the second column
[ /poem]

[poem ipsum template=”two_columns” author=”Ipsme Lore” date=”08.15.4711″ title=”two columns”] [/poem]

Advanced formatting

[ poem template="one_column" author="Ipsme Lore" date="08.15.4711" title="adv. format" ]
#l# start with left align text
this is a text that only is a place-holder
another placeholder text

+ indent it
++ a little bit more

#r#switch to right align
++indent

#c# stay centered
[ /poem]

[poem template=”one_column” author=”Ipsme Lore” date=”08.15.4711″ title=”adv. format” ]
#l# start with left align text
this is a text that only is a place-holder
another placeholder text

+ indent it
++ a little bit more

#r#switch to right align
++indent

#c# stay centered
[/poem]

Default Template

[ poem ipsum author="Ipsme Lore" date="08.15.4711" title="default template"] [/poem]

[poem ipsum author=”Ipsme Lore” date=”08.15.4711″ title=”default template”] [/poem]