[MGNLSTK-772] stkRedirect: uuidLink instead of link; redirect to first or last sub-page Created: 04/May/11  Updated: 29/Aug/11  Resolved: 19/Aug/11

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: None
Affects Version/s: 1.4.1
Fix Version/s: 1.4.5

Type: Improvement Priority: Neutral
Reporter: Will Scheidegger Assignee: Christian Ringele
Resolution: Fixed Votes: 0
Labels: redirect, sub-page, uuid
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Attachments: Zip Archive STK-overworked-redirect-template-CRingele.zip     Text File redirect_template.patch     Text File stkRedirect_improvements.patch    
Issue Links:
relation
is related to MGNLSTK-790 RedirectTemplate should provide a uui... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

A) If a user renames a page or a path segment of a redirect target, the redirect will fail afterwards. Therefore one should change the redirect mechanism from path to uuid.

B) Often you want to redirect to the first (and seldom to the last) sub-page instead of redirecting to a fixed target, e.g. if you want to redirect to the latest press release which is always added at the top or the bottom of the list of sub-pages.

The attached patch includes both improvements. I hope you will find this useful and will integrate it in the next release of STK.



 Comments   
Comment by Philipp Bärfuss [ 05/May/11 ]

Thanks, we will have a look at your proposal/patch. At the first glance it makes a lot of sense.

Comment by Christian Ringele [ 05/May/11 ]

I think these are great improvements, thought of similar my self.
But I think uudLink and link-by-path should co-exists.
I can think of both use cases. Somthimes when moing pages, you still want to redirect to the same path (replacing pages for example).
I think best behavior would be:

  • uuidLink control
  • link control
    • usually only one of them are defined, if both -> uuidLink is master, if uuid can't be resolved fallback to path
  • if non of the links are defined, it redirects automatically to the first child pages.
  • probably a option that it automatically redirects to the last child page (as Ueli suggested/implemented)

I was working on something similiar, but was not finished yet completely (only redirect adaption in model missing).
If focused a bit on that the author gets good messages in the edit mode, on what will happen on preview/public mode (template adaptions). I add the patch to the ticket, probably its of some help too.

Comment by Will Scheidegger [ 05/May/11 ]

I see the argument about replacing a page but have not encountered that IRL myself. However I wonder how the dialog for the user for such a path / uuid co-existance would look like? Both the link control and the uuidLink control look exactly the same. Most likely you would have to do quite a bit of explaining for the user to understand how to use this properly.

Comment by Christian Ringele [ 22/Jul/11 ]

In a minor release we can't path control from 'link' to 'uuidLink'.
Even on a major version I would not tend to change that because strict path behavior could be wanted out of reason described above.

I added some new functionality which do not contradict binary&content compatibility:

  • Redirect to first child if path is not defined.
  • No need to define 'http://' & 'http://' for external URL.
  • If Path is invalid:
    On Author:
  • Warn messages are rendered in author and preview mode
    On Public:
  • Redirect is done, so 404 is returned for handling 404 (was skipping rendering at all).
  • If no child page exists on empty path property:
    On Author:
  • Warn messages are rendered in author and preview mode
    On Public:
  • Redirect page itself return 404 error code
  • Ass messages are i18nized
Comment by Christian Ringele [ 18/Aug/11 ]

Rendering test is added.
Created new issue what could not be implemented within a minor version: MGNLSTK-790

Comment by Jan Haderka [ 19/Aug/11 ]

Too late for now, but next time separate formatting changes from functional changes and commit separately with appropriate commit message (or do not reformat at all). Together functional change is much harder to see.

Now for reopening:

  • There's typo in the VersionHandler: "new RemovePropertyTask("Remove 'required' proeprty", ..."
  • also can you explain why you need cache as a test dependency? I fail to see it used in files within the same commit.
Comment by Christian Ringele [ 19/Aug/11 ]

Yes, next time I'll separate the two commits (formatting).

Typo corrected.

Cache removed: To be honest, I have no clue why I added it at this time. Seems then as it failed of missing cache, which is not true.

Comment by Boris Kraft [ 29/Aug/11 ]

Why can't we change the behavior of the redirect template in a minor release?

But to the point: the whole behavior of renaming pages and moving pages is by default such that it works. It should work exactly the same for redirects, and even for the URIredirectMappings. COnsistency is paramount! We keep running into issues because somebody "forgets" that parts of the system work differently.

@Christian: your suggestion to offer both options (part and UUID) make things more complicated for the users, as now they need to remember which choice they made. This is the wrong direction.

INstead we will need to think about how the use case you describe can be handled in the future, specifically M5. My only idea so far is to introduce a "replace" action in the UI that allows to replace one page with an other, and by doing so would update all the uuid links. This could be part of the refactoring functionality I would like to see in Magnolia.

Generated at Mon Feb 12 07:30:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.