[pmwiki-users] How to apply data-rel to an anchor?

Petko Yotov 5ko at 5ko.fr
Fri Feb 3 02:32:49 CST 2012


You need the following code in config.php :

  $WikiStyleAttr['data-rel'] = 'a';
  $WikiStyle['jqdl']['data-rel'] = 'dialog';

Then you can use %jqdl%[[link]]%%  or  %data-rel:dialog%[[link]]%%
to produce a link with an attribute  data-rel="dialog".

Petko

On Thursday 02 February 2012 11:41:28, Martin Kerz wrote :
> Okay, by adding
> 
> $WikiStyleCSS[] = 'data-rel';
> $WikiStyleApply['a'] = 'a';
> 
> I get it to appear, but it is embedded in a style attribute, i.e., I now
> have:
> 
> <a class="wikilink" style="data-rel: dialog;"
> href="/Wiki/PageActionsDialog1">This Page</a>
> 
> Am I on the right track?
> 
> Thanks a lot in advance!
> 
> Martin
> 
> Am 01.02.2012 um 21:44 schrieb Martin Kerz:
> > Hi there,
> > 
> > I try to apply a data-rel attribute to an anchor tag. I did the following
> > in a custommarkup.php file
> > 
> > SDV($WikiStyle['jqdialoglink'], array('data-rel'=>'dialog',
> > 'apply'=>'a'));
> > 
> > And tried the following syntax on my page:
> > 
> > * %jqdialoglink%[[PageActionsDialog1|This Page ]]%%
> > 
> > What I want to achieve is something like this:
> > 
> > <a class="wikilink" data-rel="dialog"
> > href="/Wiki/PageActionsDialog1">This Page</a>
> > 
> > Unfortunately, the data-rel="dialog" isn't showing up. What am I missing
> > here?
> > 
> > Thanks, as always, for your help!



More information about the pmwiki-users mailing list