I want to grant printer-friendly pages to some (authenticated) users only, but not to anonymous visitors. I've entered access control settings (access print) as desired, but links are still displayed to anonymous users as well. When one clicks to such link, access denied message comes up, and the warning is logged. I believe such a solution doesn't look well in all of the aspects (visitor is confused, site doesn't look professional, logs are filled without anything actually being wrong...).
I suggest links to be displayed only to users, which are granted to access such generated pages. Maybe a nice feature would also be to have a choice weather to display a link as text or as the small print image (settings through administration page)? Such images are sometimes positioned in an upper right corner, what I find very useful (no need to scroll down each time, if I want to make printouts of some consecutive pages for instance) - so, if there would also be an option to easily select the position of such image (a few options to choose between), I would find this module almost perfect...
Besides, a book print includes all child objects. A setting to select weather to print out the whole content, as it is done now, or to print out only actually displayed content, would also be quite convenient to me (many child nodes are making such printouts extremely large). But I am not sure weather this is to be addressed here, or at the book module...
Comments
Comment #1
jcnventuraHello,
I can't seem to reproduce the problem, so I would like to know a bit more about it. Specifically, what type of nodes are we talking about..
In my website, if I disable access print to anonymous users, (using version 3.0 and older) of the module, the link no longer appears (both for content and non-content pages).
As to the position of the link, you will have to do this yourself.. You have to disable the link and place it by creating a block or something so that it is positioned where you need it (see the FAQ #8 at http://drupal.org/node/190173). You can see a deployment like this at: http://www.rakemag.com/
The image question is #3 in the FAQ.
Regarding book node links, this module only assumes control of them. The display of the link in book nodes is controlled by the book module settings and the output of the content is generated by the book module. The only difference is that once the page is generated, all the headers, footers, styles and URL list are inserted by the print module.
Regards,
Joao Ventura
BTW: Can I ask you for a Slovenian translation of the module? You just have to translate all the string in po/print.pot and send them to me.. I will include it in the next release.
Comment #2
luti commentedHi,
I've tried again (this time 3.0 with Drupal 5.5), and it seems to work OK now (no printer-friendly links for anonymous users). Unfortunately, I've forgotten which URLs exactly were a problem. If I find such links, i will try to be more precise, but I am quite sure it was a book (or, maybe a page).
Thank you for the link to FAQ; I've tried to add (to a unfiltered HTML type page) as suggested there:
but nothing appears (I suspect the function is not known there...). If I add a hardcoded link directly as a HTML code, it is there, but I can not control which users see it and which do not (according to their roles).
For the moment, I have translated only what was really necessary for visitors of my site to navigate (in fact, I've entered the phrases as needed at my site - which sometimes are not direct translations...), the admin part is fully untranslated due to the lack of time. I will send you the translation when I complete it (and test it a bit more - Slovene language is very complex in terms of grammar rules, so if some text appears in more locations, it could not be so straightforward what to put as a translation...).
Comment #3
jcnventuraOK. Thanks for letting me know.
As to the PHP code that I recommended, you have to set the filter to PHP code and not only unfiltered HTML.
There is actually a bug in the above print_insert_link() which is bypassing all the checks on displaying the link... If you use it, then it will always display. I will keep this open until I fix that one as a reminder.
As to the translation, you can always provide what you already have, and the rest (the admin part) can be provided later.
João
Comment #4
jcnventuraMarking it closed, as I have now added the user_access check to the print_insert_link function. Using the function should not display the link when the user doesn't have access to it. All other checks are still off, as it is the responsibility of the content creator/coder to make sure that the node where the link is being placed is printable.