Skip Navigation

[Resolved] "View with" custom post type post dropdown while editing 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.

Our next available supporter will start replying to tickets in about 6.89 hours from now. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 16 replies, has 2 voices.

Last updated by Waqar 1 year, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2622051

jww
Screenshot 2023-07-07 at 10.06.19 AM.png
Screenshot 2023-07-07 at 10.05.58 AM.png

I am following the Create a Custom Template tutorial here
https://toolset.com/course-lesson/creating-templates-to-display-custom-posts/
At 1:55 timestamp, it has you insert a grid then insert an image block in the grid.
When the tutorial inserts the image, an image shows up, being dynamically called from the post.
It shows "View As" Banana Bread (post) at the top.

I have created a custom post type "Resources"
I have added a Field Group with a custom field group "Logo"
I created a content template and assigned it to that custom post type "Resources"
I added a Toolset container > Toolset image block
I set it to Yes> Dynamic
The field group appears
I select that custom field Logo

I have one post created
The logo uploaded for that post to the media library does show up on the custom post type post using that content template.

The problem:
1. On the back end, in the Content Template:
-When I click on the image block, none of the image settings appear on the right as they do in the tutorial so I can't change any of it's attributes like max size, border, etc. Only the icon for the image block itself shows up but none of its settings.
2. The "View with: Banana Bread (or in this case my post title) doesn't show up at the top.
3. When I click on the image block on the content template, it says:
This dynamic source returned no content, even though it does show the correct field names and it does show up on the front end. But it isn't pulling it in on the content template itself which I guess is because View with Post Title drop down isn't showing up at the top of the content template editor.

So I can't edit the image properties, I can't see the demo data.
What do you suggest?
Thanks in advance.

#2622085

jww
Screenshot 2023-07-07 at 11.03.11 AM.png

It's just behaving really oddly.
I'm still following the tutorial. It isn't looking like that.
When I add a grid > Add image, the problem above persists.
But now when I add a new single field to be the post content, it's pulling in the title and a different custom field which is the one on the right, but it's showing up on the left as content.
Any ideas? The content should be showing up on the left, not the site link (which is on the right where I put it).

#2622117

jww

Also on the same note in trying to solve the image problem, I tried using a Kadence Advanced Image block instead.
But it doesn't see the custom fields for this post type when I enable dynamic.
I know Kadence Blocks can/do work with Toolset. Why isn't it seeing my custom fields? Do I have to add something to the slug?
In this example, slug is logo. Is it something like wpcf_logo?

#2622147

jww
Screenshot 2023-07-07 at 12.57.10 PM.png
Screenshot 2023-07-07 at 12.54.49 PM.png

Continuing to be frustrated.
1.
I added some regular single text line fields and multi line fields to the content template. They show up just fine on the post editor and then on the front end.
But then
I added 2 repeatable fields to the CPT Field Group: Pricing Plan and Coupon Code
They do show up on the post editor > I added data to them.
But when I go to add these repeatable fields to the content template, those custom fields do not appear as options. It pulls up the Post Type Field Group name correctly, but then says no options in the Custom Field drop down.

2. I originally created a different field group:
Field Group for Photo Resources
I deleted it and made a new one, which is showing up fine on the Post Editor page.
But the old one is also showing up, not with fields, but its name at the bottom of the page. If I deleted that field group entirely, why is its name with an open arrow still showing up at the bottom of the post editor page? I have cleared the cache multiple times.

Thanks in advance.

#2622173

jww
Screenshot 2023-07-07 at 1.06.14 PM.png

Also whenever I refresh the content template, it gives me a red triangle warning next to where I selected the post type and says Some posts have custom templates.Apply to all
Why does it keep giving me this warning?
I have one custom post type and one custom template, applied to that one custom post type.

#2622489

jww
Screenshot-2023-07-09-at-3.40.02-PM.jpg

I really need help with this. I'm on a deadline.

When I insert an image block and select yes use dynamic image, it doesn't give me any of the image settings in the block settings on the side bar, and, it doesn't give me any of the custom fields where the image is.

Please reply ASAP. I am stuck on this and it's causing a problematic delay.

#2622519

jww
Screenshot 2023-07-09 at 5.50.47 PM.png
Screenshot 2023-07-09 at 5.50.26 PM.png
Screenshot 2023-07-09 at 5.49.58 PM.png
Screenshot-2023-07-09-at-5.50.14-PM.jpg

Update and still not working.
I created a clean WP installation to eliminate conflict potentials.
I am following this tutorial.
https://toolset.com/course-lesson/creating-templates-to-display-custom-posts/?utm_source=plugin&utm_medium=gui&utm_campaign=blocks

I'm using the default 2023 theme and absolutely nothing else on a clean install.

I put one image in the media library.
I created a new custom post type "Resource"
I added one custom field to the custom post type - an image field "hero image"
I created a content template for this post type from the content dashboard.
I created a new post with this post type.
I went to Edit the post - added the image to the custom field "hero image". It shows only in the custom field as uploaded.
On the content template, there is a container with image block set to dynamic for the new custom field "hero image". This image shows up fine on the template with View As that post.
When I click "view on the front end" - the image is not there.
Why does it appear on the content template but not on the front end??

