Jump to content


jan

Member Since 15 Feb 2012
Offline Last Active Sep 04 2012 03:37 PM
-----

Topics I've Started

Combine selectors images.count>0 and textfield!=''

04 September 2012 - 08:52 AM

Hi again,

I've got one more problem with selectors. I need get pages from page array that have images uploaded (fieldtype image) a OR (logical) imagelinks (fieldtype text) set.
Of course, it's no problem to get pages that have images uploaded AND imagelinks set:
$pages->find("articleImageFiles.count>0, articleImageLinks!=''");

What I need is a query to get pages that have images uploaded, or imagelinks set, or both. So a logic OR is needed.

Things like this unfoturnatelly didn't wok:
$pages->find("articleImageFiles.count>0|articleImageLinks!=''");

So does anyone know how to combine the selector elements with logical OR?
Thanks a lot to you all! Really a great community!!

Frontend search for fields containing pages

03 September 2012 - 07:43 AM

Hi there,

I'm trying for hours the following:

In the backend I have article pages containing a field "categories". The field "categories" has pages you can select via checkbox in the backend. These pages are status "hidden" under a node "system".

It looks like this:

Home

Articles

Article 1 (has selected e.g. /System/Category/print)

Article 2 (has selected e.g. /System/Category/print and video)

Article 3

System

Category

print

internet

video

audio


I've implemented a frontend search. There you can search all articles an you can select of which category the results are.

My problem is, I don't have any glue, how I can filter the articles, to get only results for the categories selected.

What can the selector string look like? Is there another way how I can do it?

I ended up in very complicated "foreach"s and so on...
Thanks a lot for your answers in advance!!