Search the Community
Showing results for tags 'pages find count'.
Found 1 result
virtualgadjo posted a topic in General SupportHi all, first of all, as it's my first post here, thanks so much for this incredible CMS, thanks for all my question i've found answers here without even asking them and, of course, i can't say thanks enough to Ryan incredible job... i'm currently working on a bilingual website (pw 3.0.165 php 7.2), funny enough (i'm french), this time default language is english and the second one french but i think that doesn't matter... this website stores events and i have an page having itself all the events as hidden chidren pages, template for an event is... un_event with many fields, some of them bilingual as i'm supposed to display the number of events available on all the pages at different places ("see the xx events" with a link to the event page) in my _init.php file i've set a count of the one_event pages and this is where the funny thing is $nevents = $pages->count('template=un_event, include=hidden'); // in the default language see the <?php echo $nevents; ?> language works fine // in french $nevents is 0 $nevents = $pages->count('template=un_event, include=all'); // works fine in both languages but implies that even unpublished pages would be taken in account just to be complete, same behaviour with count($pages->get(1032)->children) count($pages->find('template=un_event, include=hidden')) and so on, in english, correct number as the result, in french 0 as a test, wondering if it was the fact that this was in the _init.php file, same thing if i use the same code on top of a page (all my files have the namespace processwire statement on top, i'm essentially a php guy ?) other test, i've done the same thing but setting all the one_event pages as visible (not hidden), same result is there something i haven't undestood or have forgotten with this all/hidden option when it comes to multilingual websites? probably ? have a nice day chris