Skip Navigation

[Gelöst] Add attributes to search elements

This support ticket is created vor 6 Jahre. 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.

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.

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Ricardo Alday vor 6 Jahre.

Assisted by: Ricardo Alday.

Author
Artikel
#680362

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.

#681498

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

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