HI,
What I am trying to achieve is that, creating a search form along with other dropdown values.
Explanation:
I do have search inputs like this:
input type text = for keywords to search
dropdown = for the category to search under
dropdown = for location to search under
I have achieved performing filter search based on dropdown values ( as taught in 'filter search' tips and trick). however, implementing a search with keywords is giving me a hard time.
pages tag look like this:
where 'user_type' is hardcoded and 'filter_string' is coming from dropdowns and giving output like this:
category=cat1 | location=australia
filter_string has not implement the keyword functionality yet.
currently i have separate form for dropdowns and keyword but can be merged together. filter dropdown is separate from search input. user can search only with using dropdown filters altogether.
Trials:
I have tried implementing :
custom_field=search_string : even hardcoded string didn't work ( I don't know why!)
custom_field="user_type=ABC | <cms:show filter_string /> | <cms:show search_string />"
I tried forming a search_string and using it in custom_field like this: custom_field="k_page_name=search_string"
but its is giving me error that k_page_name is not defined in user template
code snippets: search form
code snippets: dropdown form
Alternate Approach:
Can I use custom_field property in 'search' tag? so that I can use keywords property to search keyword along with the custom_field.
Another Question:
How can I search for a specific editable field of type text/textarea?Like:
I have an editable textarea with some content in it. I want the search keyword to search only within that textarea? either using through pages tag or search tag?
any help is appreciated!
thanks
What I am trying to achieve is that, creating a search form along with other dropdown values.
Explanation:
I do have search inputs like this:
input type text = for keywords to search
dropdown = for the category to search under
dropdown = for location to search under
I have achieved performing filter search based on dropdown values ( as taught in 'filter search' tips and trick). however, implementing a search with keywords is giving me a hard time.
pages tag look like this:
- Code: Select all
<cms:pages masterpage=k_user_template custom_field="user_type=ABC | <cms:show filter_string />" limit='30' paginate='1'>
where 'user_type' is hardcoded and 'filter_string' is coming from dropdowns and giving output like this:
category=cat1 | location=australia
filter_string has not implement the keyword functionality yet.
currently i have separate form for dropdowns and keyword but can be merged together. filter dropdown is separate from search input. user can search only with using dropdown filters altogether.
Trials:
I have tried implementing :
custom_field=search_string : even hardcoded string didn't work ( I don't know why!)
custom_field="user_type=ABC | <cms:show filter_string /> | <cms:show search_string />"
I tried forming a search_string and using it in custom_field like this: custom_field="k_page_name=search_string"
but its is giving me error that k_page_name is not defined in user template
code snippets: search form
- Code: Select all
<cms:capture into='e_search'>
<cms:form name="e_search" anchor='0'>
<cms:if k_success>
<cms:if frm_search!='' >
<cms:set search_string=frm_search scope='global'/>
</cms:if>
</cms:if>
<cms:input type="text" name='search' placeholder="Search..." />
<button type="submit"><i data-feather="search"></i></button>
</cms:form>
</cms:capture>
code snippets: dropdown form
- Code: Select all
<cms:capture into='e_filter'>
<cms:form name="filter" anchor='0'>
<cms:if k_success>
<cms:if frm_category!='-' >
<cms:set filter_string="<cms:concat filter_string ' | category=' frm_category/>" scope='global'/>
</cms:if>
<cms:if frm_location!='-' >
<cms:set filter_string="<cms:concat filter_string ' | location=' frm_location />" scope='global'/>
</cms:if>
</cms:if>
<cms:input type="dropdown"
opt_values="Select category=-<cms:pages masterpage='category.php'>| <cms:show k_page_title/>=<cms:show k_page_name /></cms:pages>"
opt_selected='-'
name="category" />
<cms:input type="dropdown"
opt_values="Select Location=-<cms:pages masterpage='location.php'>| <cms:show k_page_title/>=<cms:show k_page_name /></cms:pages>"
opt_selected='-'
name="location" />
<div >
<button type='submit' class="btn-primary">Apply Filter</button>
</div>
</cms:form>
</cms:capture>
Alternate Approach:
Can I use custom_field property in 'search' tag? so that I can use keywords property to search keyword along with the custom_field.
Another Question:
How can I search for a specific editable field of type text/textarea?Like:
I have an editable textarea with some content in it. I want the search keyword to search only within that textarea? either using through pages tag or search tag?
any help is appreciated!
thanks