"only in print" template for images requires a matching "hide in print" template

30 views
Skip to first unread message

Michael Kennard

unread,
Feb 28, 2012, 1:08:17 PM2/28/12
to mwlib
I'm trying to use the "only in print" template for an image but the
image does not appear in the PDF. I created a simple book on Wikipedia
that demonstrates this <http://en.wikipedia.org/wiki/User:Unjedai/
Books/Hide_in_print_test2>

If I also include a "hide in print" template using the same image,
then the "only in print" template starts working and the image appears
in the PDF. Of course, the image also appears in the browser due to
the "hide in print" template and that's no good. Here's another simple
book on Wikipedia that demonstrates this <http://en.wikipedia.org/wiki/
User:Unjedai/Books/Hide_in_print_test>.

Volker Haas

unread,
Feb 29, 2012, 5:15:12 AM2/29/12
to mw...@googlegroups.com
The "Only in print" template only works for text (check [1]). The
problem is that the image is not fetched and therefore can not be
included in the PDF. My Mediawiki templating skills aren't sufficient to
fix the problem. I imagine that the solution might be to not completely
exclude the content in the wiki, but to set the css property display:none.

Currently the Mediawiki API call that lists all images for an article
probably omits the image in question. This might be fixed by the css
workaround.


[1]
http://en.wikipedia.org/w/index.php?title=User:Volker.haas/Test&oldid=479447008

--
Volker Haas
Senior Developer
brainbot technologies ag
Boppstra�e 64
55118 Mainz
Phone: +49 (0)6131 2116394

Message has been deleted

kelvin

unread,
Mar 1, 2012, 6:32:57 PM3/1/12
to mw...@googlegroups.com
This method worked a few weeks ago, even with the images.  I formatted an entire book (PDF) like this.  It may have stopped working after an update or something similar.

Boppstra�e 64

Reply all
Reply to author
Forward
0 new messages