Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search plugin (I18N)
Hi,

I have the rendering component working OK, but can't get my custom image field shown, I can't even get the link text displayed (live site here http://textplusdata.se/)

I have this in the body of my front page:

Code:
(% searchresults tags:blog i18n=0 numWords:30 HEADER:'' component:i18n-blog-list-thumbnails %)

and this is the component:

Code:
<h3 class="search-entry-title">
  <?php if ($showLanguage) { ?>
  <span class="search-entry-language">
    <?php echo htmlspecialchars($item->language, ENT_NOQUOTES); ?>
  </span>
  <?php } ?>
  <a href="<?php echo $item->link; ?>">
    <?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?>
  </a>
  
    <?php echo '<img src="'; echo ($item->blog-thumbnail);echo '">' ?>
  <?php echo ($item->blog-thumbnail); ?>
</h3>
<?php if ($showDate) { ?>
<div class="search-entry-date">
  <?php echo strftime($dateFormat, $item->pubDate); ?>
</div>
<?php } ?>
<div class="search-entry-excerpt">
  <?php echo $item->getExcerpt($item->content, $numWords); ?>
</div>
<div>[<a href="<?php echo $item->link; ?>">more</a>]</div>

$item->blog-thumbnail doesn't seem to call anything and just results in "0" when echoed directly.

Am I doing something wrong? The field definitely exists and works when the search is customised on the Special Page itself using this code:

Code:
<a href="<?php get_special_field('link','',false); ?>">
    <?php if (return_special_field('blog-thumbnail')!='') { echo '<img src="'; get_special_field('blog-thumbnail','',false); echo '">'; } else echo ""; ?>
Reply
(2013-11-13, 06:28:01)jonscrut Wrote: $item->blog-thumbnail doesn't seem to call anything and just results in "0" when echoed directly.

Don't use - in field names. In PHP the above is a subtraction $item->blog - thumbnail, where neither operand is defined, thus nothing is output.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-11-13, 06:35:51)mvlcek Wrote:
(2013-11-13, 06:28:01)jonscrut Wrote: $item->blog-thumbnail doesn't seem to call anything and just results in "0" when echoed directly.

Don't use - in field names. In PHP the above is a subtraction $item->blog - thumbnail, where neither operand is defined, thus nothing is output.

Woah, that was quick!

Thanks for the correction, works great!
Reply
Mvlcek, I understood!!
It must be include in css file:
.tags .tag {
cursor: pointer;
}
.tags .tag.selected, .tags .tag.selected.unavailable {
color: #719471;
}
.tags .tag.unavailable {
color: #D3D3D3;
}

P.S. But by default this style is unavailable in your plugin http://get-simple.info/extend/plugin/i18n/82/
Reply
Dear Mvlcek!!

(% searchresults live=1 showPaging=1 max=10 %)

Why there is no pagination in live search?

http://sc-racing.ru/search/
Reply
Who has realized advanced search i18n_search?
Reply
(2013-11-14, 19:39:23)AliAbabwa Wrote: Dear Mvlcek!!

(% searchresults live=1 showPaging=1 max=10 %)

Why there is no pagination in live search?

http://sc-racing.ru/search/

What code is in the search result tag of two words?
PHP Code:
< ? php get_i18n_search_results(array('tags'=>'news day','DATE_FORMAT'=>'','max'=>1,'i18n'=>0,'lang'=>'','numWords'=>3,'order'=>'date','showPaging'=>0,'HEADER'=>'')); ? > 
Reply
Hello...
I have a problem, please help me Sad Sad
I have 4 menu (page):
Techno | Lifestyle | Health | Travel

I need to update all of them, (Each post have a pictures). I mean to update all of that menu (page), i use 2 news manager plugin:
-"News manager updated" (for Techno's page),
-"GS Blog" (for Lifestyle's page).

But i don't know how to make more plugin for the rest menu, maybe u know??
So i think, i will use "Search Plugin (I18N)", but my question is :
1. How to display the "(% searchresults %)" without "(% searchform %)"??
2. How to display a picture at the "(% searchresults %)"??
I mean the result will be like news manager

Thank you very much for your attention, please help me.
Reply
(2014-01-13, 01:00:15)n4shru11 Wrote: Hello...
I have a problem, please help me Sad Sad
I have 4 menu (page):
Techno | Lifestyle | Health | Travel

I need to update all of them, (Each post have a pictures). I mean to update all of that menu (page), i use 2 news manager plugin:
-"News manager updated" (for Techno's page),
-"GS Blog" (for Lifestyle's page).

But i don't know how to make more plugin for the rest menu, maybe u know??
So i think, i will use "Search Plugin (I18N)", but my question is :
1. How to display the "(% searchresults %)" without "(% searchform %)"??
2. How to display a picture at the "(% searchresults %)"??
I mean the result will be like news manager

Thank you very much for your attention, please help me.

I don't really understand your problem, but I'll answer your questions:
1. Just add the tags and/or search words, e.g. (% searchresults tags="techno" words="tablet" %)
2. You have to use custom rendering
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2014-01-13, 01:27:53)mvlcek Wrote:
(2014-01-13, 01:00:15)n4shru11 Wrote: Hello...
I have a problem, please help me Sad Sad
I have 4 menu (page):
Techno | Lifestyle | Health | Travel

I need to update all of them, (Each post have a pictures). I mean to update all of that menu (page), i use 2 news manager plugin:
-"News manager updated" (for Techno's page),
-"GS Blog" (for Lifestyle's page).

But i don't know how to make more plugin for the rest menu, maybe u know??
So i think, i will use "Search Plugin (I18N)", but my question is :
1. How to display the "(% searchresults %)" without "(% searchform %)"??
2. How to display a picture at the "(% searchresults %)"??
I mean the result will be like news manager

Thank you very much for your attention, please help me.

I don't really understand your problem, but I'll answer your questions:
1. Just add the tags and/or search words, e.g. (% searchresults tags="techno" words="tablet" %)
2. You have to use custom rendering

Hehe, sorry if u don't understand, maybe cs my bad english, but thank u very much for the reply. Smile
I have tried (% searchresults tags="techno" %). It's work, hehe...

And i have read this custom rendering but i still can't figure out how to display a picture???
Please help me.
Reply
Anyone please help me. Sad Sad
Reply
try to insert an image in the first paragraph of the news, and at the page the code
Code:
(% searchresults tags:techno DATE_FORMAT:"%d %b %Y - %H:%M" order:created showPaging:1 numWords:2p HEADER="" %)
Reply
(2014-01-14, 15:23:10)Oleg06 Wrote: try to insert an image in the first paragraph of the news, and at the page the code
Code:
(% searchresults tags:techno DATE_FORMAT:"%d %b %Y - %H:%M" order:created showPaging:1 numWords:2p HEADER="" %)

It's work.
Thank u thank u very much Smile
Reply
Mvlcek: is it possible to change underscores to dashes in tags urls, consisting of two and more words ? I've tried changing all "_" in searcher and indexer class, but it messes up search results. Obviously I can't change all instances of "_"

edit:
tags.php line: 83
indexer.class l:192,194
searcher.class l: 350,352
Addons: blue business theme, Online Visitors, Notepad
Reply
Hello,

I am using special pages for a products' catalog, and I18Nsearch to extract data from it. The catalog has 2 fields which are indexed "as tag".
If I perform the search using the following:

(% searchresults showLanguage:0 tags=tag1 %)
(% searchresults showLanguage:0 tags=tag2 %)

it displays twice the same page (because tag1 and tag2 are on the same page). On the contrary, if I am using

(% searchresults showLanguage:0 tags=tag1,tag2 %)

it says "no results found".

What am I missing?
Thanks for your help.
Reply
(2014-02-24, 12:49:06)GPB61 Wrote: I am using special pages for a products' catalog, and I18Nsearch to extract data from it. The catalog has 2 fields which are indexed "as tag".
If I perform the search using the following:

(% searchresults showLanguage:0 tags=tag1 %)
(% searchresults showLanguage:0 tags=tag2 %)

it displays twice the same page (because tag1 and tag2 are on the same page). On the contrary, if I am using

(% searchresults showLanguage:0 tags=tag1,tag2 %)

it says "no results found".

Tags (and words) need to be separated by a blank:

(% searchresults showLanguage:0 tags="tag1 tag2" %)

If the tag contains blanks, replace them by _, e.g.

(% searchresults showLanguage:0 tags="tag_with_blanks tag2" %)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2014-02-24, 19:19:35)mvlcek Wrote: Tags (and words) need to be separated by a blank:

(% searchresults showLanguage:0 tags="tag1 tag2" %)

If the tag contains blanks, replace them by _, e.g.

(% searchresults showLanguage:0 tags="tag_with_blanks tag2" %)

So, no blanks in the tag (or separated by underscore) and blanks in the code.
Now it works perfectly, thank you very much, greatly appreciated!
GP
Reply
Hi everybody!
I'm happily using I18n special pages, but I noticed a bug !
When I switch to a different language than default, my previous posts don't keep the Menu Order I previously set in the Admin area.

I'm calling them with this code:
PHP Code:
<?php get_i18n_search_results(array('tags'=>'_special_events','dateFormat'=>'%d.%m.%Y','component'=>'lista','order'=>'+menuOrder','lang'=>$language)); ?>

This code works perfectly in default language though...

Any hint or fix for this?
Thank you|
Have a nice day.
Ed
Reply
I18N Search version 2.11.1:
  • private non-default language pages are now excluded from the search index (@ds10)
  • correctly indexes the virtual tags _parent_* and _menu also for non-default language pages
  • allows sorting by menuOrder also for non-default language pages (@nnk)
  • french translation (thanks to @SHUK91)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hello,

Is it possible to append further classes within the opening <ul class="search-results"> (i.e.: <ul class="search-results class1 class 2 ...">) onto the search results page?
Of course it is possible by tweaking the plugin, but doing so I would append those classes to all the performed searches, while I was wondering if it is possible to do it through a component or a function, so that it can be selctively used only when needed.
Thank you very much for this powerful plugin.
GPB
Reply
That I wanted ever, thanks for this mvlcek.
Reply
(2014-03-06, 23:55:07)GPB61 Wrote: Is it possible to append further classes within the opening <ul class="search-results"> (i.e.: <ul class="search-results class1 class 2 ...">) onto the search results page?

That's currently not possible. But why do you need it?
In most cases it should be possible to define styles based on the context, e.g. use something like #content .search-results li { ... } for the styles in the content area and [i]#sidebar .search-results li { ... }[/li] for formatting the results in the sidebar. You can also add classes to your content-div or the body based on the page slug or some custom field to change the styling of the search results.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Yes, indeed, and this is what I am usually doing.
However, my question was to verify the possibility to use the plugin within some front-end frameworks (Bootstrap, UIKit, etc.).
In particular, by appending framework's classes within the <ul>, you can easily transform the single <li> into grid divs rather than as plain lists. And this, of course, would allow a better control over the page rendering, in particular for responsive web sites, or to improve the cross-browser compatibility.
However, to achieve this you are required to include the style classes (or, for some frameworks, the javascript calls) within the <ul> tag.
Of course, all the other modifications needed for the <li> can be easily achieved by using I18N special pages and its "search" tab.
Just to give you an example of what I am meaning, please have a look at http://getuikit.com/docs/grid.html from "Wrap multiple rows" on.
Thanks for the help
GPB
Reply
Hello

First many thanks to Mvlcek for excellent plugin Smile

I'm writing custom plugin for indexing/searching of News Manager posts based on i18n_search_dummy.
Everything works fine now but i noticed that its impossible to find words containing dots: "editgrid.com" for example (used in title).

Not only in my plugin but also in special pages.

Any sugestions how to patch ?

Thanks again,
Sebastian
Reply
(2014-03-08, 04:11:35)sbatko Wrote: I'm writing custom plugin for indexing/searching of News Manager posts based on i18n_search_dummy.
Everything works fine now but i noticed that its impossible to find words containing dots: "editgrid.com" for example (used in title).

Not only in my plugin but also in special pages.

The search plugin adds words to the index, and these words are defined as strings of "word characters", which in english probably is letters, digits, - and _, thus your example contains two words "editgrid" and "com".

You can patch the indexing by changing the regular expressions in addWords in indexer.class.php, but I'm not sure, if any other changes would need to be made. In any case you must make sure that you differentiate a dot within a word with the punctuation dot.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 4 Guest(s)