Skip Navigation

[Resolved] Custom Post Types not feeding into PDF document

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 18 replies, has 3 voices.

Last updated by Luo Yang 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1261557

Hello

I am currently using a third party plugin - PDF & Print Pro and am having an issue feeding through Custom Post Types to the downloadable pdf.

I have a page:
legacyangel.com/my-will
and on the page it displays a persons will - so there is some static html text e.g. <p>Here are my children: </p> and then there is CPT data e.g.

  • child 1
  • child 2
  • child 3

.The CPT data gets injected using the Toolset plugin. So in this case it is the CPT 'PERSON'...

The problem I'm having is that any dynamic data relating to the User e.g. Name is getting rendered but any dynamic info from a CPT in not... so I'm getting 'This is the will of GEOFF DIXON' but not the list of children..

I hope this makes sense..

I realise that you can't comment on 3rd party software but I have been in touch with BestSoftWeb who say they can't comment on Toolset....

I'd desperate for help...any advice would be great..

Best regards

Geoff

#1261775

Dear Geoff,

How do you display those dynamic info from a CPT?
Are you using a post view shortcode [wpv-view ... ] to display those dynamic info?
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view

If it is, I suggest you check it with the author of "PDF & Print Pro" plugin, check if this plugin supports custom shortcode.

In Toolset side, you can also render the post view with PHP codes in your theme file, see our document:
https://toolset.com/documentation/programmer-reference/views-api/#render_view
Renders a View and returns the HTML output.

#1263187

Hi Luo

I am using lists in views to render the dynamic data e.g.:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
5. I appoint as my executors and trustees
<wpv-loop>
[wpv-post-body view_template="Loop item in View 28"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

I will contact the 3rd party provider and ask them about shortcode support..but in the meantime can you advise the best way to render these type of views if shortcode isn't supported,.

Many thanks

Geoff

#1263623

As I mentioned above, if the shortcodes is not supported, then you can check if it supports custom PHP codes, see the document I mentioned above:

https://toolset.com/documentation/programmer-reference/views-api/#render_view
Renders a View and returns the HTML output.

#1268543

Hi Luo

The plugin does support shortcodes however after further investigation I have found out what isn't being rendered.

If I insert a shortcode in a visual editor cell e.g. [types field='person-full-name' id='5272'][/types] ....Then this gets rendered in the pdf ok...but then if I include dynamic data from a view loop it doesn't render in the pdf e.g. [wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="Loop item in View 27"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

So on the plus side the pdf plugin works and renders Toolset shortcodes but just not the view loops...
What do you suggest?

Regards
Geoff

#1268991

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

Well - Can you please share problem URL and access details where I can see the issue.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1269109

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - If I click on the icon 'Download Your Will' it downloads the PDF - where is the view and where exactly you added the view?

#1269127

Hi Minesh
The pdf shows the details in the current page... if you go into page edit you will see the various shortcodes and views created...

Regards
Geoff

#1270231

Since it is a compatibility problem, please provide a copy of your website in below private message box, also point out the problem view URL, where and how do you setup the view's shortcode within "PDF & Print Pro" plugin?
https://toolset.com/faq/provide-supporters-copy-site/

I need to test and debug it in my localhost, thanks

#1272157

Thanks for the details, I am downloading the files, will update here if there is anything found.

#1272257

I can install your duplicator package in my localhost, but I am not familiar with this plugin, please describe detail steps to duplicate the same problem:
Where and how do you put the Views shortcode into PDF & Print Pro plugin
Which post view do you want to display in the PDF file? please point out the view's URL.

Thanks

#1274943

Hi Luo
The page I'm working on that gets turned into a pdf is: hidden link

If you go to 'edit page' and edit with 'Layouts' you will see there are various Visual Editors and View cells... In the first Visual Editor you'll find this code:

[code]
<p>I am married to [wpv-user field="user_firstname"] - [types field='person-full-name' id='5272'][/types]</p>
[/code]

This dynamically renders to the page the (user) user_firstname and the (cpt) person-full-name ..this also is rendered in the pdf document when you click 'Download My Will' icon in the top right...

Next...in the editor below this you'll find the view 'Preliminary Declarations 2' which is a loop as follows:

[code]
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
2. I have the following living children:
<wpv-loop>
[wpv-post-body view_template="Loop item in Preliminary Declarations 2"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
[/code]

This loop renders [types field="person-full-name"][/types] born on [types field="person-dob"][/types] for all cpt PEOPLE in the loop to the page....However unlike the first example this doesn't render to the pdf... So it seems that some shortcode works but the loop shortcode doesn't...

The actual Print & PDF plugin just renders html from the page and there are no settings to insert shortcodes... This is the only settings page of the plugin that you can select the output:

hidden link

Hope this all makes sense..I shall look forward to hearing from you

Best regards

Geoff

#1275463
pdf-setting.JPG

Thanks for the details, I can see the problem in your website:
hidden link

The PDF file does not output anything from Views shortcode [wpv-view] .

but with your duplicator package, it keeps on redirect me to another URL with 404 errors.

I have tried the plugin "PDF & Print Pro by BestWebSoft" plugin in my localhost with a fresh wordpress installation:
In "PDF & Print" setting page, I can see only a "License key" input box, see screenshot pdf-setting.JPG.

So can not duplicate the same problem in my localhost, but according to our workflow, I need to duplicate the same problem in my localhost, can you provide a valid "License key" for domain name "localhost"?

And since it is a compatibility problem, you can also ask from author of "PDF & Print Pro by BestWebSoft" plugin.

#1275639

Hi Luo

Glad you're making progress with this...

The License key you need is: 0x27faf1019c6dca71

Hope this helps

I shall look forward to hearing back from you

Best regards

Geoff

#1276247
License-key.JPG

I have tried the License key you provided above, but get this error:
This license key is bind to another site

See screenshot License-key.JPG, so I still need help to duplicate the problem, you can setup a test site with the same problem, provide the website credentials and FTP access in below private message box.

Did you get any feedback from "PDF & Print Pro" plugin author?