Loading...
 
Features / Usability

Features / Usability


Re: Re: Problem with Plugin Button not passing itemId to URL

posts: 40

Thanks, Rick, I alway appreciate your help. I've added an autoincrement field to my tracker and set it to be the itemId type( the field id is 31), and just so I can see the value I added {$f_31} to my output_for_kb.tpl template.

I can see the itemId value displayed in my pretty tracker now but when I add {{$f_31}} to the button plugin like this

Update this Record

The Update Knowledge Base page shows only this message "Missing or incorrect trackerId parameter for the plugin." and the Address bar contains this
http://localhost/tiki-9.0/tiki-index.php?page=Update+Knowledge+Base&itemId=%7B%7B%24f_31%7D%7D so it is picking up the variable — but not the value of the variable.

I know I'm not doing something right — I just can't see what.

posts: 3665 United States

You're using {{..}}. Are you using double dynamic variable?

I have several in which I use the single construct, within the button plugin.:

Copy to clipboard
{button href="tiki-index.php?page=Update Knowledge Base&itemId={$f_31}" _text="Update this Record"}


Or, you can do it without the button plugin:

Copy to clipboard
{DIV(type=span,class=button)}[tiki-index.php?page=Update Knowledge Base&itemId={$f_31}|Update this Record]{DIV}


HTH,

- Rick | My Tiki Blog | My Tiki UserPage

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.

posts: 40

Thanks for the suggestion, Rick. I'll try the DIV idea out but after a LOT of trial-and-error (I'm now on version 63 of the Display Knowledge page!) I believe I have found another answer. My page Display Knowledge page now looks like this ( sorry for the formating — I can't find the "Code" button any more and using the CODE pluggin doesn't seem to work, more user-error no doubt, so I had to remove the curly braces in the plugins.)

TRACKERLIST(trackerId=7,filtervalue=24,itemId=$f_31,tpl="output_for_kb.tpl")}{TRACKERLIST

{BUTTON(href="tiki-index.php?page=Search Knowledge Base",_text="Search Knowledge Base")}{BUTTON
{BUTTON(href="tiki-index.php?page=Update Knowledge Base&itemId=",_text="Update this Record")}{BUTTON

If you look carefully at the last Button plugin you can see that I used double curly braces around the word itemId. So it turns out that this is a system variable.
I think that having the itemId autoincrement field in the Tracker was also a big part of getting this to work.


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting