Link to parent page?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
hansom

Link to parent page?

Post by hansom »

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
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Link to parent page?

Post by calguy1000 »

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.
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.
hansom

Re: Link to parent page?

Post by hansom »

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?
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Link to parent page?

Post by tsw »

hansom wrote: Is this something that I should submit somewhere and make available?
Please do, you can register in the forge (http://dev.cmsmadesimple.org/) and submit as a patch against current svn if you can.
hansom

Re: Link to parent page?

Post by hansom »

tsw wrote:
hansom wrote: Is this something that I should submit somewhere and make available?
Please do, you can register in the forge (http://dev.cmsmadesimple.org/) and submit as a patch against current svn if you can.
I'd be happy to, but I'm afraid you'll have to explain to me exactly how I do this. Sorry...
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Link to parent page?

Post by tsw »

hansom wrote: I'd be happy to, but I'm afraid you'll have to explain to me exactly how I do this. Sorry...
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 good
(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
Locked

Return to “CMSMS Core”