Skip Navigation

[Resolved] Split: Designing the view and archive

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

This topic contains 9 replies, has 2 voices.

Last updated by simchaH 2 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2193635

Thanks for your help, I will go ahead and try this.

I am trying to work out configuring the design for the view/archive of the search results, and it is proving difficult to do. I am using Elementor Pro and I see no integration with it, so I've resorted to the Block Builder from Toolset, however it isn't coming out correctly. The search bar is not getting input right, how do I get the search bar to be on the same column as the search button? Also. is there a way to attach a link to dynamically displayed information? In other words, I am pulling a phone number from a post type using a single field widget, and I want that phone number to be clickable and directed to a typical tel:1800XXX-XXXX. Same for email.

Also, how do I populate data from multiple post types inside of one view/loop? Meaning I have data that I would like to show to visitors of the site, some of it from post type A and some from post type B. I would like it to display nicely, all inside of one "Card/Square". See link below.

I got the view to look somewhat good, but the archive I am having even more difficulty with. Although they seem to do the same thing, so maybe I'll just ditch the archive.

view:
hidden link

archive:
hidden link

Thanks

#2193817

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

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

1. To show the email and call/phone links from custom fields, you can use the Types fields API shortcode to generate the links:
https://toolset.com/documentation/customizing-sites-using-php/functions/

For example, suppose you have an email type custom field with the slug "e-mail". The email link's code would like this:


<a href="mailto:[types field='e-mail' output='raw'][/types]">E-mail</a>

Similarly, for a phone/number type custom field with slug "telephone", the call link would like this:


<a href="tel:[types field='telephone' output='raw'][/types]">Call</a>

2. In the view block's "Content Selection" settings, you can enable the "Allow multiple Post types" option, after which you'll be able to select multiple post types, to show the results.
( example screenshot: hidden link )

For more specific assistance around how to style these views or archives, you're welcome to share temporary admin login details, so that I can see how they're set up in the admin area.

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

regards,
Waqar

#2194827

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

I noticed that your view "Shiur Directory" is set to show posts from 3 post types:
1. Shiur Locations
2. Shiurim
3. People

But these post types, don't have any common address type custom field, which can be used for the view's distance-based search and to show map markers.

The "Shiur Locations" post type, has an address type custom field with slug "address".

The "People" post type, has an address type custom field with slug "shiur-contact-address".

And the "Shiurim" post type, doesn't have any address type custom field.

If you want the view to show posts from all these post types, along with showing their location markers on the map and also use distance-based search, then you'll need to make sure that these post types include an address type custom field with the same slug.

In case, you have some different requirements or expectations from these post types and the view, you're welcome to share the details and I'll be able to assist you accordingly.

To show the search fields and the submit button in a grid/columns, you can include a grid block and set it to show the number of desired columns for each search field. After that, you can drag and drop the search field blocks, into these grid columns. We have a detailed video tutorial on this topic at:
https://toolset.com/lesson-placement/lesson-placements-1622935-1621213/#style-the-search-box-and-results

Your screenshot shows the normal block-based editor Gutenberg. You can learn more about this new default WordPress editor environment at:
https://wordpress.org/gutenberg/

Tip: If you'd like more width to be available for editing, you can set the maximum editor width to 100%.
( example screenshot: hidden link )

#2194921

Hi,

My goal is to just show the results of the "Shiur Locations" address on the map. But I need the search bar/filters to search through all post types because each post type is holding certain information that's needed. (ex: filter by "language" which is in "Shiurim" post type, and also filter by "Name of Person" which is in the "People" Post Type, and also to search by Location, which is inside the "Shiur Location" post type.

Then, underneath in the loop, I want it to coincide and display by nearest location together with the map, but also show the other embedded information that I already input.

After playing around with it I may have got it working, but if you can double check that would be great.

I had another question, am I able to create one form that'll "sync" to all post types? I would like guests to be able to submit info, but not have to do it through 3 separate forms for each post type. Is there a way to combine the fields I would like for them to enter into one form?

I also was wondering what is the best/easiest way to bulk import listings for this directory that I created? I have 3 CSV spreadsheets with all the fields that I created in each of the 3 post types, I would like to import each spreadsheet into each post type so that it all uploads correctly, though under the "Import/Export" tab, I only see XML options and things I don't understand.

Thank You

#2198721

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

As I mentioned in the other ticket, I can access the "DY Directory" page on the front-end, but, I still can't access it from the back-end editor as there are many "403 forbidden" errors in the browser console. It seems some security plugin or server's security policy is blocking the block editor's requests.

If you see any more information about these errors in the server's error logs, you're welcome to share it here.

Your observation about the Toolset Forms is correct and each form can be used to enter information in a single post type, only. As there is no built-in feature available to achieve this using a single form, you'll need a fair amount of customization for this and you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

There are a number of third-party plugins available that can be used to import posts/listings in WordPress and we have a detailed guide on the topic at:
https://toolset.com/course-lesson/how-to-import-content-into-wordpress-using-csv/

#2199281

Thanks for the plugin recommendation, and for sending me the link for contractors!

I just had a couple more questions and I think I'm good to go. The same way you sent me the shortcode with the HTML wrapped for the phone number, is there also a way to do that for maps? Meaning, I want inside the fields and text block to wrap the shortcode for the address of the location in a clickable a href shortcode so that users can get sent straight to Google Maps.

I figured out how to nest the Views thanks so much for letting me know it must be done in classic editor, though I'm still having an issue with the search bar. I am trying to add a filter for data from the nested CPT in the view, but when I add the filter to the search bar, no results are being displayed when I test it. Do you know if there's something to toggle on in order for the search bar to pick up on displayed the nested views? Also for the map marker- right now it is only showing the address from the main CPT, but I want to display additional info in the map marker popup that is from a separate CPT, is that possible?

Thank You!

#2202621

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for the update and glad that my message helped.

As per our support policy, we encourage starting a new ticket for each new question or concern.
( ref: https://toolset.com/toolset-support-policy/ )

You're welcome to mark this ticket as resolved and I'll answer your other questions, in their respective separate tickets.

#2203079

Hi Waqar,

I looked back at one of the messages you sent me that I believe may be the solution to one of my problems, which is this:

"If you want the view to show posts from all these post types, along with showing their location markers on the map and also use distance-based search, then you'll need to make sure that these post types include an address type custom field with the same slug."

I attempted doing that, but got a "Warning: slug already in use" and it is not letting me save the same slug. What can I do to make this work?

Thank you

#2208591

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting and please accept my sincere apologies for the delay in reply to your recent tickets.

We had an unusually busy forum queue this week, due to which I couldn't follow up on your tickets sooner. But, I already have your website's clone on my test server and will be able to reply to all your tickets, shortly.

> I attempted doing that, but got a "Warning: slug already in use" and it is not letting me save the same slug. What can I do to make this work?

- Your observation is correct and if a custom field with a specific slug is registered in one post field group, the same slug can't be used to register another custom field, in a different field group.

For cases, where you need to use the same slug custom field for multiple post types, you can create a new common custom field group that is attached to all the target post types and register that common custom field in that field group. This way, that field will be available for all those post types.

For example, you can add a new field group named something like "Map Locations" and attach it to all the post types which you'd like to use a common address type custom field. And in that field group, you can register a new address type custom field, so that it is available in all the post types that you need.

#2209565

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.