Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
One thing I realised when coding the weblinks module is that the option of adding target="_blank" to the link is missing.
Comments
Comment #1
ax CreditAttribution: ax commentedi think there should be added not only the "target" attribute, but a general purpose (array of) attributes parameter. which could be called like
l("linktext",
$args,
array(
"title" => "the title"
, "target" => "_blank"
, "name" => "an_anchor"
//, "class" => "a-css-class"
//, "style" => "text-decoration: none; "
// there are 30 more attributes possible for <a> ;)
),
$script)
)
implementation is straightforward (should i provide a patch?)
where is the <pre> allowed html tag?!
Comment #2
barryorourke CreditAttribution: barryorourke commentedshould i provide a patch?
If you have the time, it would be apprieciated.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedas ax suggested, l(), la(), and lm() now accept an associative array called $attribs which will be used as attributes in the tag.
Comment #4
barryorourke CreditAttribution: barryorourke commentedClosed.