how to make only one node type printable?
dnystwn - January 26, 2007 - 05:41
| Project: | Printable |
| Version: | 5.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I just need this feature for one node type and would like to disable this feature for other pages. Is there a way to do this?

#1
I'm not planning to add that type of functionality. I'd like to keep this a very simple module. Maybe the Print module would offer this?
#2
A way to disable this module per-page is needed, even if it has to be done at the theme level.
#3
Agreed. I still want to keep the module small, but now see that indeed we need some control over display. We could consider (a) the node type suggestion, (b) a page filter like is used in the block administration (c) both.
#4
Putting the printable link in a block could be a good option.
The block could then be put in the footer or in another non-intrusive position.
Otherwise, it should be added to the existing $links array, which contains other links of the same kind (like the fast toggle module has done to have a "publish" link).
This should not be difficult, yet it needs to be put in by someone who knows where in the code the link is inserted in the first place.
#5
The main point of printable module is to make all pages on a site printable (views, nodes, user profiles, taxonomy terms, panels, etc.).
hook_link()is used only for nodes and comments. I'd prefer a solution that has the print link in a consistent place on all pages where it is rendered (hence my use ofhook_help()). So ideally a solution to restricting the print link should keep the ability to have it on any page and in a consistent place.#6
You are right about the hooks, so the node links area is not usable.
How about the block? Could there be a way to print the existing link elsewhere in the page?
#7
The printable module is an excellent addition, but I didn't want the "printable page" showing up on every single page so I utilized a CSS solution.
Once the printable module is installed I disable it from appearing in the style.css sheet of my theme as follows:
.help {display: none;}
Now if you look at the page source for the node or view you wish to add it to the html still comes up:
<div class="help"><span class="printable"><a href="/drupal/printable/calendar2">printable page</a></span></div>
Now you need to copy this information from the page source as it is generated for your page and you can place it anywhere on the node or view you wish it to appear. Just make sure you change the div class to another name so it isn't made invisible by the css - for example I used "help1". I also changed the "printable page" text to "printer friendly page":
<div class="help1"><span class="printable"><a href="/drupal/printable/calendar2">printer friendly page</a></span></div>
Now I am not sure what else uses the class "help" to display in Drupal, but so far I don't seem to have any issues with tweak. It would be nice if it could be an option on the node or view you wish it to appear, but this works for me for now.
Thanks to all involved with the development of this module.
Mike
#8
Actually the solution I suggested doesn't work so well. It is only good for the default view of any page, but if you make any changes like sorting a list or changing a view from monthly to yearly in calendar it doesn't print.
Sorry..