Hi.

I'd like to have a link on my frontpage pointing the user into his/hers notification settings:

http://domain.com/user/2/notify

How can I get a hold on the user-id (2) to create this 'dynamic' url?

Comments

csc4’s picture

I think the only ways are with code or you might like to look at the Me module which allows you to alias links like these

dafa’s picture

'Me module' is exactly what I want.

Thanks alot.

--
dafa

mfer’s picture

This is fairly easy to do. Do something like....

<?php if ($user->uid) { ?><a href="http://example.com/user/<?php global $user; print $user->uid; ?>/notify">Some Text</a><?php } ?>

This should only display the link when logged in and put the uid in the url when it's displayed. Just throw this in your tpl.php file.

--
Matt
http://www.mattfarina.com