Skip Navigation

[Resolved] Inline support for custom feeld values in Gutenberg not working

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use inline fields but I am unable to select the desired fields in the Element editor.

Solution: Use Content Templates to design the dynamic content, then place the Content Templates inside the Element editor.

This support ticket is created 3 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 9 replies, has 2 voices.

Last updated by kostaB 3 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1992249

I am trying to: Insert values from custom fields into Gutenberg and Kadence blocks inline.

Link to a page where the issue can be seen:
hidden link

I expected to see: The ability to click on the A icon, and to select the custom toolset field, of which the content should then be linked inline

Instead, I got: Either I can't actually select the custom field under the field group, disallowing me from actually inserting the values from the custom fields. OR, in the case of the care information popup on that page, when I select the custom field, it shows the display text instead of the field content (on the first line only). It's flippant and random about where and when it works. Since it does work with this random widget, where it displays the name of the model and her measurements, also from a Toolset field:

hidden link

My site is hosted on Cloudways, VultrHF. I use Kadence Theme + Pro. I do have a lot of active plugins installed, however, I did do some testing by disabling all plugins bar the necessary ones, A/B'ing the problem on the Twenty Tweny theme. It made no difference. This is a dev site where I am rebuilding my website without the Elementor page builder (the live site does not have Toolset installed yet).

Since Twenty Twenty without Kadence Pro does not support hooked elements, I tried enabling one of the custom field groups on a page instead of a product or hooked element, and tested the same thing with the list Gutenberg widget there too. No difference.

So yes, it is highly random when it does and doesn't work.

I'm not trying to have multiple issues taken care of with one ticket with my following paragraph, I'm just mentioning for sake of completion and being thorough in the information I provide for this ticket. Were this to be a separate issue, I will open another ticket to have it taken care of after this one is closed:

Last night, I got an email email from my WordPress installation that a plugin or theme is causing a fatal error on my site. Namely, Toolset Views. The email ended with "An error of type E_ERROR was caused in line 1148 of the file /home/475059.cloudwaysapps.com/cnjdvgsktu/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/module-manager.php. Error message: Out of memory (allocated 71303168) (tried to allocate 131072 bytes) ". And before that, Toolset Blocks caused a 500 error, repeatedly, on my site.

This is it for now. Thank you for your product and I am looking forward to your support.

#1992475

Hi, I temporarily disabled password access to my staging area as I forgot to include the credentials (the login credentials for the admin account work though). Where can I provide these credentials secretly so I can re-enable password protection?

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/500-errors-related-to-toolset/

#1992761

Hi, I have activated private reply fields for you here. Can you try sharing those credentials in your next reply in the forum?

#1992779
#1992817

Instead, I got: Either I can't actually select the custom field under the field group, disallowing me from actually inserting the values from the custom fields.
Can you tell me which custom field you are trying to insert, and where exactly you are trying to insert it? Screenshot of the editor location would be helpful. I'll see if I can replicate the problem and try to figure out what's happening.

OR, in the case of the care information popup on that page, when I select the custom field, it shows the display text instead of the field content (on the first line only).
Again, can you tell me which field you are trying to insert, and exactly where in the popup you're trying to insert it? Screenshot of the editor if possible.

Last night, I got an email email from my WordPress installation that a plugin or theme is causing a fatal error on my site. Namely, Toolset Views. The email ended with "An error of type E_ERROR was caused in line 1148 of the file /home/475059.cloudwaysapps.com/cnjdvgsktu/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/module-manager.php. Error message: Out of memory (allocated 71303168) (tried to allocate 131072 bytes) ". And before that, Toolset Blocks caused a 500 error, repeatedly, on my site.
My gut feeling is this memory issue is unrelated to the experience you've described with the inline field error. I'll split this off into a separate ticket for you so another supporter can investigate as soon as possible.

#1992831
care modal.png
sizing modal.png

The bullet list in the red circle is where I want to insert the corresponding measurements from the 'Size Information' field group: Shoulders, Bust, Waist, Hips, Sleeve, Length. Behind the names of the mesurements that are there.

