Welcome, Guest
Username: Password: Remember me

TOPIC: Passing variables between two layouts

Passing variables between two layouts 19 Sep 2013 16:13 #11132

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Hi,

I've got a layout ('master' layout), each row contains a link to see details in another layout ('slave' layout).
I've modify the first view of the master layout with links to the slave layout with parameters :

<td style="text-align:right">
<?php echo JDom::_('html.fly', array(
'dataKey' => 'M09',
'dataObject' => $row,
'route' => array('view' => 'stat','layout' => 'smouth','cid[]' => $row->id,'m'=>'9')
));?>
</td>

The links are ok, but how/where can I edit the query for the 'slave' layout ?
The administrator has disabled public write access.

Passing variables between two layouts 19 Sep 2013 18:52 #11133

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Hi,

why dont you do it in cook?
The administrator has disabled public write access.

Passing variables between two layouts 20 Sep 2013 07:58 #11134

  • ewajoom
  • ewajoom's Avatar
  • Offline
  • Junior Member
  • Posts: 36
  • Thank you received: 2
  • Karma: 0
Hi,

Because when I use cook, I don't see the possibility to add any parameter, I need 13 different links by line, one link for each column :

Object January February ....
1 [url=#]link[/url] [url=#]link[/url]
2....

Thanks
The administrator has disabled public write access.

Passing variables between two layouts 20 Sep 2013 11:45 #11137

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
What do you want to do with 'm' (month) var ?

1. This var is available anywhere you want though JInput.
2. Then when the redirection occurs, you lost it from the new redirected url. There is a solution for that if you need to keep it in url. (add a follower in helper)
3. Then, you can output it in the slave page in a hidden field, in order to follow for the next page.

I know I do not explain how to do it, but it gives you the idea.

Hope it helps.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.159 seconds

Get Started