Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
searching for custom field (i18n_search)
#1
Hi there,

how can i search for a custom field (checkbox)?
Code:
<?php get_i18n_search_results(array('myCheckbox'=>'on','order'=>'date','max'=>6, ...)); ?>

doesn't show any result :-(
Reply
#2
(2013-02-07, 02:47:45)Alexander_ Wrote: how can i search for a custom field (checkbox)?

I18N Search is a full text search engine: you can index custom fields, if you check "index" in the I18N Custom Fields Settings, but the content of the fields is just added to the full text index.
You cannot search for a specific value in a custom field.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
(2013-02-07, 03:03:21)mvlcek Wrote: You cannot search for a specific value in a custom field.

Thx.

I'm doing it now this way: define a custom field "listthis" as dropdown with the possible values "yes" and "no". In edit.php change the line
Code:
echo '<option'.$attrs.'>'.$option.'</option>';
into
Code:
echo '<option'.$attrs.' value="secret_'.$option.'">'.$option.'</option>';>'.$option.'</option>';
and in the template search for
Code:
<?php get_i18n_search_results(array('words'=>'secret_yes','order'=>'date', ... ?>
Now all and only the pages are listed which have the custom field "listthis" containing the value "yes". It seems to work and I can't see any drawbacks. Do you?
Reply




Users browsing this thread: 1 Guest(s)