Snippets

Snippets + sourcerer in articles search results

4 months 3 weeks ago #92657

Octav A's Avatar Octav A

Hello,
I need to use joomla default search results (not smart search).
For some articles i use snippets as multilanguage titles, using some php wth sourcerer to display the title in the user language. Sounds quite tricky but it works wonderful in all situations and all components, except search results. It does not display the title (snippet + sourcerer). What is interesting is that it shows correct category title, which is also generated by snippet + sourcerer.
Any ideas?

4 months 3 weeks ago #92658

Peter van Westen's Avatar Peter van Westen Admin

The default search sucks. It searches directly in the database for matches. So it won't match to anything that is the result of plugins. Not as titles and not as content.
It will trim parts of the results which can cause plugin tags to get split (only partially displayed). Meaning the plugin can't do anything with it anymore.

So short answer: no, not sure what is going on there. But is it worth it to figure out?

4 months 3 weeks ago #92659

Octav A's Avatar Octav A

For me individually is worth, because this will be like a magic for my project. On other side if this implies work and time from your side- time is money, and now, like many i am counting every cent.
But when i saw that category title (which is a php snippet) is displayed correctly - i thought maybe is possible to do the same for article title. If any idea comes to you when working please let know. Thanks.

4 months 3 weeks ago #92660

Peter van Westen's Avatar Peter van Westen Admin

So what is actually being showed as the title?

4 months 3 weeks ago #92661

Peter van Westen's Avatar Peter van Westen Admin

To illustrate the issue with the simple (read: stupid) search and plugins:

Create an article that just has the snippet:

{snippets apples}
And have that snippet contain something like:
An apple is a fruit.

Now search for 'fruit'. The article won't show.
Now search for 'snippet'.

4 months 3 weeks ago #92662

Octav A's Avatar Octav A

This is article title (two code country codes): "{snippet country-NL} | {snippet country-BE}"
where {snippet country-XX} is multilanguage country name and parent category the same format
in search results it displays: " | "
but parent category is displayed correctly as the snippet final output

4 months 3 weeks ago #92663

Peter van Westen's Avatar Peter van Westen Admin

Ok, but what is showing in the search results as the title? The {snippet} tags?

4 months 3 weeks ago #92664

Octav A's Avatar Octav A

I dont care what it searches, it searches from database title column which is "{snippet country-NL}" and is OK for me that user will find this only if he inputs NL and not Netherlands or any else but i need to display this snippet in search result
Peter van Westen wrote:

To illustrate the issue with the simple (read: stupid) search and plugins:

Create an article that just has the snippet:
{snippets apples}
And have that snippet contain something like:
An apple is a fruit.

Now search for 'fruit'. The article won't show.
Now search for 'snippet'.

4 months 3 weeks ago #92665

Peter van Westen's Avatar Peter van Westen Admin

Octav A wrote:

This is article title (two code country codes): "in search results it displays: " | "
sorry

4 months 3 weeks ago #92666

Peter van Westen's Avatar Peter van Westen Admin

Disable the Snippets system plugin. Then you can see what the search component is actually outputting (check the html output). And why Snippets can't handle that.

4 months 3 weeks ago #92667

Octav A's Avatar Octav A

Will come back to this later, now is late. Thanks for prompt reaction at this time