Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
Print - Formatting of links / print.css
HaJo #1
Member since Jan 2013 · 2 posts · Location: DE
Group memberships: Members
Show profile · Link to this post
Subject: Print - Formatting of links / print.css
I have a freshly installed DokuWiki, with only the standard dokuwiki-template.

When printing a page, external links are output twice, e.g. see the
print-preview of https://www.dokuwiki.org/plugin:data, footnote 2.

I would like to fix that, so that a link gets printed only once.
Looking thru print.css, I couldn't find how/where this behavior
is specified.  Can someone give me a pointer ?

Also, I would like to use a black-and-white version of the logo when printing.

Edit:
I just noticed another quirk in the print-style:
some text in a field of a table is right-aligned,
but on the print, it gets left-aligned.
--HaJo
This post was edited on 2013-01-30, 04:46 by HaJo.
Avatar
ach (Administrator) #2
Member since May 2006 · 1921 posts · Location: Folkestone, UK
Group memberships: Administrators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by HaJo on 2013-01-28, 15:52:
When printing a page, external links are output twice
That's not quite true. They are only twice when the link text is the same as the URL. It is generally good practice to give links a text.

Quote by HaJo on 2013-01-28, 15:52:
I would like to fix that, so that a link gets printed only once.
Looking thru print.css, I couldn't find how/where this behavior
is specified.

That's done in the block. Just delete those lines if you want to get rid of that behaviour:

  1. /* display href after link */
  2. a.urlextern:after,
  3. a.interwiki:after,
  4. a.mail:after {
  5.    content: " [" attr(href) "]";
  6.    font-size: 90%;
  7. }

Quote by HaJo on 2013-01-28, 15:52:
I just noticed another quirk in the print-style:
some text in a field of a table is right-aligned,
but on the print, it gets left-aligned.

That's a bug. Can you please report it in the bugtracker?
Avatar
ach (Administrator) #3
Member since May 2006 · 1921 posts · Location: Folkestone, UK
Group memberships: Administrators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by ach on 2013-02-02, 12:56:
Quote by HaJo on 2013-01-28, 15:52:
I just noticed another quirk in the print-style:
some text in a field of a table is right-aligned,
but on the print, it gets left-aligned.

That's a bug. Can you please report it in the bugtracker?

Just done that: https://bugs.dokuwiki.org/index.php?do=details&task_id…
Avatar
Flominator #4
Member since Feb 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
Moin,

this approach worked for me, until I updated from Frusterick Manners to Greebo (2018-04-22b). Now the external and interwiki links are back in the print view :(

Did something get overwritten by the update or did Greebo change anything in this direction?

Thanks
Flo
Avatar
Flominator #5
Member since Feb 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
I should not read instructions in the middle of the night: I didn't recognize that one had to actually hide this part. It works now:

     display href after link
    a.urlextern:after,
    a.interwiki:after,
    a.mail:after {
       display: none;
    }
Avatar
ach (Administrator) #6
Member since May 2006 · 1921 posts · Location: Folkestone, UK
Group memberships: Administrators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
Changes to existing files will get overwritten with updates. The best way is to create your own userstyle and add this:

  1. /* remove generated content from links */
  2. a.urlextern:after,
  3. a.interwiki:after,
  4. a.mail:after {
  5.    content: "";
  6. }

That will survive any updates.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-07-23, 00:56:28 (UTC +02:00)