Skip Navigation

[Resolved] Block-based content template used inside another content template

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by neilR 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2599709
2023-04-26_16-36-46.jpg
2023-04-26_16-25-23.jpg

I have a content template ("Advert Tile - Block") that is NOT the defined template for a CPT ("Advert") - I have a different default CT for the CPT ("Advert Single Page"). When I try to add dynamic content to a non-Toolset block in the "Advert Tile - Block" content template (e.g. Kadence Advanced Text block) I cannot select the custom fields for the CPT in the Dynamic Sources dropdown - the dropdown seems constrained by the 'Usage' tickbox, but of course the tickbox changes the default template for the CPT, which I don't want. Is there any way to overcome this, other than temporarily setting the default template to 'Advert Tile - Block', then changing it back when done?

#2599993

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

There is no other way. You will have to temporary set the usage post type and build your template and once you finish you should remove or unassign the usage post type from the content template.

#2600059

Hi Minesh,
Thanks for the reply. Switching the usage post type could get quite clunky when I'm trying to edit two content templates at the same time (e.g. when one's embedded in the other). I am surprised that more people haven't come across this, as I'd have thought that creating multiple CTs for a CPT would be quite common. Is this something that might be changed in the future, as it seems an annoying limitation?
In the meantime, I might try a workaround - create a CPT called 'Ad-dev' and assign the custom fields to it, then assign 'Advert Tile - Block' CT to that CPT - this should give me access to the custom fields in the non-toolset Dynamic source dropdown, but I'll still be able to use the CT when displaying the original CPT... Does that sound realistic?

EDIT: just tried it, and sure enough I can now access the custom fields in non-Toolset blocks when editing the CT. Still not ideal to have to workaround this.

#2600087

Minesh
Supporter

Languages: English (English )

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

You can use the workaround that suits you best and I'll discuss this limitation with our next level support and we will report it if our Devs agree to improve this situation.

#2600133

Thanks for the clarity Minesh. It would be good to be able to do this stuff for multiple templates for a CPT, so thank you for raising it to Devs.