Hi everyone,
I would like to define a tag to be able to create a link pointing to the specified page (using alias) and in that same tag I would need to retrieve some database information from a module I have created.
To put it more clearly, the access to the module's items is necessary so I can retrieve the correct id using the name of an item. The link created will not have to hold any information about the module itself, the module information will merely be used to display the appropriate text and to point at the correct anchor within the given page. I can figure out how the management of the link creation but I don't know how to grab an instance of the module to accomplish my needs.
I am not sure if I am clear enough, feel free to request more information as long as you specify what you'd like to know accurately.
Thank you very much for your time!
Creating a user defined tag related to a module.
- kittymcooper
- Forum Members
- Posts: 44
- Joined: Sat Aug 02, 2008 4:40 am
- Location: Fort Collins, CO
Re: Creating a user defined tag related to a module.
Why not make one of the actions in your module the creation of this link? Then call your module with the parameters for the link.
Kitty Munson Cooper, web designer, programmer
Re: Creating a user defined tag related to a module.
You are right, that part seemed so complex yet it is very simple... Something like {cms_module module="mymodule" page="thepage" item="itemalias"} would be pretty much all I need. Thanks
Now for the next part, how can I make my module create a valid link to the page requested by the param? Remember I want to pass the alias only.
thank you all!
Now for the next part, how can I make my module create a valid link to the page requested by the param? Remember I want to pass the alias only.
thank you all!
- kittymcooper
- Forum Members
- Posts: 44
- Joined: Sat Aug 02, 2008 4:40 am
- Location: Fort Collins, CO
Re: Creating a user defined tag related to a module.
If you have the content alias then the url
index.php?page=content_alias
(replace content_alias with actual one)
works fine, so maybe I misunderstand your question?
if all you have is the content id then ...
from the doc
http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide/Creating_Modules#Access_current_page_id_or_alias
index.php?page=content_alias
(replace content_alias with actual one)
works fine, so maybe I misunderstand your question?
if all you have is the content id then ...
from the doc
http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide/Creating_Modules#Access_current_page_id_or_alias
$hm =& $gCms->GetHierarchyManager();
$curnode =& $hm->getNodeById($pageid);
$curcontent =& $curnode->GetContent();
echo $curcontent->GetURL();
Kitty Munson Cooper, web designer, programmer