TikiWiki Plugins – Issues with Using Double Quotes to Pass Parameters in 1.9.11
- Status
- Pending
- Subject
- TikiWiki Plugins – Issues with Using Double Quotes to Pass Parameters in 1.9.11
- Category
- Error
- Usability
- Feature
- Wiki Plugin (extends basic syntax)
- Submitted by
- nikhilodeon
- Lastmod by
- nikhilodeon
- Rating
- Description
I found TikiWiki's use of plugins to be an excellent substitute for the lack of built-in support for parameterized templates as found in MediaWiki - http://www.mediawiki.org/wiki/Help:Templates
I referred to the following instructions to create a php-based plugin:
http://dev.tikiwiki.org/tiki-index.php?page=Hello+World#To_create_a_new_pluginThey work great but with one caveat:
The use of double-quotes which are necessary for displaying strings with commas seems to create problems. For instance with a simple "HelloThere" plugin syntax:Copy to clipboard{HELLOTHERE(firstname=>, lastname=>)}{HELLOTHERE}
This invokes the following simple function:Copy to clipboardfunction wikiplugin_hellothere($data $params) { extract ($params EXTR_SKIP); $strHello = "Hello there $firstname $lastname" ; return $strHello; }(Squiggly brackets removed for display reasons)
Copy to clipboard{HELLOTHERE(firstname=>"Thurston", lastname=>Howell)}{HELLOTHERE}yields
Hello There Thurston Howell.
Great!yieldsCopy to clipboardHELLOTHERE(firstname=>"Thurston", lastname=>"Howell III Esq. CPA")}{HELLOTHERE}Hello There Thurston Thurston.
Not so great...Namely adding double-quotes to get around the issue of commas within strings introduces a whole other problem of its own – repetition of the first variable. When there are 10 variables for instance the first quoted value will be repeated 10 times.
I am using TikiWiki 1.9.11; has anyone encountered this issue and if so is there a remedy?
- Solution
Did you try with a comma?
Title frsdfsdsdfsdfsdfCopy to clipboard{BOX(title=>"Title frsdfsd", bg=>red)}sdfsdfsdf{BOX}works for me in 1.9
- Importance
- 5
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 1934
- Created
- Monday 04 August, 2008 21:47:23 UTC
by Unknown - LastModif
- Tuesday 05 August, 2008 18:11:00 UTC