#2622555

jww

I'm happy to provide a log in in a private window to the test site.

#2622557

jww

Also it seems like it has t do with the content template. If I just insert a dynamic image block into the post body itself, it sees and displays the image fine. But, with the content template, with the custom field on the template, and an image then added to the edit > post field, it doesn't display on the front end.

#2622627

jww

On the test site it's now showing the image fine. But still not showing on the actual main site with more plugins installed. And on the test site, If I add a Generate Blocks button and image to the content template, they don't show up on the post but the Toolset image and button do show up. So the Toolset content template is not showing Generate Blocks button and image. The custom fields also don't show up for the Generate Blocks dynamic settings in the source options but do show up for the Toolset blocks. So...why don't they show up for the Generate Blocks dynamic source settings? My understanding was that Toolset and Generate Blocks work well together?

Also could you please delete my uploaded images from public view.

#2622685

Hi,

Thank you for contacting us and I'd be happy to assist.

For efficient and timely support, we request to start a new ticket for each new question or concern. But for this ticket, I'll try to address each concern, point-by-point.

Can you please share temporary admin login details, in reply to this message? I'll be in a better position to suggest the next steps accordingly.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2622709

jww

GB is not seeing any Toolset custom fields. When I enter the Toolset custom field name for example logo into the Generate Blocks dynamic image block for example, it doesn't show up. Is there a prefix to the custom field name to add? Like toolset_logo or _wpcf_logo or something like that? That has worked with other plugins with similar issues in the past.

#2623005

Thank you for sharing the access details.

Here are my findings related to the points that you've shared:

1. I checked the 'Template for Photo Resources' and noticed that the option 'View with' to select the preview post is missing.

While testing on my website with the GeneratePress theme and the GP Pro plugin, I couldn't reproduce this issue. This suggests that something specific to your website is involved.

To troubleshoot this missing option, I'll recommend to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.

If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.

For now, I've used some custom code to update the preview post option for this content template to the 'Deposit Photos' post that you shared and the dynamic source option for the relevant blocks in the template are now showing the fields from the field group correctly.

2. In the same content template's 'Usage' settings, I unchecked and then checked the option for the 'Photo Resources' post type and then saved the template. As a result this template is now assigned to all the posts in this post type and the message about some of the posts not having the same template is gone.

3. The repeatable field groups work differently than the regular custom fields, because they're stored with a separate hidden post type.

To show them in this content template for the 'Deposit Photos' post type, you'll need to add a view, as explained in this tutorial:
https://toolset.com/lesson-placement/lesson-placements-1621067-1624449/#displaying-repeatable-field-groups

4. The dynamic source settings for the blocks, where the Toolset fields are available out-of-the-box, you won't have to add any prefix.

For any blocks or code, where you need to specify the key to call a specific custom field, you'll need to append 'wpcf_' prefix in front of the slug added in the Toolset's field group.
( for example, for 'hero-image' field, you'll use 'wpcf-hero-image' )

I hope this helps and please let me know if you have any follow-up questions.

Note: I don't see any personally identifiable information in this thread, but, if you'd like to hide/remove any particular text or image, just let me know.

#2623111

jww

Thank you for taking the time to test it.
Can you tell me what you added for code where?

Is there any way to make the fields show up in the choices in a Generate Block rather than a Toolset block in the dynamic settings without having to type in wpcf- first? It sure is easier if you can see the list to choose from than have to hunt down the slug if I have 100 fields in a CPT.

Thanks
Laura

#2623627

Hi Laura,

> Can you tell me what you added for code where?

- This is the custom shortcode that I temporarily registered by adding through your website's 'Snippets' section:


add_shortcode( 'custom_shortcode_preview_test', 'custom_shortcode_preview_test_func');
function custom_shortcode_preview_test_func($atts)
{
	$a = shortcode_atts( array(
		'id' => '',
		'status' => '',
		'new' => ''
	), $atts );

	if( $a['status'] == 'view' ) {
		$key_value = get_post_meta( $a['id'], 'tb_preview_post', true );
		// Check if the custom field has a value.
		if ( ! empty( $key_value ) ) {
			return $key_value;
		}
	}

	if( $a['status'] == 'update' ) {
		update_post_meta( $a['id'], 'tb_preview_post', $a['new'] );
		
	}
}

To view the ID of the preview post set for a content template with ID '1234', this shortcode can be used as:


[custom_shortcode_preview_test id='1234' status='view']

And to update the preview post with the ID '5678' for a content template with ID '1234', it can be used as:


[custom_shortcode_preview_test id='1234' status='update' new='5678']

> Is there any way to make the fields show up in the choices in a Generate Block rather than a Toolset block in the dynamic settings without having to type in wpcf- first? It sure is easier if you can see the list to choose from than have to hunt down the slug if I have 100 fields in a CPT.

- I'm afraid, this level of integration is not available with the Generate Blocks and you'll have to type in the complete custom field key manually.

regards,
Waqar