Recently Browsing 0 members
No registered users viewing this page.
By Noel Boss
Hi everyone 🙌
Is there a way to order the language tabs in the backend? Currently, they seem to be ordered based on the created date (or id?) …
( time passes … ⏰ 🚶♂️)
Just answered my own question. One can reorder the languages in the page tree under admin » languages or directly in the DB » pages » template_id=54 » sord field.
Anyone knows if there are side effects when moving the default language from sort 0 to somewhere higher?
ProcessWire added the numReferences property in 3.0.107, which returns the count of all pages having a reference to the page object. However, apparently it's not possible to use this property inside a selector. I'm trying to find all pages that are referenced at least once:
$pages->find('template=service, numReferences>0'); This throws an error: "Field does not exist: numReferences".
Is there another way to filter by the number of references? Of course, I could manually filter the results of the find query, but that feels overly complicated. Ideally, I would also like to filter the number of references from a specific field; that is, find all pages that are referenced at least once in one specific page reference field.
Is there a way to do this? I guess supporting numReferences in selectors would be a feature request - if so, is it feasible?
I played with the Selectors object and would like to use it for a special use case...
That is a custom Selectors object with dummy data converted to an php array to see the structure (Selectors object is a WireArray with "fields" added)
Array (  => Array (  => Array ( [field] => seg1 [value] => val1 [not] => [group] => [quote] => [forceMatch] => )  => Array ( [field] => seg2 [value] => val2 [not] => [group] => [quote] => [forceMatch] => ) ) )
But instead of "seg1" the field name is "field" with value "seg1" (= my field name).
So I can't search the Selectors WireArray (= custom WireArray with added Selectors objects) with PW "find('seg1=val1')", Is there a way to search with "find()" or build a simple wrapper to make the elements searchable / filterable with find()?