GetSimple Support Forum

Full Version: Search plugin (I18N)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Your site feeds are working for me now.
mvlcek Wrote:If you use the I18N plugin and get the RSS feed with an RSS client ...
More accurately, if your site visitors want to use a feed reader – it's an essential update.
hameau Wrote:More accurately, if your site visitors want to use a feed reader – it's an essential update.

You are of course right, i edited my previous post...
mvlcek,

an option for the search form which sets the value for the input field would be nice.

Code:
<input type="text" name="words" value="Suchbegriff eingeben"/>

Additionally, an id attribute ("search", "searchform" or similar?) for the form itself would be practical, easier to target with CSS.

Checked the docs in my site's plugin section and the output markup.
polyfragmented Wrote:an option for the search form which sets the value for the input field would be nice.

Code:
<input type="text" name="words" value="Suchbegriff eingeben"/>

Then the user would have to delete the text first - or you need to add Javascript to delete it, when the input gets the focus?

polyfragmented Wrote:Additionally, an id attribute ("search", "searchform" or similar?) for the form itself would be practical, easier to target with CSS.

The form is in a div with class search - easy to target. I won't use an id because you could have more then one search form on the page, e.g. one on the search page and one in the template for quick search.

Anyway, the form was more like an afterthought, because (without tag cloud) it's too simple.
You can easily create a search form component and include it with the DynPages plugin.
mvlcek Wrote:The form is in a div with class search - easy to target. I won't use an id because you could have more then one search form on the page, e.g. one on the search page and one in the template for quick search.
Anyway, the form was more like an afterthought, because (without tag cloud) it's too simple.
You can easily create a search form component and include it with the DynPages plugin.

Taken from the final markup (plugin version 1.2.1), that's why I asked for a CSS hook:

Code:
<form action="http://www.get-simple.de/suche/" method="POST">
  <input type="text" name="words" value=""/>
  <input type="submit" name="search" value="Suche starten" />
</form>

You're right about rolling your own search form which is what I'll start doing. Easy to add classes/ids or a wrapper.

As for the input field value, you're right about using Javascript, just thought it might be a nice addition for out-of-the-box usage. Totally personal opinion of course. I can add this myself no problem.
polyfragmented Wrote:[Taken from the final markup (plugin version 1.2.1), that's why I asked for a CSS hook:

Code:
<form action="http://www.get-simple.de/suche/" method="POST">
  <input type="text" name="words" value=""/>
  <input type="submit" name="search" value="Suche starten" />
</form>

You are right, there is no div - what I saw on my site was the div with the slug of the page as class name.
I will add a class "search" to the form.
I18N Search version 1.2.2 adds a class "search" to the search form.
Ok, this is probably basic but I'm certainly missing something here. I post:

(% searchform %)
(% searchresults %)

this into my page and in the view I don't get results back. What am I doing wrong?
When you say 'the view', do you mean when you click the button to preview the page? Because you'll only get the results if you actually search something using the form or place preset tags to search for within your (% searchresults %) parameters.
how to place the RSS in the sidebar?
Code:
(% searchrss name:news title:"Новости" lang:ru tags:news numWords:30 %)
Oleg06 Wrote:how to place the RSS in the sidebar?
Code:
(% searchrss name:news title:"Новости" lang:ru tags:news numWords:30 %)

You MUST place above RSS placeholder on a page (although this page need not be in the menu).
Then you can copy the link (it's the link to the page + the name) to your template or sidebar, e.g. (assuming the page's slug is rss):
Code:
<a href="/rss/?news"><img src="/plugins/i18n_search/images/rss.gif" alt="rss"/>Новости</a>
Angryboy Wrote:When you say 'the view', do you mean when you click the button to preview the page? Because you'll only get the results if you actually search something using the form or place preset tags to search for within your (% searchresults %) parameters.

Thanks everyone that replied. I believe i'm making some progress with the notion that you need to call to the tag. All has been extremely helpful.
I guess next step is how to define search results with the rss feed. I'll root around in the documentation as there has to be something on that. I'm trying to create a feed of latest article postings on my website.
There are two main ways you could approach this. Firstly, you can make a meta tag of the pages for your articles called 'articles', then post this as your RSS feed:

Code:
(% searchrss name:rss title:"RSS Feed" tags:articles numWords:30 %)

A second way accomodates more feed related items. So you can still give your article the tag 'articles', but instead ensure that the tag 'rss' is included. Then use this instead:

Code:
(% searchrss name:rss title:"RSS Feed" tags:rss numWords:30 %)

This way gives you slightly more control/flexibility over what goes into the feed. It isn't restricted solely to articles, and you can add any page you want to the feed so long as it has the 'rss' tag.
Anyway, that a custom field can be created and then have the rss search go to that table instead. I'm ok with adding it to the regular keyword field as it works, but would rather not have to include rss or article in the valuable meta tag area for seo purposes.

but appreciate the help..this is a great feature.
Got two things:

Pages set to 'private' are shown on results pages here. The page in question is http://www.get-simple.de/index/gs-weiter...nde-links/ which is positively set to private.

---

Despite having site, i18n and user language set to "de" (just checked), search results links got ?lang=de appended.

Code:
http://www.get-simple.de/index/gs-weiterfuehrende-links/?lang=de

I see that it's like this on your own site as well, but we don't actually compose multi-lingual pages. Can the appendage be removed somehow?
polyfragmented Wrote:Pages set to 'private' are shown on results pages here. The page in question is http://www.get-simple.de/index/gs-weiter...nde-links/ which is positively set to private.

I'll fix this.

polyfragmented Wrote:Despite having site, i18n and user language set to "de" (just checked), search results links got ?lang=de appended.

This is only done if you use the I18N plugin - of course you probably use it because of the navigation functionality ;-)

