Search path

68 views
Skip to first unread message

César Goudouris

unread,
May 10, 2013, 8:04:06 AM5/10/13
to eea-facete...@googlegroups.com
How can I restrict the results to the current folder (and below) ?

Thanks

Alin Voinea

unread,
May 10, 2013, 8:33:49 AM5/10/13
to eea-facete...@googlegroups.com, César Goudouris
Hi César,

You can try the following:

1. Add a hidden Path facet and set it's default value to your folder location.
2. Add a hidden TAL Expression facet and set it's default value to python:context.absolute_url(1). If this doesn't work try python:'/Plone/' + context.absolute_url(1) - replace Plone with your Plone portal id.

If it still doesn't work add a Debugger facet and see the real query that is used by facetednavigation and adjust it accordingly. Don't forget to remove the Debugger facet when you're done ;)

Cheers,
Alin



On 05/10/2013 03:04 PM, César Goudouris wrote:
How can I restrict the results to the current folder (and below) ?

Thanks
--
You received this message because you are subscribed to the Google Groups "EEA Faceted Navigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eea-facetednavig...@googlegroups.com.
To post to this group, send email to eea-facete...@googlegroups.com.
Visit this group at http://groups.google.com/group/eea-facetednavigation?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


-- 
Alin Voinea
Eau de Web (http://www.eaudeweb.ro)
55, Clucerului, ap. 7 - 011364 Bucharest
Tel/fax: +40 21 222 1522, Mobile: +40 722 688 168

César Goudouris

unread,
May 10, 2013, 9:28:16 AM5/10/13
to eea-facete...@googlegroups.com, César Goudouris, alin....@gmail.com
The hidden ˜Path facet˜ with default value option worked! 

Many thanks!

Em sexta-feira, 10 de maio de 2013 09h33min49s UTC-3, Alin Voinea escreveu:
Hi César,

You can try the following:

1. Add a hidden Path facet and set it's default value to your folder location.
2. Add a hidden TAL Expression facet and set it's default value to python:context.absolute_url(1). If this doesn't work try python:'/Plone/' + context.absolute_url(1) - replace Plone with your Plone portal id.

If it still doesn't work add a Debugger facet and see the real query that is used by facetednavigation and adjust it accordingly. Don't forget to remove the Debugger facet when you're done ;)

Cheers,
Alin


On 05/10/2013 03:04 PM, César Goudouris wrote:
How can I restrict the results to the current folder (and below) ?

Thanks
--
You received this message because you are subscribed to the Google Groups "EEA Faceted Navigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eea-facetednavigation+unsub...@googlegroups.com.

To post to this group, send email to eea-facete...@googlegroups.com.
Visit this group at http://groups.google.com/group/eea-facetednavigation?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Olav Peeters

unread,
Jun 10, 2014, 4:20:57 AM6/10/14
to eea-facete...@googlegroups.com, cesar.g...@gmail.com, alin....@gmail.com
Hi Alin,
is there any way to search in multiple language directories (cf plone.multilingual)?

I'm trying to set up a facetted search where the user can filter multiple languages. E.g. you have a multilingual site with the following directories:
{site-root}/en/some-dir
{site-root}/fr/some-dir
{site-root}/de/some-dir

and a user can e.g. read both German and English, but not Frenchv
and not every item in the language specific /some-dir is translated.

If I try to set a second Path facet on e.g. /de or /fr I get this error:

"This widget will be ignored as provided root is unreachable or it has no folderish children."

If I alternatively move everything to /shared (the shared language directory), I cannot filter on a specific language anymore..

I also tried to add an additional TAL expression like this:
python:'/Plone/de/' + context.absolute_url(1)
to no avail ...

How can I make the content in a different language directory available?

Cheers,
Olav



On Friday, May 10, 2013 2:33:49 PM UTC+2, Alin Voinea wrote:
Hi César,

You can try the following:

1. Add a hidden Path facet and set it's default value to your folder location.
2. Add a hidden TAL Expression facet and set it's default value to python:context.absolute_url(1). If this doesn't work try python:'/Plone/' + context.absolute_url(1) - replace Plone with your Plone portal id.

If it still doesn't work add a Debugger facet and see the real query that is used by facetednavigation and adjust it accordingly. Don't forget to remove the Debugger facet when you're done ;)

Cheers,
Alin


On 05/10/2013 03:04 PM, César Goudouris wrote:
How can I restrict the results to the current folder (and below) ?

Thanks
--
You received this message because you are subscribed to the Google Groups "EEA Faceted Navigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eea-facetednavigation+unsub...@googlegroups.com.

To post to this group, send email to eea-facete...@googlegroups.com.
Visit this group at http://groups.google.com/group/eea-facetednavigation?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alin Voinea

unread,
Jun 10, 2014, 8:12:08 AM6/10/14
to Olav Peeters, eea-facete...@googlegroups.com, cesar.g...@gmail.com
Hi Olav,

About the Path widget, where did you put /de or /fr string? Don't put it to Root folder

Your path widget config should look like:
Friendly name: Location
Catalog index: Path
Root folder:
Search Depth:

Click Save

Then you can hide this widget if you want and you can set it's default value directly by selecting path within widget's input (still in configure_faceted.html but not in Edit widget popup).

Did you try the Debugger widget?

Cheers,
Alin
-- 
Alin Voinea

Avertisment: Acest email poate conține ironii, jocuri de cuvinte, metafore sau epitete. Se recomanda citirea cu atenție a acestuia de mai multe ori dacă este cazul. În cazul în care după 3 recitiri consecutive încă mai aveți nelămuriri luați o pauza de 5 minute, beți o cafea, fumați o țigară (după caz). Dacă simptomele persista adresați-va de urgenta unui specialist (prieten(ă), soț(ie), amant(ă), etc.)

Olav Peeters

unread,
Jun 10, 2014, 10:25:29 AM6/10/14
to eea-facete...@googlegroups.com, opee...@gmail.com, cesar.g...@gmail.com, alin....@gmail.com
Thanks Alin,
I tried various combinations adding the /de or /fr, both to the TAL expression and the Path widget, not only in the pop-up, but also by adding '/de/some-dir' to the widget input or by selecting a dir in the widget input in {site-root}/en/some-dir/configure_faceted.html

In the dropdown in the widget input there only is the option to select from the language folder of the language one is working in and the shared language folder. The other language folders are just not visible, also if I add e.g. a TAL expression like e.g. : python:'/Plone/de/' + context.absolute_url(1)

I also tried the debugger widget, but nothing seems to go wrong. I guess I am just not doing what I should :-)

The bizar thing is though, that if I remove both the Path widget and the TAL expression (thus getting items from the entire site in the search results), I also get items from the other languages, but than, for the entire site... and not only my {site-root}/en/some-dir and other language equivalents.

Cheers,
Olav

Alin Voinea

unread,
Jun 11, 2014, 4:27:15 AM6/11/14
to Olav Peeters, eea-facete...@googlegroups.com, cesar.g...@gmail.com
Hi Olav,

1. The best and clean solution would be to have all the objects translated and then use the checkboxes widget with Language index.

2. Another solution would be to create a custom widget to do the job.

3. The third one is to create a complex TAL Expression:

Looking at TAL Expression Widget code I can see that:

query[index] = value

Thus, with your TAL Expression you'll have to return a dictionary like:

{'query': ['/Plone/en/some-dir', '/Plone/de/some-dir'], 'operator': 'or'}

where index is Path

Now, I'm not sure that ZCatalg Path index supports OR operator (on a quick test it doesn't)

4. The fourth solution would be to add a Results filter widget, that filters brains after the query like:

python:context.absolute_url(1).startswith('/Plone/en') or context.absolute_url(1).startswith('/Plone/de')

Cheers,
Alin
Reply all
Reply to author
Forward
0 new messages