Can I adjust Save Area to PDF to always print the content from the 'Main' area?

Permalink Browser Info Environment
Hi,

I would like to adjust Save Area to PDF to always print the content from the "Main" editable region regardless of where I place the Save Area to PDF block. I am an experienced developer and comfortable editing the block's code.

Would this be a simple matter of locating the code that grabs the content from the region that 'Save Area to PDF' is placed in and adjusting it to pull the content from the 'Main' region instead?

Thanks for any guidance you can provide, I will be sure to post the code here if I get this working.

Type: Discussion
Status: New
pds
View Replies:
jstrong replied on at Permalink Reply
jstrong
Quick 'n' Dirty way is to open up /packages/trans_marine_save_area_to_pdf/blocks/save_area_to_pdf/view.php

Line 9 I am grabbing the current area handle as a hidden field. Change:

<input type="hidden" name="areaHandle" id="areaHandle" value="<?php echo $b->getAreaHandle(); ?>" />


to

<input type="hidden" name="areaHandle" id="areaHandle" value="Main" />


Note all I did was change what's in the value attribute between the quotes. Haven't tested this but it should do the job! Let me know -J
pendragn replied on at Permalink Reply
pendragn
As a followon to this question, is it possible to print multiple areas on one page into the generated PDF? If I have "main" "main2" and "main3" on one page is it possible to print all of them into the same PDF (collate them)?

Thanks!
barneyy replied on at Permalink Reply
barneyy
Sorry JStrong,

I changed line 9 as you mentioned but i still only see the last "Content"-Block in the PDF!

Are you sure to change the "value="Main" in Line 9 will include all Blocks in the area?

I'm using c5 in Version 5.5.2.1 and for me it doesn't include all blocks!

Any suggestions?
jstrong replied on at Permalink Reply
jstrong
Hello! Its designed to save the Area its placed in and only that area. So if you put it in Main, for instance, it'll grab everything in Main, if you put it in a sidebar, it'll get the sidebar content, etc. -J
barneyy replied on at Permalink Reply 1 Attachment
barneyy
Hi JStrong,

i'm newbie to c5, so could you please have a look at my screenshot to be sure that we're talking about the same prob?!?!

I added a few "Content"-Blocks, but only the last will be included into the pdf-file!

Would be nice and thx in advance

barneyy
jstrong replied on at Permalink Reply
jstrong
It may not be processing the "Layout Areas" you've got there. Which add-on are you using for that? If it's a free one I'll download it and test with it. I made this add-on about two years ago to do a quick job and uploaded it for free, so I haven't tried it with every combination. But yeah, if it's a free layout add-on your using I'll happily look into it and see if it's an easy fix. -J
barneyy replied on at Permalink Reply 1 Attachment
barneyy
It's not to add a Block, the option to insert these cols is "Add a Layout", included in 5.5.2.1 - so we aren't talking about an add-on!

would be cool if you'll try it - but i know your html-2-pdf-addon is a free one and if time is missing i'll try another way....

thx in advance


EDIT: I tested around a while, and it seems tha layouts in Blocks aren't supported! If i add a few content-blocks, everything is ok, so i'll work without "layouts" in Blocks!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.