Link to parent page?
-
hansom
Link to parent page?
I want to have a link to the current page's parent page in my template. At first I thought I could use the cms_selflink tag and use the dir parameter, but it only supports links to the start, next or previous page. So, is there a way to generate a parent/up link or do I have to create the functionality myself? Would modifying the cms_selflink tag be a good/correct way of doing this?
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Link to parent page?
Yes, I think cms_selflink is the proper place for this, and if it doesn't exist already you'll have to add it.
Maybe adding the option for "dir=parent" would be the best way.
Maybe adding the option for "dir=parent" would be the best way.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
hansom
Re: Link to parent page?
OK, I modified function.cms_selflink.php. It now accepts up as value for the dir parameter. Not sure if my solution is optimal but it seems to work just fine. Is this something that I should submit somewhere and make available?
Re: Link to parent page?
Please do, you can register in the forge (http://dev.cmsmadesimple.org/) and submit as a patch against current svn if you can.hansom wrote: Is this something that I should submit somewhere and make available?
-
hansom
Re: Link to parent page?
I'd be happy to, but I'm afraid you'll have to explain to me exactly how I do this. Sorry...tsw wrote:Please do, you can register in the forge (http://dev.cmsmadesimple.org/) and submit as a patch against current svn if you can.hansom wrote: Is this something that I should submit somewhere and make available?
Re: Link to parent page?
best practice is to get svn client (for linux search for subversion in your package manager) and for windows people say that tortoise svn is goodhansom wrote: I'd be happy to, but I'm afraid you'll have to explain to me exactly how I do this. Sorry...
(http://dev.cmsmadesimple.org/docman/vie ... isesvn.htm) after installed you checkout the project, do your changes and say svn diff > patch_against_.patch (not sure how to do it in windows, sorry)
then you can create account in the forge http://dev.cmsmadesimple.org/account/register.php and go to core tracker patches portion and submit your well tested and documented patch file created with svn.
hope this helps

