Hello,
I have a shortcode that displays the zip code :
[types field='code-postal] [/types]
On my view, this shortcode returns the value 06000 for example.
I need to create Custom field filter by zip code.
If i set 06000 with "Constant", it works perfectly.
But, I would like to filter the request according to the value of this shortcode automatically depending on the page.
But if I set the shortcode atribute, I get an error.
I tried with :
[types field='code-postal'][/types]
code-postal
[types field='code-postal']
I get the same error message :
Only lowercase letters and numbers allowed as shortcode attributes
How do I filter on what the shortcode [types field='code-postal'][/types] returns?
Thanks
Hello and thank you for contacting the Toolset support.
You are currently adding a whole shortcode instead of a shortcode attribute. For example, in the following shortcode:
[types field='code-postal'][/types]
field is the shortcode attribute, and 'code-postal' is the value passed to the shortcode attribute.
The attribute that you will enter in the filter, needs to be used in the view shortcode. Let's say, you name the attribute "support", you will pass data to it like this:
[wpv-view name="your-view-name-or-slug" support="value to pass to the view filter"]
Read more about passing arguments to a view in this article https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/
I hope this helps. Let me know if you have any questions.
Hello,
Thank you for your reply,
I can not do it...
I also see that you speak French.
Do you have the possibility of making a service against payment because I am a little in the urgency?
I have this problem to manage and I would also like to display the top closest cities on a city page.
Here is my skype: stephane.madaleno
It would be really great if I could give you admin access and pay you for setup.
Thank you
Thank you for the offer! I'll do my best to help you here within the support forum.
Allow me temporary access to your website, and explain as much as possible the details of what you would like to achieve.
- What post types, taxonomies, custom fields are involved.
- What page/URL are you working on?
- What views or content template you are working on?
- Any screenshots that would clarify would be helpful.
Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
If you need assistance from a developer, you may consider contacting one of our partners here https://toolset.com/contractors/
Merci beaucoup pour l'aide