[Pmwiki-users] layout based on source group
Patrick R. Michaud
pmichaud
Fri Sep 17 07:14:20 CDT 2004
On Fri, Sep 17, 2004 at 11:01:01AM +0200, Larry Baltz wrote:
> Hi,
>
> I think I may be stretching things a bit, but I would like to have
> links to profiles laid out a little differently than links to pages in
> other pmwiki groups. In particular, I'd like to have links to
> non-created profiles show up w/o any link "dressing" (i.e. no colour
> change, underline or question mark afterwards).
Is it sufficient to do it for just the {{~name}} style of Profile link,
or do you want/need it to be done for all links to the Profiles group--
i.e., even those where someone has written {{Profiles/Author Name}}
instead of {{~Author Name}}?
If it's sufficient doing just the {{~name}} style of links, then I think
you can do the following in config.php:
$DoubleBrackets['/{{~([[:alpha:]][-\\w\\s]*)}}/e'] =
"Keep(AuthorLink('$1'))";
function AuthorLink($name) {
global $AuthorGroup;
$k = FreeLink("\{\{$AuthorGroup/$name}}");
return FmtPageName("<a class='authorlink' href='\$PageUrl'>$name</a>",
$k['group'].'.'.$k['name']);
}
$HTMLHeaderFmt[] = "<style type='text/css'><!--
.authorlink { text-decoration:none; color:inherit; }
--></style>";
This has the advantage in that {{~author name}} generates links without
decorations, while leaving {{Profiles/author name}} available for
creating links with decorations.
If you really want it such that *any* link to the Profiles group is generated
without decoration, then yes it can be done without modifying pmwiki.php
but it's a little bit trickier. Let me know.
Pm
More information about the pmwiki-users
mailing list