Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've disabled the default link locations ("Links area" and "Content container"). Instead, I enabled the Block, so I could put it in one of the custom regions of my theme.
Unfortunately, if I do this, the various versions (printer, email, PDF) all have <br />
tabs between them.
It appears that the module uses a Block hook that cannot be overridden in the theme...? Is there any way to get rid of the break tags, so that I can display the text/icons side by side?
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedHi,
I will try to see if I can remove the line breaks and make them happen via CSS.
In the meantime, a very simple fix to your problem would be to define your own block, inserting the same PHP code as can be found for the view operation in the print_block() function in the print.module file.
João
Comment #2
Karlheinz CreditAttribution: Karlheinz commentedTrue, I could do that.
What I ended up doing was opening up print.module and change line 169 from this:
$block['content'] .= $link .'<br />';
..to this:
$block['content'] .= $link;
Unfortunately that breaks module updates.
The links are already wrapped in
<span>
tags, so I'm not even sure why the break tags are there in the first place. I would suggest getting rid of the<br />
and<span>
tags, and wrapping them in<div>
tags instead. That way you wouldn't break anyone's existing layouts (<div>
tags display as a block by default), but people could still put them inline via CSS if they wanted.That's up to you of course.
Comment #3
jcnventura CreditAttribution: jcnventura commentedThat span is created by the generic-link generator, if I turned it into a div, the non-block links would also be changed. What I am going to do is to turn that span into a div via CSS only for the block links.
Comment #4
jcnventura CreditAttribution: jcnventura commentedJust committed the code.. Next time you update the module you'll have to delete a line in the css/printlinks.css to keep the links in a single line or override the new style in your own CSS file.
João