Feature Proposal: Remove the link style of the "new topic" link from Render.pm
Motivation
It is impossible to override the colors of the "new topic" link (yellow background, blue text) in a style sheet, because the font attributes are wrapped around the
.twikiNewTopic style, and inside the style around the link.
In any case I am wondering why this is not left to a skin. I would prefer to loose the TWikiPreference settings
NEWTOPICFONTCOLOR and
NEWTOPICBGCOLOR altogether. We're living in the situation that appearance has to be changed in different places.
But with the current situation
can be improved by setting the colors to
.twikiNewTopic class in a template.
Description
When
Render.pm::_renderNonExistingWikiWord looses its color formatting, it would look like:
sub _renderNonExistingWikiWord {
my ($this, $theWeb, $theTopic, $theLinkText, $theAnchor) = @_;
my $ans = $theLinkText;
$ans .= CGI::a( { href=>$this->{session}->getScriptUrl
($theWeb, $theTopic, 'edit',
topicparent => $this->{session}->{webName}.'.'.
$this->{session}->{topicName} ),
rel => 'nofollow'
},
$this->{NEWLINKSYMBOL} );
return CGI::span( { class=>'twikiNewLink' },
$ans );
}
And in twiki.pattern.tmpl you would get (in the style part):
.twikiNewLink {
color:%NEWTOPICFONTCOLOR%;
background-color:%NEWTOPICBGCOLOR%;
}
Of course this should also be applied to other skin templates.
--
ArthurClemens - 16 Apr 2005
Discussion:
I support this proposal.
--
MartinCleaver - 16 Apr 2005
Just my 2 cents here, but shouldn't style be separated from content? Certainly out of Render.pm, but kept out of the templates as much as possible as well and into stylesheet?
--
BruceRProchnau - 16 Apr 2005
I agree.
--
ArthurClemens - 16 Apr 2005
Sounds good. I tried to remove explicit formatting wherever I found it, but I'm not style expert. There may be other places (e.g. RDiff.pm) where styles are not used but should be.
--
CrawfordCurrie - 17 Apr 2005
To make sure classic skin shows the links: normal span styles can be used for Netscape 4 (
http://www.nic.fi/~tapio1/Teaching/Netscape.php3
), but either we need a separate style definition in the templates, or a special way to import a css file so yet another css file (now only for Netscape 4) is needed. Not ideal.
My suggestion is that we add the style to the classic skin template, and for other skins put it in an external style sheet (for pattern skin: style.css).
--
ArthurClemens - 17 Apr 2005
Agreed
--
CrawfordCurrie - 18 Apr 2005
While we're at it, I suggest to add a link label "Create this topic" to the question mark link.
But while I'm adding title tags to buttons and links, something is gnawing. If fact these title tags should not be hardcoded in lib files, but should be read from language configuration files.
--
ArthurClemens - 22 Apr 2005
Implementation
I've committed this to
SVN (4080).
Classic skin template
twiki.tmpl now has a basic style. Tested this on Netscape 4.79. And the link has the title tag "Create this topic" (hardcoded in Render.pm).
Documentation
The appearance of links to new (not-yet-existing) topics is now set in
CSS style sheets.
The
TWikiPreferences variables
NEWTOPICFONTCOLOR and
NEWTOPICBGCOLOR are now deprecated - these are being supported only for classic skin. In classic skin template
twiki.tmpl the colors are set in the <style> block.
Skin authors: add the style
.twikiNewLink to your css files. To re-create the old (default) style:
.twikiNewLink {
background-color:#FFFFCE;
color:#0000FF;
}
--
ArthurClemens - 22 Apr 2005
There is something wrong with new topic links in an attachment table (DEVELOP). I get 3 question marks on a row:
If you look at the address of the first question mark, my name is trimmed to
ArthurClemen.
Update: seems to be something with that topic. In
SVN my name is now updated to
TWikiContributor, so no more strange question marks. Keep an eye on this.
--
ArthurClemens - 24 Apr 2005
Its partly a side effect of the suggest plurals as singular. It thinks neither the ArthurClemens nor
ArthurClemen topic exists so gives you the ability to create the singular (?) or plural (??).
Quite why it thinks it does not exist is another matter.
--
MartinCleaver - 24 Apr 2005
Are you aware that this singular<->plural is typically English? In another language looking for an 's' does not make sense.
Instead of this cryptic solution (and looking like a bug) I would suggest that we finally create the
NewTopicTemplate.
--
ArthurClemens - 24 Apr 2005
Plurals.pm applies different rules depending on the current language... I guess we need the People web to be different language (i.e. none) from Main (i.e. English).
--
MartinCleaver - 24 Apr 2005