Item12124: Pass class and id attributes to LOGIN and LOGOUT macros
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component:
Branches:
In order to get the generated link picked up by javascript, a class or id should be added to the link.
Change to LoginManager:
sub _LOGIN {
#my( $session, $params, $topic, $web ) = @_;
my $session = shift;
my $this = $session->getLoginManager();
return '' if $session->inContext('authenticated');
my $url = $this->loginUrl();
my $params = shift;
if ($url) {
my $text = $session->templates->expandTemplate('LOG_IN');
return CGI::a( { href => $url, $params->stringify() }, $text );
}
return '';
}
and so on.
Only caveat is using this method you cannot pass
data-xxx
values because Foswiki::Attrs does not handle hyphens well for this case.
--
ArthurClemens - 07 Oct 2012
Less trouble is to achieve this with a container element (span) to access the link.
This brings problems in CSS because accessor
> a
no longer works if a span is inbetween.
--
ArthurClemens - 07 Oct 2012
i don't understand, so I hope you do
--
SvenDowideit - 08 Nov 2012
The CSS hierarchy is sensitive to the container ordering. If you add a span, then the element order changes and the css attributes are missed.
--
GeorgeClark - 29 May 2014