How to make a content item used as 404 page, or any other item, to be unsearchable

More
9 years 6 months ago - 9 years 6 months ago #54790 by ggppdk
Hello

you can try to use multi-categories view with text search,

Try:
- create a menu item to link to multi-category view, selecting none categories (aka ALL)
(also you may enable field filters in it)

- you can create a simple form module and

1. set as action of the form the above menu URL
add a text input with field name 'filter'
e.g.
Code:
<form action="..."> Search: <input type="text" name="filter"/> <input type="submit" value="submit"/> </form>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 9 years 6 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago - 9 years 5 months ago #54795 by pipedream
Thanks.

Just created the menu item and then added the searchword query variable, but nothing changed.

So, the url www.mysite.com/index.php?option=com_flex...ategory&layout=mcats gives the same results as www.mysite.com/index.php?option=com_flex...s&searchword=vinegar , ie all the items.

Did you mean perhaps adding &filter=searchword...

Well... while I was writing this I just saw that you edited your post and, in fact, the query variable should be filter. :)

This solution is only to prevent having duplicate results in the default Portuguese language, right?
Bu then I would also loose autocomplete for it and highlighting in the search results page. :(

I guess it might be simpler to have a hack to prevent both autocomplete in alternative languages and duplicate search results in the default language, don't you think so?
Last edit: 9 years 5 months ago by pipedream.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #54806 by pipedream
I already solved how to disable autocomplete to happen in alternative languages when using Falang.
I was thinking of having a different menu and module, but I guess the following is more easy, clean and can avoid future similar issues from other users:

So, instead of only:
Code:
$search_autocomplete = $params->get( 'search_autocomplete', 1 );
This should solve it:
Code:
$search_autocomplete = ($params->get('flexi_fish') && flexicontent_html::getUserCurrentLang() != substr(flexicontent_html::getSiteDefaultLang(),0,2) ) ? 0 : $params->get( 'search_autocomplete', 1 ) ;
If you confirm this, I can create a PR and insert this code in the module and component (and maybe elsewhere?).

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago - 9 years 5 months ago #54813 by pipedream
Just solved also the duplicate results with a solution you might also consider to integrate, should it be fit for other duplicate situations (when people choose more than one search plugin at the same time).

So, in the function getData, file "components/com_flexicontent/models/search.php", I changed from this:
Code:
$rows = array(); foreach($results AS $result) { $rows = array_merge( (array) $rows, (array) $result); }
To this:
Code:
$slugs = array(); $rows = $results[0]; foreach($rows as $row) { $slugs[] = $row->slug; } for($i = 1, $ti = count($results); $i < $ti; $i++) { $result = $results[$i]; for($j = 0, $tj = count($result); $j < $tj; $j++) { if(!in_array($result[$j]->slug, $slugs)) { $rows[] = $result[$j]; $slugs[] = $result[$j]->slug; } } }
Don't know if this can mess with other possibilities, but it is working okay for me.
Again, if you wish I can submit a PR with this code.
Last edit: 9 years 5 months ago by pipedream.

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #54815 by pipedream
Despite the 2 additional problems being solved, the original question still remains to be answered. :(
Any new thoughts on it?
Thanks again.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 1.224 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline