Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Article custom search in custom fields
Hi,
I would like to list articles base on search terms from a URL parameter that will search for any match in specific custom fields contains that term please.
For example:
<txp:article_custom section="music" form="myform" title="{search term}" artist_name="{search term}" song_title="{search term}" />
Or better:
<txp:article_custom section="music" form="myform" search_term="example" search_fields="title,artist_name,song_title" />
What is the right syntax for doing this please?
or should I use PHP or a plugin? if so I would appreciate an example please.
Offline
Re: Article custom search in custom fields
I found smd_query plugin to be useful for this as:
<txp:smd_query
form="myform"
column="*"
table="textpattern"
where="
section='music'
AND concat(title,custom_1,custom_2) like '%search term%'
AND Status IN(4)
"
/>
Last edited by THE BLUE DRAGON (2020-12-20 16:10:37)
Offline
Re: Article custom search in custom fields
I’d love to see the site you are working on. I wish I could help you with your queries, but they are admittedly well beyond my knowledge.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Article custom search in custom fields
colak wrote #327697:
I’d love to see the site you are working on. I wish I could help you with your queries, but they are admittedly well beyond my knowledge.
Thanks, I will publish it when finished, I’m learning a lot while developing it, so it is a slow progress but hopefully will finish soon :)
Offline