I have a problem with the links at the bottom of a node ("add new comment" etc. - I'm not sure if these links have a certain name).
When the last bit of content in a node is floated, the links wrap up around the floated elements instead of being "cleared" and staying below the node content. I noticed that the ul containing the links has the classes "links" and "inline". If I manually remove the "inline" class then the links behave as desired.
Where does the class "inline" get added to this list of links and what is the best way to remove it on all nodes?
Hello John, in Drupal 6 the inline value is applied to the "ul.links.inline" style rule located in "drupal/modules/system/system-menus.css". To get rid of the behavior of the links wrapping around the content you can try adding <br style="clear:both;"> as the last line of the content class inside the node.tpl.php file.
For example:
<div class="content"> <?php print $content; ?> <br style="clear:both;"> <!-- Insert br style rule here --> <div>
<?php if ($links): ?> <div class="links"> ...
2008/7/11 John Fletcher net@twoedged.org:
I have a problem with the links at the bottom of a node ("add new comment" etc. – I'm not sure if these links have a certain name).
When the last bit of content in a node is floated, the links wrap up around the floated elements instead of being "cleared" and staying below the node content. I noticed that the ul containing the links has the classes "links" and "inline". If I manually remove the "inline" class then the links behave as desired.
Where does the class "inline" get added to this list of links and what is the best way to remove it on all nodes?
-- [ Drupal support list | http://lists.drupal.org/ ]
Thanks Jeremy,
That is certainly a valid idea, and if I don't come up with anything else I will have to do that. I have about 8 content type templates and I could put that into each of them.
However that seems a little bit "hacky". Is there not a "better way" - removing the class from the <ul>? When I asked where the "inline" class comes from I meant: which piece of code adds the "inline" class so that it prints <ul class="links inline"> instead of <ul class="links">? I know theme_links does this but it just prints the arguments that it is given... how does it get those arguments...?
Thanks, John
-----Original Message----- From: Jérémie D'Aoust [mailto:jeremiedaoust@gmail.com]
Hello John, in Drupal 6 the inline value is applied to the "ul.links.inline" style rule located in "drupal/modules/system/system-menus.css". To get rid of the behavior of the links wrapping around the content you can try adding <br style="clear:both;"> as the last line of the content class inside the node.tpl.php file.
On Fri, Jul 11, 2008 at 6:56 PM, John Fletcher net@twoedged.org wrote: [snip]
However that seems a little bit "hacky". Is there not a "better way" - removing the class from the <ul>? When I asked where the "inline" class comes from I meant: which piece of code adds the "inline" class so that it prints <ul class="links inline"> instead of <ul class="links">? I know theme_links does this but it just prints the arguments that it is given... how does it get those arguments...?
If I'm following you correctly, and I'm not sure I am, you're wanting to know where the value of the $links variable is assigned for node templates. If I'm wrong, ignore the rest of this! :-)
In Drupal 5 the $links variable is assigned a value in phptemplate.engine (/themes/engines/phptemplate/phptemplate.engine), in the phptemplate_node function: $variables = array( [snip] 'links' => $node->links ? theme('links', $node->links, array('class' => 'links inline')) : '', [snip] );
You can override this value for all template files in the _phptemplate_variables function of your theme's template.php file with something like (I haven't tested this):
function _phptemplate_variables($hook, $vars = array()) { switch ($hook) { case 'node': $vars['links'] = $vars['node']->links ? theme('links', $vars['node']->links, array('class' => 'links')) : '' break; } return $vars; }
Some additional info: http://drupal.org/node/16383 http://www.group42.ca/take_control_your_phptemplate_variables
Thanks a lot Dale,
I'm using D6 but with a little modification this worked perfectly. This is exactly what I was looking for - the sort of "clean way" to do it.
Regards, John
-----Original Message----- From: Dale McGladdery Sent: Saturday, 12 July 2008 8:22 AM To: support@drupal.org Subject: Re: [support] Remove inline class from node links
[snip]
However that seems a little bit "hacky". Is there not a "better way" - removing the class from the <ul>? When I asked where the "inline" class comes from I meant: which piece of code adds the "inline" class so that it prints <ul class="links inline"> instead of <ul class="links">? I know theme_links does this but it just prints the arguments that it is given... how does it get those arguments...?
If I'm following you correctly, and I'm not sure I am, you're wanting to know where the value of the $links variable is assigned for node templates. If I'm wrong, ignore the rest of this! :-)
In Drupal 5 the $links variable is assigned a value in phptemplate.engine (/themes/engines/phptemplate/phptemplate.engine), in the phptemplate_node function: $variables = array( [snip] 'links' => $node->links ? theme('links', $node->links, array('class' => 'links inline')) : '', [snip] );
You can override this value for all template files in the _phptemplate_variables function of your theme's template.php file with something like (I haven't tested this):
function _phptemplate_variables($hook, $vars = array()) { switch ($hook) { case 'node': $vars['links'] = $vars['node']->links ? theme('links', $vars['node']->links, array('class' => 'links')) : '' break; } return $vars; }
Some additional info: http://drupal.org/node/16383 http://www.group42.ca/take_control_your_phptemplate_variables