Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Linking & changing page URLs


Go to End


5 Posts   2311 Views

Avatar
amalet

Community Member, 7 Posts

1 February 2011 at 6:03am

Hi

I've been looking at a few CMSs to build sites in and the two I've found most promising are SilverStripe and ModX. I've been leaning more towards SilverStripe but there is one feature of ModX that looks pretty useful:

When linking to pages in your site in ModX you just use the page's ID. The URL then gets resolved automatically. This means that if the URL/name of a page is changed then links from other pages still work.

Is there an easy way to do something like this in SilverStripe or is linking to other pages done just using the URL? The page IDs don't seem to be displayed anywhere in the CMS.

I'm worried that after setting up links from say the home page to other parts of the site, if we then give the client access to the CMS and they change the URL of a page then none of the links will work any more.

Avatar
ajshort

Community Member, 244 Posts

1 February 2011 at 8:25am

When linking to pages in the CMS using the insert link sidebar, the links are inserted in the format "[sitetree_link id=...]", so they are in fact being linked to by ID. These are rewritten on page load. If you insert a link and then view the raw HTML you can see this.

Additionally, if a user visits an old URL that has been renamed, they are automatically redirected to the new URL.

Avatar
amalet

Community Member, 7 Posts

2 February 2011 at 10:06am

Thanks for the reply.

Is there any way to do this when linking from templates? For example in a footer navigation where only select pages are linked to.

Avatar
Ducki

Community Member, 2 Posts

8 November 2011 at 9:33pm

I'm running into the same issue.
How do you create URLs the correct way?

Avatar
Rodolfo

Community Member, 11 Posts

22 March 2012 at 12:41pm

Same question here ?

How do I insert a link into the template?