This topic is locked

variable in template

12/1/2017 5:45:42 AM
PHPRunner General questions
S
snuffi01 author

Hi,
I have an master table info (list) page where i need to have an link that takes user further based on what record they are on atm.

My data on page is fixed inside an table and i want each row inside the table to be clickable with the link.

I make the row in the table to an link with something like this in html:



<TR onclick="DoNav('link')">



As i need unique links that depend on what record user is on i need to pass one of the fields on the page as variable to the html (template).

I would need the onclick to be something lik ethis:



<TR onclick="DoNav('mob_workgroups_ink_samt_setting_view.php?editid1={$WorkgroupDN}')">


My field that needs to be added at the end of link is called "WorkgroupDN"

So my idea is to use the assign the field WorkgroupDN to an var and then use that in template.
I'm testing to do this in the "ListPage: After record processed" as this:



assign($wg, $data["WorkgroupDN"]);


And then to use the $wg in my table row in the template (html) :



<TR onclick="DoNav('mob_workgroups_pickup_setting_view.php?editid1={$wg}')">


Problem for me is that it dosent work, the link doesnt get the $wg at the end.
Am i approaching my needs the right way?

How can i reach my $wg inside the html?
/ Kristian

admin 12/2/2017

I recommend you to use 'Click actions', it is specifically designed to implement functionality like this. No need to re-invent the bicycle.

https://xlinesoft.com/phprunner/docs/list_page_settings.htm

S
snuffi01 author 12/2/2017



I recommend you to use 'Click actions', it is specifically designed to implement functionality like this. No need to re-invent the bicycle.

https://xlinesoft.com/phprunner/docs/list_page_settings.htm


HI,

I use "Click actions" in other part of my project but on this part i cant use that as the rows in my table doesnt come from database, its manually added with "php code snippet" on each row.

But the functionality that i want is just the "Click actions" witch makes whole row clickable and not only the field of php code snippet.

Is it possible with an variable in the template language?

admin 12/3/2017

Why cannot you use 'Click actions' still? Not sure I understand.