#126: Link type should automatically redirect when accessed directly

Contents
  1. Motivation
  2. Proposal
  3. Implementation
  4. Deliverables
  5. Risks
  6. Progress log
  7. Participants
by Alex Limi last modified Jan 21, 2010 07:26 AM

Links should be capable of doing automatic redirection.

Proposed by
Alexander Limi
Seconded by
David Glick
Proposal type
Architecture
Assigned to release
Repository branch
plip126-link-redirects
State
completed

Motivation

Currently, the Plone standard "link" content type is handled correctly in navigation, such that if you have permission to edit the link, you will go to the actual link object, but if you don't have permission, you will go to the link's target. However, if you access the link directly while logged out, it does not redirect to the target.

Adding this functionality is simple and is useful for cases where there is a desire for a short URL that redirects to something buried deep in a site.

Proposal

The link type should be extended with the following ability:

  • Automatic redirection - when you can edit the object, it doesn't do this, though - like with File/Link objects in the current listings, it goes/acts directly on the object if you don't have the permissions to edit it, and goes to the view page if you have editing permissions

(Note: A previous revision of this PLIP also talked about making Links pop up in a new window, which is already an option in Plone 3. Some of the comments of this PLIP refer to that obsolete part of the proposal.)

Implementation

This can be done rather simply by changing the default Link view to the script appearing in the final comment on http://plone.org/documentation/how-to/repurpose-link-object

Deliverables

- Code: New default link view in CMFPlone plone_content skin layer.

- Documentation: http://plone.org/documentation/how-to/repurpose-link-object should be updated.

Risks

None, as far as I can see.  The old default link_view is still used when the link is actually accessed (e.g. if user has permission to edit it).

Progress log

 This PLIP has been implemented on branches and can be reviewed using this buildout: http://svn.plone.org/svn/plone/review/plip126-link-redirects.

See http://svn.plone.org/svn/plone/review/plip126-link-redirects/PLIP_126_README.txt for a detailed summary of the changes.

Participants

David Glick, with assistance from Andrew Burkhalter

Comments (11)

Jon Stahl Apr 07, 2006 04:25 AM
Alexander-

While I agree that forcing new windows is *mostly* evil, most of the time, and that it might be less evil in an intranet situation, a lot of smaller sites will have both public & private/intranet spaces on the same server. So, I'm not sure as site-wide setting is the best way to go.

I think that maybe, just maybe, there should be per-object control over whether a link opens in a new window.

Maybe some strong words of warning against new window links in the UI?

/me ducks ;-)
Jon Stahl Apr 07, 2006 04:29 AM
One common request I get from our site admins is "how can I put a link in the navigation that points to another place on our site?"

I think I've seen this referred to as "symlinking."

It would be really nice if the Link type could also support this. It would make it easier to build very flexible navigation schemes.
Sleepy Jackson Jun 20, 2006 03:19 AM
I have just this second had a user describe their frustration at having to type in a full URL to create a link to a document somewhere else in the system. For this reason I can see it would be really useful for the link type to have a facility - much like the internal link feature in Kupu - that enables users to browse to the object they wish to link to.

I'm also suprised that in Plone (2.5) you can create an external link with an address which omits the http:// prefix without receiving a warning message, only to find after the link is created it doesn't work.
Alex Limi Jun 20, 2006 04:24 AM
That's what this PLIP is about; making the link type better. :)
Sleepy Jackson Jun 20, 2006 04:37 AM
I have outlined clearly two limitations of the current link type that as a user I would hope will be addressed by this Improvement. If that's not in the spirit of making the link type better then please enlighten me.
Jon Stahl Jan 04, 2007 03:54 AM
He's just explaining the backstory to *why* Plone behaves in this (now obviously suboptimal) way. Your suggestion is most definitely in keeping with the spirit of this PLIP.

In fact, I think it's a great suggestion -- I ran into this frustration with a client just today.

My only question is about the feasibility of having two widgets (string field for external URLs + reference browser for internal links) that both feed a single field. There's probably some clever way around this though.
Martijn Pieters Oct 26, 2008 04:57 PM
+1
Danny Bloemendaal Oct 27, 2008 03:08 PM
+1 when my remarks are concidered (http://lists.plone.org/[…]/002220.html)
Andreas Zeidler Oct 27, 2008 04:30 PM
+1, provided this will be implemented as optional, configurable behaviour. a site-wide setting (in "site_properties" for GS support and an easy addtion to "site setup") could be the default, and individual "Link" content could perhaps be able to override this in addition.
Tom Lazar Oct 28, 2008 10:48 AM
+1 provided the configurable behaviour and that the default remains with the current handling (less suprises, more optional features!)
Andreas Zeidler Jan 25, 2009 11:55 PM