Skip Navigation

[Resolved] View filter by post search with populate terms such as post title

This support ticket is created 4 years, 3 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
- 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 37 replies, has 2 voices.

Last updated by davidJ-4 4 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1794929
Edit-Content-Template-‹-Hey-Qween-TV-—-WordPress.jpg

I am creating a content template and I want to dynamically populate the post search filter text field with the post title. Is this possible?

Please guide me how to do it.

I'm attaching a screenshot to illustrate what I'm looking for.

#1796419

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand - you want to filter your view with dynamic value of post title. if this is correct - yes, its possible.

You should set your view to use the option "Search for a text set by the view shortcode attribute" and add the shortcode attribute name searchstr

Then, you should try to add your view with shortcode attribute searchstr and assign the dynamic title value to it. For example:

[wpv-view name="your-view-slug" searchstr="[wpv-post-title]"]

Where:
- change 'your-view-slug' with your original view slug.

More info:
=> https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

If this is not the case and if I misunderstood your requirement, please correct me and I will be happy to guide you in the right direction.

#1798117
Edit-Content-Template-‹-Hey-Qween-TV-—-WordPress1.jpg

Thank you for your response and yes you are correct, I want to filter the view with dynamic valuet of post title.

I must be doing something wrong because the option I enter I get an error when I save the filter. For the the option "Search for a text set by the view shortcode attribute", I entered the following: wpv-post-title.

I have attached a screenshot that shows the error

#1799993

Minesh
Supporter

Languages: English (English )

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

you need to add the searchstr instead of wpv-post-title to the input box for the option "Search for a text set by the view shortcode attribute"

#1803975

I added "searchstr" and saved the filter. But how do I make the search string filter by the post title?

#1803977

Minesh
Supporter

Languages: English (English )

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

You will require to add your view like this:

[wpv-view name="your-view-slug" searchstr="[wpv-post-title]"]

Where:
- As you can see we are passing the [wpv-post-title] shortcode that will pass the dynamic title value to the shortcode attribute searchstr.

#1809399
Edit-Content-Template-‹-Hey-Qween-TV-—-WordPress 2.jpg

What I don't understand is why do I need a view shortcode when I am building the view in a custom post template with gutenberg toolset block.

#1809843

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL where I can see the Block view you created as well as access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#1811907

Minesh
Supporter

Languages: English (English )

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

Unfortunately when I try to access the wp-admin I get a blank page with message:

Forbidden
You do not have permission to access this document. 

Can you please make sure the site should be accessible at this end.

#1811917

Okay. Just contacted the hosting, could you please try it again and let me know how it goes. Thanks

#1811951

Minesh
Supporter

Languages: English (English )

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

Thank you. Yes, I can access the admin login page but the access details you shared is not working at this end.

Can you please make sure you pass me working admin access details.

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

#1812029

Sorry about that. The login credentials are the same. This time I made sure that the password matches what I sent you. Sorry for not testing it first 😉 Also, if you need to use the ftp, I would need your IP address to allow the access to you. Thank you.

#1812105

Minesh
Supporter

Languages: English (English )

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

Thank you. Now I able to login to admin.

I checked your content template and I'm not sure what view you would like to add as I do not find any view is added to the content template you created using block:
=> hidden link

I see many block view you created with the view's listing page. Can you please confirm what view you would like to add exactly where?
=> hidden link

#1812263

The view I am using is called "Qweens with Hey Qween" and it is the grid with 3 columns.

#1812309

Minesh
Supporter

Languages: English (English )

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

When you are using Blocks, there is no way to pass the shortcode attribute.

So, I've added the "Fields and Text" block and then I've added your view as given under to the Content Template you created:
=> hidden link

[wpv-view name="qweens-with-hey-qween" searchstr="[wpv-post-title]"]

Can you please confirm it works as expected?