[pmwiki-users] Re: View action not active

H. Fox haganfox at users.sourceforge.net
Thu Sep 15 08:32:03 CDT 2005


My dislike of self-referencing links is no secret.  :-)

On 9/14/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Wed, Sep 14, 2005 at 01:16:34PM -0500, Patrick R. Michaud wrote:
> >
> > And we have to ask if there are other factors besides actions that
> > need to be tested as well ...
> > I think I can add a capability to truly detect self-links, as long
> > as we can decide with some degree of precision what constitutes a
> > "real" self-link.
> 
> To better understand my comment, here's a "real-world" example
> that we may be able to use for discussion.
> 
> If I go to http://www.pmwiki.org/wiki/Test/Tabs, then many people
> will claim that the "View" action references the current page, and
> therefore should not generate a link back to the current page.
> No problem, I can understand that.
> 
> Clicking on the "Edit" tab takes me to
> http://www.pmwiki.org/wiki/Test/Tabs?action=edit.  Now then, the
> "View" tab goes to somewhere "different", and so it should not be
> a link.  Okay, but how about the "Edit" tab?  Is it to be considered
> a self-reference and not turned into a link (like the "View" tab was
> when we viewed the page), or should it remain a link?

IMHO the edit link should not remain a link in the Edit Page.

> If you answer that "Edit" should not be a link here, then what do we
> do with something like the following, where the author is creating a
> new page from a template?
> 
>   http://www.pmwiki.org/wiki/Test/Foo?action=edit&template=Cookbook.Template
> 
> Now then, should the "Edit" action generate a link?  Note that the Edit
> action actually causes something different to happen from the current
> page.

For this one, I'd say it's not materially different.  In the
(extremely) rare instance where someone would want to go from

   http://www.pmwiki.org/wiki/Test/Foo?action=edit&template=Cookbook.Template

to

   http://www.pmwiki.org/wiki/Test/Foo?action=edit

they could click View (or Cancel), then Edit.  IMHO that's not very confusing.

Thinking about it, that might even be closer to the "expected
behavior", perhaps depending upon whether the editor knows the
template has been explicitly set in the query string.

> I see at least two answers to the above (I suspect and hope there
> are others):
>   1. Compare all values of the url to determine if a link is a
>      self-reference.
>   2. Only compare page names and actions to determine if a link is a
>      self-reference.
> 
> I see advantages and disadvantages to both of the above.  If we
> compare entire urls (#1), then many things that people will claim
> are "self-references" won't be because of small differences in the url.
> 
> If we compare only page names and actions (#2), then a url that actually
> results in a different view of the page (e.g., in things such as
> breakpage and search) can easily be treated as a self-reference (and thus
> not a link) when it arguably shouldn't be.  This becomes particularly
> tricky when considering links like:
> 
>    [[{$Name}]]
>    [[{$Name}?skin=light]]
>    [[{$Name}?setview=admin]]
> 
> All three of the above markups generate what #2 would consider
> to be self-referencing links (i.e., they link to the current
> page with $action == 'browse'), but clearly we still want these
> "self-referencing links" to continue to be displayed as such.

Not quite, but I get your point.  It would be true if

   [[{$Name}?setview=admin]]

were

   [[{$Name}?view=admin]]

because with setview= the self-referencing ling does in fact refer to
an identical page.

Even with view= and skin= I don't think the inactive or missing "View"
(browse)  link is harmful.  This is based on experience...

A while back I started using method #2 (check $action) in the Light
Skin.  Currently it uses CSS (display:none;) to suppress the
self-referring link.  IMHO it works fine so far.

http://www.pmwiki.org/wiki/Cookbook/LightSkin
http://www.pmwiki.org/wiki/Cookbook/LightSkin?action=edit
http://www.pmwiki.org/wiki/Cookbook/LightSkin?action=diff
http://www.pmwiki.org/wiki/Cookbook/LightSkin?action=upload

Hagan




More information about the pmwiki-users mailing list