The blue circle is around an Icon List widget. 3 icons with text next to them. They should display the information from the Care Information field group. From top to bottom: Washing, Drying, Ironing. The first line, next to the first icon, doesn't display the field content, but the title of the field. The rest aren't allowing me to select any field. When I click on the 'inline field' icon, and subsequently Post Source > Source > Field, nothing happens.

And thank you, I saw that the other ticket was opened. I will have a look! I considered upping the memory to 256MB too, but didn't want to do anything haphazardly.

#1995421

Okay it seems the issue in these two specific cases is one of context. You have created custom fields for Size and Care, and applied those to Products. That makes sense, you want to give each specific product its own sizing and care information. However you have also applied the custom fields to Elements post type, which does not really make sense. You won't be applying Size and Care information to each Element. So I would change the assignment of the Size and Care field groups and remove those from the Element post type. That doesn't really apply to Elements.

Then when designing the Element, you want to display information from the Product post, since the Element (in this case a popup I believe is the intention) will be displayed on each Product. The problem then is that the Block Editor does not have a way to specify which Product's Size and Care information should be displayed when designing the Element. That's why you don't really have the ability to choose from Product information when adding dynamic content here.

One way I think to get around this issue is to use Toolset's Content Templates to design the area you have indicated with the red circle. To help you understand how this might work, I have created a new Content Template here:
hidden link

Up at the top of the page, I have selected a Product to use during the design of this template for context. I added a list block and copied the information from the Element you started. Now I can use dynamic sources from the Product I selected when designing the template. You can see I've added dynamic information for the shoulder sizing information, and that is pulling "42" from the custom field of the Product I chose as the post context.

Back in the Element, I have replaced the list block with a Content Template block. You can see it pulling in dynamic content from the Content Template I created.

I think this is the best workaround right now, since it's not possible to choose a Product for context when editing an Element. This will allow you to use the Block Editor to design your content, and will also allow you to use dynamic sources effectively with Elements.

I think the problem with the Care popup is the same - you're trying to display information from a Product inside an Element editor. It would be more appropriate to use Toolset's Content Template to design the dynamic content area, and place a Content Template inside the Element. I've started another Content Template for this purpose here:
hidden link

I replaced the Icon List block with this Content Template so you can see dynamic content pulling into the Element editor screen.

So I suggest you follow this approach to place dynamic content in an Element. Create Content Templates to design dynamic content areas, and then place those Content Templates inside the Element builder using a Content Template block. This eliminates the problem of context. You can continue editing those Content Templates to get the design exactly how you want it.

Make sense?

#1995447

That makes perfect sense, thank you for your thorough response and explanation. I more or less expected that, as elements don't draw product data, it made sense that that they wouldn't display it. What threw me off was that it somehow did end up displaying the "model info" field, despite the fact that this is a product field haha.

However, one thing that still seems to happen is that the care ifnormation popup is still displaying the field title rather than the field value in the content template. How can this be? Did I miss a setting that doesn't make it that it displays values rather than titles?

#1995503
Screen Shot 2021-03-21 at 8.45.26 PM.png
f-and-v-icon.png

However, one thing that still seems to happen is that the care ifnormation popup is still displaying the field title rather than the field value in the content template. How can this be? Did I miss a setting that doesn't make it that it displays values rather than titles?
For a custom select field, typically the display text is shown on the front-end of the site. The selected option's content is typically not displayed. That is usually referred to as the "raw" value, since it comes directly from the database. There is no option to display the raw value easily with the inline field feature. You would have to use the Single Field block or the Fields and Text block to display the raw value of a select field. The first screenshot here shows where you can choose to display the raw value with the Single Field Block. For a Fields and Text block, you'll choose the raw value in the popup when you click the Fields and Views icon above the text editor area - second screenshot here.

#1995887

Ah right, makes sense. This is making me rethink my approach to the care fields to the point where it's outside of the scope of this support ticket. So consider this ticket closed and consider me incredibly grateful for your in-depth and detailed support, thank you very much!

#1995889

My issue is resolved now. Thank you!