DirkH
I'm new here

Redirect structural element to other section within same project

Jump to solution

Hello,

We'd like to redirect a navigational element within a section to a different section within another part of the structure.

To explain it with an image:

FirstSpirit_ReferencingOtherPartFromSameProject.JPG

In the fake example above, we'd like people who access "test 2" to land on the page "gameinfo_tests", including the navigation that belongs to that section. That means that they are redirected to a different part of the website, within the same project.

Besides the standard internal reference, we know it's possible to "use external URL" and "use URL from related project", but we can't figure out how to redirect to a different part of the structure within the same project. We'd obviously like to avoid using external URL's to redirect to our own website or duplicating the structure.

Anybody know how to do this?

Dirk

0 Kudos
1 Solution

Accepted Solutions
DirkH
I'm new here

To keep everybody updated: what we did in the end, was create a specific page template, purely dedicated to redirecting. The only option in that page template, was an internal link template.

We drop the redirecting page into the structure, as a navigation point. Any user accessing that page will be forwarded to the page it links to.

This turns out to be quite uncomplicated and easy to establish.

I'll go ahead and mark my own answer as "Correct" in this particular case. Thanks a lot for all your input though!

View solution in original post

0 Kudos
6 Replies
Peter_Jodeleit
Crownpeak employee

You could define a "related project" configuration which points to the same project and then "use URL from related project".

Peter
0 Kudos
stephan
I'm new here

Hi Dirk,

you could also check the radiobutton "use external URL" and instead of the absolute link enter a CMS_REF to the page you are trying to link to (e.g. $CMS_REF(pageref:"gameinfo_tests")$).

The next thing one must do, is to change all link usages to the redirect page (e.g. navigations, link-templates, etc.) so that they parse the contents of the external url field if it is filled.

Example for a changed navigation:

Page-Template:

$CMS_SET(set_pt_hrefNavigationSnippet)$

  $CMS_IF(#nav.ref.getPageLangSpec(#global.language).useExternalUrl())$

            href="$CMS_VALUE(eval(#nav.ref.getPageLangSpec(#global.language).getUrl()).toString.convert)$"

  $CMS_ELSE$

            href="$CMS_REF(#nav.ref)$"

  $CMS_END_IF$

$CMS_END_SET$

Render-Template-Navigation:

<CMS_ARRAY_PARAM name="unselectedHTML">

  <CMS_ARRAY_ELEMENT index="0..99"><![CDATA[<a $CMS_VALUE(set_pt_hrefNavigationSnippet)$ title="$CMS_VALUE(#nav.label)$">$CMS_VALUE(#nav.label)$</a>  / ]]></CMS_ARRAY_ELEMENT>

</CMS_ARRAY_PARAM>

best regards

Jörg

DirkH
I'm new here

We've looked at both options and went with Peters suggestion. Thanks for the help, guys!

0 Kudos
DirkH
I'm new here

To keep you updated. This solution worked until we switched on our vanity URL's. We don't use the internal FirstSpirit reference names in our URL, but have a script that creates nice looking ones.

However, the references to another project don't pick this up unfortunately, and create URL's like this:

www.topleveldomain.de/nameoftheproject/foldername_1/internalreferencename_1.html

While the real page is under:

www.topleveldomain.de/GameInformation/Overview.html

As an emergency solution, we wanted to add our own external URL's as external URL's for these references, but FirstSpirit tells us "Please insert a URL", no matter what we do. We've now disabled these sections and will launch without them.

In the mean time we'll see if we can update our vanity URL script to include these references. If you know of any other ideas to link to a different section from the site navigation, don't hesitate to mention it.

Cheers,

Dirk

0 Kudos

How does your "vanity URL creation script" works? Is this really a script? Or a custom implementation of UrlCreator?

Peter
0 Kudos
DirkH
I'm new here

To keep everybody updated: what we did in the end, was create a specific page template, purely dedicated to redirecting. The only option in that page template, was an internal link template.

We drop the redirecting page into the structure, as a navigation point. Any user accessing that page will be forwarded to the page it links to.

This turns out to be quite uncomplicated and easy to establish.

I'll go ahead and mark my own answer as "Correct" in this particular case. Thanks a lot for all your input though!

0 Kudos