Hi, I think this is very simple but I search and test all the documentation I found but I don't get the result, someone can help me?
Let's say I have a file called action.showlist.php on my module called Mymodule
How can I access to this file from a direct link on my any other module template?
If I try this code:
show list
I get a blank page...
I try this too changin all and nothing...
$this->smarty->assign('show_list',$this->CreateFrontendLink($id, '', 'showlist', 'nombre del link', '', '',false, true, '', false));
help me please...
How to access to specific module action with an a href link
-
- New Member
- Posts: 4
- Joined: Sun Dec 21, 2008 6:11 am
-
- New Member
- Posts: 4
- Joined: Sun Dec 21, 2008 6:11 am
Re: How to access to specific module action with an a href link
ok, after a few days and not get a solution, I create my own, I think this is not the best but it works for may purposes.
I hope it help you.
1. In every module you wanto to access trought a specific action of this from any page or module you have to create a new file called action.link.php
on this file you have to put this code:
if (!isset($gCms)) exit;
$page = '';
if( isset( $params['action_to_do'] ) )
{
$action_to_do = trim($params['action_to_do']);
$this->smarty->assign('link2moduleaction',$this->CreateLink($id, $action_to_do, $returnid,'text_to_show_as_link', '' ));
// Display the populated template
echo $this->ProcessTemplate('link.tpl');
}
on this same module you have to create a file called link.tpl on the templates dir an put a code like this:
{$link2moduleaction}
2. after create those 2 files you can call the module action from any other page, jus put on youre template:
{cms_module module="the_module_where_you_create_the_2_files" action="link" action_to_do="module_action_to_do"}
and it show a link to action module_action_to_do on the_module_where_you_create_the_2_files.
remember the action.link.php is just an interface to the module you want to access.
if you know a better solution just let me know.
I hope it help you.
1. In every module you wanto to access trought a specific action of this from any page or module you have to create a new file called action.link.php
on this file you have to put this code:
if (!isset($gCms)) exit;
$page = '';
if( isset( $params['action_to_do'] ) )
{
$action_to_do = trim($params['action_to_do']);
$this->smarty->assign('link2moduleaction',$this->CreateLink($id, $action_to_do, $returnid,'text_to_show_as_link', '' ));
// Display the populated template
echo $this->ProcessTemplate('link.tpl');
}
on this same module you have to create a file called link.tpl on the templates dir an put a code like this:
{$link2moduleaction}
2. after create those 2 files you can call the module action from any other page, jus put on youre template:
{cms_module module="the_module_where_you_create_the_2_files" action="link" action_to_do="module_action_to_do"}
and it show a link to action module_action_to_do on the_module_where_you_create_the_2_files.
remember the action.link.php is just an interface to the module you want to access.
if you know a better solution just let me know.