Hi and thanks for you amazing module!

I am using Display Suite to render a content type page. With display suite I render the View Block and the print button.

This works fine on any other node but in the ones that contain Views in them.

Once I click Print, it generates the page in a new window (as per my setting) and shows the title and footer but not the View Block. I have set the "Show link in system (non-content) pages " to the right page but it still wont generate the view in the print page.

Further help would be appreciated!

Thanks!

Comments

maractive’s picture

I have exactly the same problem, did you solve this?

Shevchuk’s picture

Same problem with Views Block attached to the page. Tried

print render(block_get_blocks_by_region('content'));

as proposed in FAQ, and this worked ok in 7.x-1.2, but not 7.x-2.x

Shevchuk’s picture

Title: Views Bloc content not showing up on print page » Views Block content not showing up on print page
Issue summary: View changes
GinaF’s picture

I was using

$block = module_invoke('views', 'block_view', 'my-block');
	print render($block['content']);

in the print.tpl page to print any blocks on a page that contained content from a view.
This was working for both views that require the nid plus views that didn't. Since upgrading to 7.x-2.0, any views requiring the nid are not showing at all. I have also just upgraded views to 7.x-3.8 as well.
Any help much appreciated - I am stumped.

codenamerhubarb’s picture

Are you using contextual filters? I was having this issue and was able to fix it...

In the CONTEXTUAL FILTERS of my block views I am getting the Content: Nid.

Originally I had the settings for this to "Content ID from URL". For some reason this wasn't playing nicely when on the print pages (/print/[node id]).

I just changed the settings for Content: Nid to "Raw value from URL", Path component: 2 and it is working.

GinaF’s picture

I tried codenamerhubarb's suggestion, but this didn't work for me.
Thanks anyway.

GoempieK’s picture

Did you ever get this resolved?
I am having the same problem

aytee’s picture

Here's what I did to address this issue:

- Like the OP, I have Display Suite and a custom Block field displaying a View as a Field on my Content Type. The view block does not show up using the PDFPrint or Print function.
- In the print.tpl.php file, I've added the View block explicitly within the template

if($node->type== 'specific_content_type'){
//so the view block only shows in the particular content type and not all of them
views_embed_view('my_special_view_name', 'block',$node->nid);
}

The third argument above ($node->nid) is the contextual filter. The Contextual filter for the View is "Content:Nid". For the Contextual Filter settings: "When the filter value is not available" - Provide default value - "Content ID from URL" (in the select menu).

These settings now allow for the View Block to show in both the Print and PDF outputs.

estebant’s picture

Hi! This is my solution:

1. Go to Display Suite -> Fields
2. Add a block field
3. In Block, select "Printer, email and PDF versions"
4. Now you can place that field in your display

If still not showing, check:
Configuration -> User interface -> Printer, email and PDF versions
and make sure that in Link options, you have "Block" checked

I hope it helps, cheers!