You are here: Foswiki>Tasks Web>Item353 (20 Jun 2015, CrawfordCurrie)Edit Attach

Item353: Display users as something other than broken links

pencil
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiRender
Branches:
Reported By: Foswiki:Main.CrawfordCurrie
Waiting For:
Last Change By: CrawfordCurrie
Index: pub/System/SkinTemplates/base.css
===================================================================
--- pub/System/SkinTemplates/base.css   (revision 1077)
+++ pub/System/SkinTemplates/base.css   (working copy)
@@ -71,3 +71,6 @@
    margin:0 -0.5em 2em -0.5em;
    padding:.5em;
 }
+.foswikiUserName { 
+   color: #66f;
+}
Index: lib/Foswiki/Render.pm
===================================================================
--- lib/Foswiki/Render.pm   (revision 1077)
+++ lib/Foswiki/Render.pm   (working copy)
@@ -656,8 +656,18 @@
         return _renderExistingWikiWord( $this, $theWeb, $theTopic, $theLinkText,
             $theAnchor );
     }
+
     if ($doLinkToMissingPages) {
-
+        # If this is a reference to a valid user wikiname, then be
+        # a bit smarter about presentation, don't just invite creation
+        # of a user page.
+        if ($theWeb eq $Foswiki::cfg{UsersWebName}) {
+            my $cUID = $this->{session}->{users}->getCanonicalUserID(
+                $theTopic );
+            if (defined $cUID) {
+                return CGI::span({class => 'foswikiUserName'}, $theTopic);
+            }
+        }
         # CDot: disabled until SuggestSingularNotPlural is resolved
         # if ($singular && $singular ne $theTopic) {
         #     #unshift( @topics, $singular);


Note, this patch does not yet solve the real issue at hand as described in DIsplayBrokenuserLinksBetter, i.e. it only supresses "create new topic" links instead of pointing to a page to allow to check the audit trail. It should either point to a users home topic, or to another default page that is able to display the users' account record.

-- MichaelDaum - 01 Dec 2008

Better patch that addresses those concerns attached, but no unit tests yet.

-- CrawfordCurrie - 01 Dec 2008

I'm bothered by the way the patch confuses the concerns of the different codebases, mixing up abstractions. I have a couple of ideas, that I'll flesh out more post conference, and to remind me -
  1. the mapper should not really be coding the html - except perhaps via a tmpl file
  2. using css classes for each of webName, topicExists (or not) and thisIsAUserName will allow more informative offloading of some of the rendering conditionals
  3. there is a need for a DISPLAYNAME tag - something that can avoid the problems of hardcoding [ brackets into the skins and SEARCH's as we do now - that may be what the mapper should output

there was more - but i was thinking about it as i was coming home from the googlehackday

See DisplayBrokenLinksBetter


Does this task still apply? FindElsewherePlugin does a good job of resolving links to the Main web, as used on Foswiki.org.

-- GeorgeClark - 15 Mar 2011

Yes, it still applies. FindElsewherePlugin works well if you have a topic per user; but on many corporate installs, users are only identified through the user mapping manager, and the use of personal topics is patchy or actively discouraged. However Sven's points are all good, and I'd like to hear more about his ideas (if he can still remember what they were) so marking for his feedback.

-- CrawfordCurrie - 26 Mar 2011

Too far out of date to be worth keeping.

-- Main.CrawfordCurrie - 20 Jun 2015 - 08:21

ItemTemplate edit

Summary Display users as something other than broken links
ReportedBy Foswiki:Main.CrawfordCurrie
Codebase
SVN Range SVN 1079: Foswiki-0.9.0, Sun, 30 Nov 2008, build 1078
AppliesTo Engine
Component FoswikiRender
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
I Attachment Action Size Date Who Comment
Item353.diffdiff Item353.diff manage 6 K 01 Dec 2008 - 13:31 CrawfordCurrie  
Topic revision: r8 - 20 Jun 2015, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy