By shartz on
I definitely want to modify the drupal theme, I am using zen.
For example, if I want to render link user/login, I think I should do:
Which render user/login with lightframe.
But the thing is, which file should I add this line into??? page.tpl.php??? Who is responsible generating the HTML file???
Comments
Options
Generating the HTML output of your site is really a collaborative effort between the Drupal system modules and the theme engine - the modules build the content, and then they get passed to the theme to be formatted with HTML. In the case of a link, it's very likely that the system is building the link as a data object - an array with 'text' ('Login'), 'path' ('user/login') and 'options' (another array that can be used to set link titles, rel attributes and so on) - and then passing it through to a theme function. This means you can either find some way to change the data (add the 'rel') to the data object before it gets themed, or modify the theme function so that it adds a 'rel="lightframe"' whenever the path is 'user/login'. (Note that the path will almost never be 'user/login' as that path is the default local task for 'user', so most 'user/login' links will output as 'user'.)
If your login link is in a menu you might be able to use hook_menu_link_alter in a module or theme_menu_link in a theme ...
On the other hand, if you just want to add a "Login" link to some arbitrary point on the page instead of modifying an existing one, you could just create a new block with your link code in it.
++Andy
Thanks very much for your
Thanks very much for your explaination. Now I understand it better. Let me try few things first:
1. if user/login is not in a menu system, if it is the user_login_block, I just need to work around to get it rendered by the attribute array.
2. if it is in menu system, use hook_menu_link_alter in a module or theme_menu_link in a theme ...
Many thanks!