solved How to confine search within module to one tag

Ceri
Ceri
@adolygwr
6 years ago
370 posts
Hi ...I was wondering how to create a search box which searches the audio module BUT only with reference to one tag. Basically I want to insert a search box on a new landing page I am creating which will show results from the audio module 'welsh pronunciation audio' tag but NOT from the rest of the audio module. I have the following code which confines search to the module but I dont know what to add to confine search to the tag, or even if this is possible?

<div style="white-space:nowrap">
    <form action="https://americymru.net/search/results/jrAudio/1/4" method="get" style="margin-bottom:0">
    <input id="search_input" type="text" name="search_string" style="width:60%" class="form_text" placeholder="" onkeypress="if (event && event.keyCode == 13 && this.value.length > 0) { $(this).closest('form').submit(); }">&nbsp;<input type="submit" class="form_button" value="search">
    </form>
</div>



--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 01/09/19 04:23:22AM
Ceri
Ceri
@adolygwr
6 years ago
370 posts
Any ideas?


--
Ceri Shaw - AmeriCymru
paul
@paul
6 years ago
4,326 posts
Hi Ceri - Sorry for the delay on this.
Probably the easiest way to do this is to build a custom search results page just for these audio items, so change the form action url to "https://americymru.net/welsh-pronunciation-audio-results", say, the either using SiteBuilder or by creating a skin template of that name, include this jrCore_list call to show the search results -

{if isset($_post.search_string) && strlen($_post.search_string) >= 3}
    {jrCore_list module="jrAudio" search1="audio_title LIKE %`$_post.search_string`%" search2="audio_tags LIKE %welsh pronunciation audio%"}
{/if}

hth


--
Paul Asher - JR Developer and System Import Specialist