2013-11-13, 00:57:40
(2011-01-23, 03:47:19)mvlcek Wrote: Update: INVALID as of version 1.0
The I18N Search plugin now provides functions to display all tags in a size proportional to their frequency. For a enhanced search where the user can select tags, include the following in your template or (with the DynPages plugin) a component:
Code:<form action="<?php echo find_url('search', null); ?>">
<div class="tags"><?php get_i18n_tags(60,250); ?></div>
<input type="hidden" name="tags" value="<?php echo htmlspecialchars(@$_REQUEST['tags'])?>"/>
<input type="text" name="words" value="<?php echo htmlspecialchars(@$_REQUEST['words'])?>"/>
<input type="submit" name="search" value="Go" />
</form>
<script type="text/javascript">
$(function() {
$('.tags .tag').click(function(e) {
$(e.target).toggleClass('selected');
var tags = ''
$('.tags .tag.selected').each(function() { tags += ' '+$(this).text(); });
$('[name=tags]').val(tags);
});
var tags = $('[name=tags]').val().split(' ');
$('.tags .tag').each(function() {
if ($.inArray($(this).text(),tags) >= 0) $(this).addClass('selected');
});
})
</script>
<br />
<?php
if (isset($_REQUEST['search'])) {
?>
<h2>Search Results</h2>
<?php
get_i18n_search_results(null, null, 'No results found' , 'l, F jS, Y - g:i A', 10, 30);
}
?>
An example can be found on http://mvlcek.bplaced.net/search
(2013-11-13, 00:23:57)mvlcek Wrote:(2013-11-12, 23:36:26)AliAbabwa Wrote:(2011-01-23, 03:47:19)mvlcek Wrote: Update: INVALID as of version 1.0
The I18N Search plugin now provides functions to display all tags in a size proportional to their frequency.
...
I make component "search" with this code and include it in to search page: {% search %}
http://sc-racing.ru/search/
But I can't select the tags like your example http://mvlcek.bplaced.net/search
As you can see at the top of the quoted post, this code is invalid since version 1.0 of the Search plugin.
Just add (% searchform %) to your page and make sure you have enabled "Show tag cloud" in the I18N Search Settings (Tab Plugins).
Thank's for soon answer, Mvlcek!!
I add (% searchform %) to search page http://sc-racing.ru/search/
and enable "Show tag cloud" in the I18N Search Settings (Tab Plugins).
But tags is still simple text without selecting.
I still can't select the tags like your example
http://mvlcek.bplaced.net/search