I have created a block that would have direct links to view and manage RSVPs for a user. I've filtered this link in the body as Full HTML but it omits the PHP open and close and prints pure text of the code. I then filtered as PHP code, but link does not print. What is the correct print code snipet to show the link?

What am I missing to print the link in the block body field? Here's what I coded in the block:
<a href="/?q='user/'. $user->uid .'/rsvp/manage'>View Event RSVPs</a>

Thanks
Drupalgirl

Comments

owahab’s picture

Component: User interface » Miscellaneous
Status: Active » Fixed

Just for your info: this has nothing to do with RSVP, you need to read about coding for Drupal.
Anyways, you simply didn't output anything, use echo or print to have PHP outputs your string.
For example:

<?php
global $user;
echo '<a href="/?q=user/'. $user->uid .'/rsvp/manage">View Event RSVPs</a>';
?>

The Drupal equivalent for the above code and which is by far better to use:

<?php
global $user;
echo l(t('View Event RSVPs'), 'user/'. $user->uid .'/rsvp/manage');
?>
drupalgirl’s picture

Thanks so much for the coding tip! That was a quick response. Hope this is helpful to others.

owahab’s picture

Status: Fixed » Closed (fixed)