Skip Navigation

[Resolved] Setting up business directory

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 6 replies, has 3 voices.

Last updated by Minesh 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2367081

Tell us what you are trying to do?
I am trying to re-create the business directory that currently exists on my client's Joomla-based site, which uses Mosets Tree.

Is there any documentation that you are following?
I have tried following various articles on your help site, but I find the structure and setup of Toolset frustrating.

Is there a similar example that we can see?
hidden link

What is the link to your site?
The site is currently under development and has restricted access

Requirements:
- Main directory page with alpha index sorting of listings
- Linked category names with total amount of listings per category
- Category name and description displayed on each individual category page
- Linked listing names displayed with additional fields on each individual category page
- Show more/less toggles to reveal/hide additional fields on each individual category page

#2367619

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Here is a sandbox site login, you can login to it and play with it:
- hidden link

Requirements:
- Main directory page with alpha index sorting of listings
===>
To create A-Z glossary list, its possible either two ways, either you setup A-Z as taxonomy or as new post type. Please check the following reference ticket where solution is mentioned:
=> https://toolset.com/forums/topic/az-glossary/#post-476253

- Linked category names with total amount of listings per category
===>
Once you create the taxonomy view, you can use the following shortcode to display taxonomy link and taxonomy post count:

[wpv-taxonomy-link] ([wpv-taxonomy-post-count]) 

- Category name and description displayed on each individual category page
===>
To display the caregory name and description, you should create taxonomy archive. Please check the following Doc:
-https://toolset.com/course-lesson/creating-a-custom-archive-page/

To display the taxonomy term description on archive page, you can use the shortcode:

[wpv-taxonomy-archive info="description"]

More info:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154477

- Linked listing names displayed with additional fields on each individual category page
===>
Within taxonomy archive's loop, you should add the post link to display the post title as link and add any other fields related to posts. Please check the taxonomy archive here:
- hidden link
(Backend- hidden link

- Show more/less toggles to reveal/hide additional fields on each individual category page
===>
For that either you will have to use the bootstrap toggle or use bind the element with custom jQuery.

I suggest you should go through the above test site and check and play with it to ensure what you can do with Toolset and how.

#2371053

Hello,

Thanks for the tips and links.

I have the alpha listing and the categories displayed, but cannot figure out how to build the view for the individual alphabet pages. These pages should display like: hidden link

Here are the parameters I have for the "Listings" post type view:

  • Content Selection: Post type > Listings
  • Query Options: Don't include current page in query result (checked)
  • Ordering: Post title - Ascending
  • Query Filter: Tried alpha listing taxonomy and directory categories. Both produced no results

Loop Editor code:

[wpv-layout-start]
  [wpv-view name="alpha-listing"]
  [wpv-items-found]
    <!-- wpv-loop-start -->
	<wpv-loop>
		[wpv-post-title]
	</wpv-loop>
	<!-- wpv-loop-end -->
  [/wpv-items-found]
  [wpv-no-items-found]
    <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
  [/wpv-no-items-found]
[wpv-layout-end]

Any help is greatly appreciated.

#2371433

Minesh
Supporter

Languages: English (English )

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

Can you please share admin access details and on what page you want to display alpha filer?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2374715

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Michael,

As Minesh is away, I will be assisting on his queue.

Can you let me know the page that you are listing out the category on ? Meaning the page where you want the information to be filtered by the taxonomy in the URL.

It should also be noted that wordpress does do this by default with the taxonomy archives but please let me know the page you're working with.

Thanks,
Shane

#2374779

Hello,

Here are the two pages:
This page (hidden link) should follow the same functionality and layout from this page (hidden link.

Hope this helps.

Cheers,

#2374963

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've added the following view filter using the "Code Snippet" plugin:
=> hidden link

add_filter('wpv_filter_query', 'func_filter_title_ by_first_letter_digit_glossary', 10, 2);
function by_first_letter_digit_glossary($query, $setting) {
 
global $wpdb;
     
if($setting['view_id'] == 5673) {
         
        if(isset($_GET['wpvalphabet']) and $_GET['wpvalphabet']!='' ){
             
             
            $first_char = $_GET['wpvalphabet'];
			if($first_char=='0-9'){
				
				 $postids = $wpdb->get_col($wpdb->prepare("SELECT ID
                                                        FROM        $wpdb->posts
                                                        WHERE       $wpdb->posts.post_title REGEXP '^[0-9]' 
                                                        AND post_type = '".$query['post_type'][0]."'
                                                        AND post_status = 'publish'
                                                        ORDER BY    $wpdb->posts.post_title")); 
				
			}
			else{
			
            $postids = $wpdb->get_col($wpdb->prepare("SELECT ID
                                                        FROM        $wpdb->posts
                                                        WHERE       SUBSTR($wpdb->posts.post_title,1,1) = %s
                                                        AND post_type = '".$query['post_type'][0]."'
                                                        AND post_status = 'publish'
                                                        ORDER BY    $wpdb->posts.post_title",$first_char)); 
			}
                                                         
            $query['post__in'] = $postids;
      }
  }
return $query;
}

Can you please confirm it works as expected now.

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