I am trying to: Add an ID to the search input and FOR to the label. But an example in one of the forums wasn't working.
Here is what I have:
<div class="forum-group">
<label>[wpml-string context="wpv-views" for="search-form"]SEARCH FORUMS[/wpml-string]</label>
<div class="forum-search-bar">[wpv-filter-search-box output="bootstrap" id="search-forums"][wpv-filter-submit type="button" output="bootstrap" class="forum-search-submit"]</div>
</div>
Let me know what I am doing wrong here.
Thanks.
Hi,
Thanks for contacting support. I'll do my best to help you with your question.
The wpml-string does not take any other parameters other than "context" and "name".
For more information check this link: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-464327
You can add the "for" attribute to the "label" HTML element like so:
<label for="search-form">[wpml-string context="wpv-views"]SEARCH FORUMS[/wpml-string]
</label>
Similarly, the wpv-filter-search-box shortcode does not have attribute for ID but you can add it to the HTML button element:
<div class="forum-search-bar" id="search-forums">[wpv-filter-search-box output="bootstrap"][wpv-filter-submit type="button" output="bootstrap" class="forum-search-submit"]</div>
</div>
You can use the class attribute too instead of using an ID
<div class="forum-search-bar">[wpv-filter-search-box output="bootstrap" class="search-forums"][wpv-filter-submit type="button" output="bootstrap" class="forum-search-submit"]</div>
</div>
Hope that helps,
Ricardo