Item353: Display users as something other than broken links
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
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 -
- the mapper should not really be coding the html - except perhaps via a tmpl file
- using css classes for each of webName, topicExists (or not) and thisIsAUserName will allow more informative offloading of some of the rendering conditionals
- 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