Hi there!
I´ve been using print for some time now, but this is actually my first time with pdf support.
I´m using TCPDF.
I´ve added two views inside my node: One of them using "Views Insert", so it is embedded inside the body field, and the other it´s added inside the theme using module_invoke.
The second one it´s completely ignored by the printed version, and the first one (the one embedded inside the Body) shows just the Empty Text area of the view, but the view has content, and it is shown inside the normal node view.
This happens in both cases, by both core printed and pdf version.
I really cannot use this until it shows the views too. (I know there isn´t support for Views2 by the moment, that´s why I thought it could be embedded...

Is there something I can do about it?

Thanks!!!!!

Rosamunda

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

Regarding the second view.. Whatever you do in your theme is ignored by the module, so it will never show up and that's the desired behavior. If what you're doing is theme-dependent, then it should not be considered part of the content, and thus it should not be displayed in the print view.
If you consider it part of the content, then you're completely breaking the architecture model of Drupal and I can't help you with it.

About the first view... It should show something, and the fact that it doesn't may mean some problem with the view itself.. Can you provide more details about this view?

João

Rosamunda’s picture

Thanks for your reply Joao :)
Yup, I can tell what I think it´s the problem: One of the filter´s view is "Grupos: OG: Posts in current group".
I can tell about that because, when I take off that filter, the view shows normally.
But that filter is indispensable for the view to show up correctely, is there something to be done?
Thanks again!
Rosamunda

Rosamunda’s picture

Status: Postponed (maintainer needs more info) » Active

sorry, again, forgot to change the status (too much caffeine)

jcnventura’s picture

Title: Does not print the whole content? » Printer-friendly pages do not inherit group membership from original page
Project: Printer, email and PDF versions » Organic groups
Version: 6.x-1.3 » 6.x-1.1
Component: User interface » og.module
Priority: Critical » Normal

I need to ask some help from the Organic Groups people as to what I need to do here..

Basically, the print-module recreates the page - based on the node ID/path - and displays only the content.. It seems that I would need to 'inherit' the group membership of the original page.

Is this feasible, or is it against OG's architecture model?

João

Rosamunda’s picture

I would like some feedbak about if it´s really an OG issue or not. Anyone..?

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot parse out a question from this. Note that you can get group context for a page with og_get_grouop_context(). You can set it with og_set_group_context(). And that filter automatically sets context.

jcnventura’s picture

Hello moshe,

Sorry for not making it clear. The situation is that the user is finding a difference in the way that the PF version behaves because the generated page is not a member of an Organic Group. The og_get_group_context doesn't work as it doesn't take any arguments. However digging in from that point in the module's code, I think that the following code would do the trick:

  og_set_group_context(og_set_theme($nid));

I will try it and if it works, I'll add it to the print module.

João

Rosamunda’s picture

... and I would be very grateful for your effort, patience and kindness!! Thanks!!
Rosamunda

jcnventura’s picture

Project: Organic groups » Printer, email and PDF versions
Version: 6.x-1.1 » 6.x-1.5
Component: og.module » Code
Status: Postponed (maintainer needs more info) » Active

Bringing it back to the print module, so that I don't forget this..

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Hello Rosamunda,

I need your help in testing this.

Please add the following line to print.pages.inc, around line 560, just below $node->printing = TRUE;.

og_set_group_context($node->og_groups);

And then try those embedded views to see if they start working..

João

Rosamunda’s picture

Right away Joao! Thanks for your efforts!!

Rosamunda’s picture

I´ve added that line, and the text version is ok :)
But the pdf isn´t working. I mean, there is no output of that view at all. It´s just blank (but it will show up at the default, normal web version of the node).

jcnventura’s picture

The important part of making it work is the HTML version, as that is the input provided to the PDF generator.

What happens with the PDF? Is it completely blank, or only the view is blank? TCPDF can be picky with some HTML.

Can you attach to this issue a 'Save source' of the now working page? Only the HTML, don't ask it to save the page complete, as that changes the paths.

João

Rosamunda’s picture

I´m actually using dompdf-0.5.1 because of html thingies that did handle it better than tcpdf.

The pdf isn´t completely blank, the views content just won´t appear, but the rest (the node title, body and the rest cck fields) they actually appear quite ok.

I didn´t understand what you mean with the html. It´s just the node html output? Because it shows all content as plain html with no reference whatsoever to views. The output is just a table.
I´ll paste the output that shows up the view content, when I ask for the page source code. Please tell me if this is what you are referring to or not.

Thanks for your help!

<!-- Add view--> 
<div id="block--" class="block block-1"> 
      <h2>Listado</h2> 
  
  <div class="content"> 
    <div class="view view-liquidacion view-id-liquidacion view-display-id-block_2 view-dom-id-1"> 
        <div class="view-header"> 
      <h3>To Pay</h3> 
    </div> 
  
  
      <div class="view-content"> 
      <table class="views-table"> 
    <thead> 
    <tr> 
              <th class="views-field views-field-field-reg-asiento-cuenta-nid"> 
          Nombre        </th> 
              <th class="views-field views-field-field-factura-monto-value"> 
          Monto        </th> 
    </tr> 
 </thead> 
  <tbody> 
          <tr class="odd"> 
                  <td class="views-field views-field-field-reg-asiento-cuenta-nid"> 
            Juan Martín          </td> 
                  <td class="views-field views-field-field-factura-monto-value"> 
            $ 375,0          </td> 

      </tr> 
          <tr class="even"> 
                  <td class="views-field views-field-field-reg-asiento-cuenta-nid"> 
            Andrea Giménez          </td> 
                  <td class="views-field views-field-field-factura-monto-value"> 
            $ 375,0          </td> 
 
      </tr> 
      </tbody> 
</table> 
    </div> 
jcnventura’s picture

Sorry, but I don't understand.. Can you at least attach a screenshot of what I should see (the web version) and the problem (the PDF).

Anyway, I have just committed the organic groups fix, so this is mostly fixed once the above problem is understood.

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Two weeks without further info.. Closing the issue.

Rosamunda’s picture

Status: Closed (fixed) » Active

Hi again,
After going a bit crazy and forgeting to respond to this issue, for wich I sincerely apologize, I´m back.
I´ve read and re read all over again, and installed this module again in a fresh install, with this module, cck, views and Organic Group. I´ve used the stable and then the dev version.
I´ve used the 2.0 version of OG.

To explain this in a very easy way: when the node shows the group where that post belongs, the print version won´t show it. Even in a default OG installation.

When you install OG and create a group, and then you post stuff into it, each node show to what goup or groups that post belong. That´s default behavior for OG and all themes that I´ve tried. (The node shows it in the same way that it shows taxonomy I may add).

When you click on the printed version, it won´t show that line of code that belongs to that node´s body content.

Again, I apologize for letting this issue to be closed!
Obrigada :)

Rosamunda

itsnotme’s picture

Subscribing - the print output of a node loses the group context, which can seen at the missing group > groupname elements in the breadcrumbs. Therefore, something like

 if ($node->og_groups && $page) {
	          print '<div class="groups">'. t('Groups'). ': ';
	          print '<div class="links">'.  $og_links['view']. '</div></div>';
	   } 

Doesn't work either. Possilby there's an easy solution but I don't have it right now :)

jcnventura’s picture

Issue summary: View changes
Status: Active » Closed (outdated)