http://dev.cmsmadesimple.org/projects/randgbtag
This is based on my 'Multilingual Tag Template' (which is also in the forge - http://dev.cmsmadesimple.org/projects/multilingualtag)
What does this Tag do?
A Multilingual Tag to display a random Guestbook (Module) entry on a page, in a flexible way
How do you use this Tag?
Just insert the tag into your template/page:
Code: Select all
{sfi_random_guestbook_entry}
i. You can specify a display language for the tag, (the default is English - en_US).
(Bit of a cheat as it doesn't have any real display text, but look at the XHTML produced by this tag and how the Help and About are multilingual.)
The languages initially available for this tag are:
* English (en_US)
* German (de_DE)
* Spanish (es_ES)
* French (fr_FR)
* Dutch (nl_NL)
To set the display language use:
Code: Select all
{sfi_random_guestbook_entry lang='nl_NL'}
Code: Select all
{sfi_random_guestbook_entry blockquote='0'}
Code: Select all
{sfi_random_guestbook_entry quotes='0'}
iv a. To specify the opening (left) quote:
{sfi_random_guestbook_entry smartquote_left='your_option'}
'smartquote_left' options are: single, quote or double.
* single = ‘ (‘)
* quote = " (")
* double = “ (“)
For example:
Code: Select all
{sfi_random_guestbook_entry smartquote_left='single'}
{sfi_random_guestbook_entry smartquote_right='your_option'}
'smartquote_right' options are: single, single_low, quote, double or double_low.
* single = ’ (’)
* single_low = ‚ ( ‚)
* quote = " ("e;)
* double = ” (”)
* double_low = „ („)
For example:
Code: Select all
{sfi_random_guestbook_entry smartquote_right='double_low'}
Code: Select all
{sfi_random_guestbook_entry sender='0'}
As you can see from above, you can use the CSS classes included:
On the blockquote, either just use 'blockquote' or the class '.guestbook_entry'
On the comment text use the class '.guestbook_message'
On the sender text use the class '.guestbook_sender'
For the quote entity you can use the classes '.guestbook_smartquote_left' or '.guestbook_smartquote_right'
Code: Select all
/*sfi random_guestbook_entry plugin css*/
.guestbook_entry {padding: .5em 1em; color: #666; background: #ebeef5;}
.guestbook_message {color: #666; font-family: 'Georgia','Times New Roman','Times','Microsoft Serif',serif;}
.guestbook_sender {font-style: italic;text-align: right; padding: 0; margin:0; color: #808080; font-size: 90%;}
.guestbook_smartquote_left{color: #808080;padding-right: 0.1em;font-weight: bold;}
.guestbook_smartquote_right{color: #808080;padding-left: 0.2em;font-weight: bold;}
Perhaps you typed something wrong? Try entering the Tag with no parameters:
Code: Select all
{sfi_random_guestbook_entry}
If the Guestbook module is NOT installed or NOT active then you will find (in the default or specified language):
If there are NO Guestbook entries then you will find (in the default or specified language):
Important Notes for this Tag
This tag strips any HTML from the Guestbook message or sender text.
This tag does not translate the actual Guestbook comments nor specify in which langauge comments are shown.
It could if this existed in the Guestbook module, for example, only show comments in the language of the viewer.
But this is probably only useful for those using CMSMS MLE and would need to be captured at Guestbook comment entry.
This has not been tested in CMSMS MLE but should work fine if you set the display language parameter
The display language is controlled by setting the 'lang' parameter of the Tag described above.
If you do not set this then the Tag will use the language set in Admin:
'Site Admin / Global Settings / Default language'
If no language is set there, then the Tag uses the default (en_US)
The admin language (for Help and About) is controlled by the setting in Admin:
'My Preferences / User Preferences / Language'
If no language is set there, then the Tag uses the default (en_US)
Please read the 'Help' text for the tag, it is multilingual and also the comments in the code (and the heavily commented code for the template upon which it is based) for further information.
Apologies in advance for the translations, they were done with Google. If any one wishes to send corrections then please do and I will amend the code.
A working example is here:
http://www.weddingsandportraitphotography.co.uk/