Loading...
 
Skip to main content

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
(0)
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_plugin

They 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 clipboard
function 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!

Copy to clipboard
HELLOTHERE(firstname=>"Thurston", lastname=>"Howell III Esq. CPA")}{HELLOTHERE}
yields

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 frsdfsd
sdfsdfsdf
Copy 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+
Demonstrate Bug (older Tiki versions)
Ticket ID
1934
Created
Monday 04 August, 2008 21:47:23 UTC
by Unknown
LastModif
Tuesday 05 August, 2008 18:11:00 UTC


Show PHP error messages