1

I am trying to modify a module.

I have two variables: let say $date = "mydate" and $title = "mytitle"

I have for the moment a theming function that creates a link by doing something like this:

$vars['row_dates'][$i] = l( $date, '', array('fragment' => $vars['timelinr_dates_id'] . '_' . $i, 'external' => TRUE));   

which output a result like: mydate

I would like now to output something like:

<a href="...">
    <h2>mydate</h2>
    <h1>mytitle</h1>
</a>

the problem is that if I do:

$date = "<h2>mydate</h2>";
$title = "<h1>mytitle</h1>"

then the markups are outputed like text Is there a way to acheive it ?

0

You need to set the html-Option of l() to true:

l( $date, '', array(
  'fragment' => $vars['timelinr_dates_id'] . '_' . $i, 
  'external' => TRUE, 
  'html' => TRUE
)); 

Otherwise all html-tags get escaped by l().

  • super! thanx Nebel54 ! – matt Dec 9 '13 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.