Skip Navigation

[Resolved] Views Block Editor not showing Custom Fields in Search

This support ticket is created 4 years, 10 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by martinE-4 4 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1456889

I am trying to:
Create a search using custom fields in the Views Block Editor
Link to a page where the issue can be seen:
local sorry
I expected to see:
all the custom fields listed for my cpt "Directory Items"
Instead, I got:
I did not see any custom fields listed? Is this feature still awaiting implementation?

Note: the custom fields I expected to see are from my cpt Directory Item, in a Field group called 'Directory_item fields', and the 'Where to use field group' in the custom post definition ONLY checks off Directory Items.
Do you think we need to ALSO check off the 'Pages' post type? If we are putting a view on Pages that refers to the Directory Items custom post type? (I would not think so...)

I also have a custom post type called Resources and none of its fields are displayed in the field choice area of the Search block in the Block editor. (but I would expect this since I set the view to query only my Directory Item cpt)

Followup Note: I also tried a legacy classic view and it CAN reference my custom fields no problem! But I want to use the new Block editor?

#1457391

Hi Martin,

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

When a "Custom Search Filter" block is inserted, it shows the custom fields to select from all available field groups and not just the ones linked to the selected post type.
( ref: https://toolset.com/documentation/getting-started-with-toolset/filter-content-lists-and-add-custom-search/ )

Example screenshot: hidden link

Can you please make sure that WordPress, active theme and plugins are all updated to the latest version and that we're discussing the same block?

In case the issue still persists, it would help if you could move the website to an online server and then share its admin access, for further troubleshooting.

regards,
Waqar

#1458161
Edit_Page_‹_ART___DIALOGUE___ACTION_—_WordPress.jpg

Thanks Waqar. I sent an image of what I see in the pull down menu from the Search block on my page. It does not show any custom field groups.

My WordPress, GeneratePress premium and Toolset plugins are all up to date.

The only different thing is that I used the FG Drupal to WordPress plugin to migrate from Drupal and although the fields all look great in Types (the plugin registers them to Types) and they show data on the screen etc, it is possible that this plugin has interfered in this obscure way with the block field choices.

The classic View has no problem though so I thought it was a Toolset issue of using the Search block on a page as opposed to a Content template. I'll test it on a content template next.

If you don't think this is a Views bug, I will contact Frederic Gillies about the Drupal migration plugin (which is wonderful in every way - wow what a time saver).

Thanks for thinking about this. I'll wait for your comment and send you an update about trying the Search block on a template too.

I have a duplicator zip copy of everything I could send but it is 500MB...

Update:
I tested a content template and no change. I wonder if there are too many fields to scroll down in the pull down? I notice that the 'non-types' fields show quite a few 'ocean' fields which might be leftover from a try I did with the Ocean theme before settling on GeneratePress. Is there any way to delete those old fields?

#1459341

Thank you for sharing the update.

To investigate and confirm your observations, your website's clone/snapshot would help.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

You're welcome to share it in reply to this message and I've set your next reply as private.

The size of the duplicator package can be reduced by excluding the unnecessary large files and directories, for example, the entire "uploads" folder, through the "File filters" option.
( ref: hidden link )

Example screenshot: hidden link

I hope this helps and I'll wait to hear back from you.

#1460643

I figured it out. There is NO bug. It is merely necessary to go into the Custom Field Group (Cfg) and edit the settings at the top tab which says 'Content Template'. There you are allowed to specify which content template you wish to assign the cfg to.

Presto! When you create a view on that template in the block editor and create a search block, all the cfg fields are available in the pull-down menu, just as you would expect!

I don't think you can create a view with cfg's in the search block on a simple page unless its content template has been registered in this way.