You can try to delete i18n_base.php (or rename to i18n_base.php.bak) and make sure you do not use get_i18n_component and get_i18n_content. Everything should still work (with the exception of the I18N pages view in the administration) and you should get links without lang parameter.
mvlcek Wrote:This is only done if you use the I18N plugin - of course you probably use it because of the navigation functionality ;-)
Indeed ;-) I wonder if you're planning on detaching navigation from I18N some day? Installing a multi-lingual plugin in order to get a hierarchical navigation... ;-)

mvlcek Wrote:You can try to delete i18n_base.php (or rename to i18n_base.php.bak)...
Works as described by you, thanks.
I'm in a dliemma now after applying the workaround:

since your page list kicks so much ass, I'm already missing it Big Grin

Any chance there will be another way to remove the ?lang= appendage sometime in the future?
polyfragmented Wrote:I'm in a dliemma now after applying the workaround:

since your page list kicks so much ass, I'm already missing it Big Grin

Any chance there will be another way to remove the ?lang= appendage sometime in the future?

You can patch i18n_search/searchresults.php: replace the 3rd line with
Code:
$is_i18n = false;
mvlcek Wrote:You can patch i18n_search/searchresults.php: replace the 3rd line with
Code:
$is_i18n = false;
Works, thanks.
How can I fetch entered search terms so I can display them with the results?
Example: You searched for the term(s) 'administration'

How can I programmatically include the text? Our search page is a (deliberately) visible page which can be found in the sitemap and search. If the user arrives on the page from the search form, I'd like to include above text. Oh, btw, the search form sits in the sidebar on each and every page ;-
polyfragmented Wrote:How can I fetch entered search terms so I can display them with the results?

Example: You searched for the term(s) 'administration'

And how can I programmatically include the text? Our search page is a (deliberately) visible page which can be found in the sitemap and search. If the user arrives on the page from the search form, I'd like to include above text.

Code:
<?php if (@$_REQUEST['words']) { ?>
You searched for the term(s) '<?php echo htmlspecialchars($_REQUEST['words']); ?>'
<?php } ?>

If you need in in the content of a page, you can use the DynPages plugin to include this code in a component.
Our posts (my edits) overlapped some, so I'm posting the search URL question here separately.

Is there a direct URL for the search in which I can include search terms?
I am looking into creating a Firefox Search Plugin for the German GS site. Those need an URL of the site which calls the search with appended search terms, e.g. www.domain.tld/search/?s=[searchterms]
polyfragmented Wrote:Our posts (my edits) overlapped some, so I'm posting the search URL question here separately.

Is there a direct URL for the search in which I can include search terms?
I am looking into creating a Firefox Search Plugin for the German GS site. Those need an URL of the site which calls the search with appended search terms, e.g. www.domain.tld/search/?s=[searchterms]

As you can see by looking at the search form, it is: http://my.site/search-result-page?words=searchtems
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29