Random Guest Book Entry (Multilingual) Tag

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Random Guest Book Entry (Multilingual) Tag

Post by Russ »

I've added a sort of demo of a multilingual tag, called 'Random Guest Book Entry (Multilingual)' to the forge
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}
What optional parameters does it take?
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'}
ii. You can disable the surrounding blockquote ( ...), the default is enabled, with:

Code: Select all

{sfi_random_guestbook_entry blockquote='0'}
iii. You can disable the surrounding quotes on the comment, the default is enabled, with:

Code: Select all

{sfi_random_guestbook_entry quotes='0'}
iv. You can specify the type of quote to be displayed for the opening (left) quote symbol and the closing (right) quote symbol. The default is (you specify nothing), which means for the left quotes, “ (“) and for right quotes ” (”) are used.

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'}
iv b. To specify the closing (right) quote:
{sfi_random_guestbook_entry smartquote_right='your_option'}
'smartquote_right' options are: single, single_low, quote, double or double_low.
   * single = ’ (’)
   * single_low = ‚ ( ‚)
   * quote = " (&quote;)
   * double = ” (”)
   * double_low = „ („)
For example:

Code: Select all

{sfi_random_guestbook_entry smartquote_right='double_low'}
v. You can disable the display of the sender of the message, the default is enabled, with:

Code: Select all

{sfi_random_guestbook_entry sender='0'}
What CSS is available for this Tag?
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;}
The Tag is not working?
Perhaps you typed something wrong? Try entering the Tag with no parameters:

Code: Select all

{sfi_random_guestbook_entry}
The module is meant to be silent on failure, check for comments in your HTML for clues!
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/
Last edited by Russ on Mon Oct 19, 2009 11:14 am, edited 1 time in total.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Random Guest Book Entry (Multilingual) Tag

Post by Russ »

Glad you liked it AnnasStudio ;-)
sam_m
Forum Members
Forum Members
Posts: 34
Joined: Thu Jun 11, 2009 11:59 pm

Re: Random Guest Book Entry (Multilingual) Tag

Post by sam_m »

Hello Russ, this is a fantastic little script and works great, thank you for your work on this, but just wondered if its possible to allow HTML tags at all, so for example if a website was added to the guestbook, this could be displayed with the hyperlink attached.

Thanks
Sam
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Random Guest Book Entry (Multilingual) Tag

Post by Russ »

Hi Sam, glad you like it. Do you actually mean a link in the text or perhaps better to use the actual link (if any) from the captured Guestbook entry?
Would you actually want this to be a link to the website or just the text?
Post Reply

Return to “Modules/Add-Ons”