Different URLmaps for same content with constant canonical

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Different URLmaps for same content with constant canonical

aDNers
Hello,

Still somewhat new to dotCMS and trying to figure out how to setup the detail pages/url maps for this scenario:

Each content of a custom type "product test" will have 3 different phases. We can call them Phase1, Phase2, Phase3. A content editor will have to change a dropdown and select which phase that is currently active. The URL should then be built something like: http://domain.com/{phase}/urltitle

The canonical URL should reflect the phase which is selected in the dropdown. However, all three possible urls should be working active links at all times, that is:
 
1) http://domain.com/phase1/urltitle
2) http://domain.com/phase2/urltitle
3) http://domain.com/phase3/urltitle

I wonder if this would be possible using dotCMS, and if so - any guidance on how to approach this would be much appreciated.

(I discovered there is only room for 1 detail page per contentlet and started to wonder if I could build different pages for the different phases of a content but I don't think it is a solution to build Pages where the editor needs to manually pull content.)

BR
Anders

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/77a7b464-31c4-4145-9ea4-5302ac4cceb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

Xander
Hi Anders,

You can use a wildcard/regex in the detail URL, for instance /.*/{urltitle} or /phase[123]/{urltitle}. On the detail page you can check the URL ($request.getRequestURI()) for the phase and display something else based on that. That's the easiest way.
An alternative is a plugin with a servlet / service / filter on the URL and redirect/include a page based on the URL.

Kind regards,

Xander 

Op maandag 28 augustus 2017 10:01:39 UTC+2 schreef aDNers:
Hello,

Still somewhat new to dotCMS and trying to figure out how to setup the detail pages/url maps for this scenario:

Each content of a custom type "product test" will have 3 different phases. We can call them Phase1, Phase2, Phase3. A content editor will have to change a dropdown and select which phase that is currently active. The URL should then be built something like: <a href="http://domain.com/%7Bphase%7D/urltitle" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2F%257Bphase%257D%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHeKLF_SirzYLQAyj9T9W7q_7i85g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2F%257Bphase%257D%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHeKLF_SirzYLQAyj9T9W7q_7i85g&#39;;return true;">http://domain.com/{phase}/urltitle

The canonical URL should reflect the phase which is selected in the dropdown. However, all three possible urls should be working active links at all times, that is:
 
1) <a href="http://domain.com/phase1/urltitle" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase1%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwXFW7ARAz-pRabzMWZA8oJw6xmw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase1%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHwXFW7ARAz-pRabzMWZA8oJw6xmw&#39;;return true;">http://domain.com/phase1/urltitle
2) <a href="http://domain.com/phase2/urltitle" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase2%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1Go7nUU3gdnE99ja87fG7YZirLw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase2%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG1Go7nUU3gdnE99ja87fG7YZirLw&#39;;return true;">http://domain.com/phase2/urltitle
3) <a href="http://domain.com/phase3/urltitle" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase3%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhYXgHW8QhhvcAR9eVreA07dSF8Q&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdomain.com%2Fphase3%2Furltitle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhYXgHW8QhhvcAR9eVreA07dSF8Q&#39;;return true;">http://domain.com/phase3/urltitle

I wonder if this would be possible using dotCMS, and if so - any guidance on how to approach this would be much appreciated.

(I discovered there is only room for 1 detail page per contentlet and started to wonder if I could build different pages for the different phases of a content but I don't think it is a solution to build Pages where the editor needs to manually pull content.)

BR
Anders

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/03baf468-5705-4e19-99a8-612e286a22ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

aDNers
Hi,

Thanks alot, I didn't know about the wildcard option. Will play around with that! :)

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b0551a05-6146-4cce-b7ad-24462b96d809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

Mark Pitely
You can also use two variables in the url for the same structure; if your content has a 'phase' text/integer variable, you can use /{phase}/{title}
The url variables that are passed are essentially used as a query to find the specific content.
It depends on how much is changing between each phase and whether the p1 and p2 items can share the same structure.

Mark Pitely
Marywood University

On Mon, Aug 28, 2017 at 4:21 AM, aDNers <[hidden email]> wrote:
Hi,

Thanks alot, I didn't know about the wildcard option. Will play around with that! :)

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b0551a05-6146-4cce-b7ad-24462b96d809%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqNZvDPnb6ev8ve%3D45pormrDD2JyKuQbxuQ-eLzt5yrhSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

Xander
Hi Mark,

In your case you need 3 pieces of content, one for each phase. Otherwise the phase1 link will not work when the content is set to phase2.
Now that I think about it, it is not really logical to put the phase in the URL when all phases end up displaying the same content...

Kind regards,

Xander

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/18694f2b-f7b2-4341-a35c-bf1be7dea729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

Mark Pitely
Yes; you are correct. It depends on whether he needs specific content for each. If the phases are really just a ' time switch', that really shouldn't be handled via URL.
I mean, there has to be something different between phase1, 2 and 3 *content* otherwise I don't understand his question.
His one detail page could have that logic built into it. I.e. display on it 'This item is in Phase 1' if the item is set to 1, but all use the same URL.


M

On Mon, Aug 28, 2017 at 10:32 AM, Xander Steinmann <[hidden email]> wrote:
Hi Mark,

In your case you need 3 pieces of content, one for each phase. Otherwise the phase1 link will not work when the content is set to phase2.
Now that I think about it, it is not really logical to put the phase in the URL when all phases end up displaying the same content...

Kind regards,

Xander

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/18694f2b-f7b2-4341-a35c-bf1be7dea729%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqNA1FY7P7PaDc-%2Bx-S-QEk%3Dx8ijQPC78RTfwsV_pP0n5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Different URLmaps for same content with constant canonical

aDNers
Hello again ☺️
I was indeed able to use the wildcard match to solve my problem. Worked as expected 👍

Content is changed between each phase, but we need to have all 3 urls working at all times, redirecting to the active phase when the old one expires. The link to the pages ends up on lots of different places. (Which is also why it is important for us to have the canonical link in order.)

Just to explain:
Phase1 = application phase. Page includes a application survey.
Phase2 = test phase. Page includes blogs, posts from people taking part of the activity which they applied for in the first phase.
Phase3 = result phase.

(You can check how it works on smartson.se (Although in swedish). We are currently in the process of a cms migration and one request which ended up on my table was to reflect each phase also in the URL, moving forward.) Thanks for the ideas and follow up discussion.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3267566c-17c3-42cf-9411-4267f504a49f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.