oma

Members
  • Content count

    541
  • Joined

  • Last visited

Community Reputation

58 Excellent

About oma

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,135 profile views
  1. I have a RepeaterMatrix set up on a parent page and within each 'type' there's two specific fields... one is a CheckboxField and another is a PageField – the CheckboxField allows the user to hide this 'type' (or row) from the overview page and the pageField allows the user to select some categories that the 'type' is connected to. On the category pages I want it to run through the RepeaterMatrix from the parent page and only return the rows where the PageField matches the category. So within my loop of the RepeaterMatrix I have the following: if ($page->template->name == 'about-detail') { if (!$module->global_flexible_modules_about_category->has($page)) { continue; } } And on the overview page I want it to only return the rows where the CheckboxField isn't ticked (so not hidden): if ($page->template->name == 'about-overview') { if ($module->global_flexible_modules_hide == 1) { continue; } } Two things... 1. To get this to work (which it does) on the first example I had to add the ! to the check but I'm sure this is backwards (if the category contains the current page then continue) but if I remove the ! it returns all the rows except the ones with the page selected as a category... adding the ! resolves this but I'm confused as I think this is backwards? Same with the second example... shouldn't it be if the checkbox isn't ticked then continue (!= 1)? They both seem backwards even though they're working. 2. Is there a more efficient/better way to achieve this as perhaps filtering the query before the loop?
  2. oma

    Sounds like they all sold our data imho...
  3. oma

    Ah I love it when a law isn't clear.
  4. oma

    GDPR question. If we're using GA with IP Anonymisation and without any advertising features thus it's not tracking personal data... do we still need to implement the old school 'This site uses cookies blah blah'? There's no need for opt in/out so I'm curious...
  5. I stuck the same test on the other template (count of the field and $page->viewable('field_name')) and the count is returned when logged out but on the other template it's not. I've checked all templates, fields, page etc. It's the same field on both templates. Is there a way to check a field access via API?
  6. Yep! I’m assuming so? No specific permissions set.
  7. I'm having a bit of a weird issue. I have a pageReferenceField on a couple of different templates (it's the same field) and under two of the templates it seems to work fine but under one of the templates the field will only return when I'm logged in. I have tested this with a few things (different browsers) and when checking the count it shows int(1) when logged in but int(0) on the other browser/incognito mode (not logged in). I then tested the viewability of the field with $page->viewable('field_name'); and on both logged in and logged out states they return bool(true) which made me even more confused. Is there anything I can be checking? I use ProCache on the site but I've turned it off locally for these tests.
  8. oma

    Hmm so no reason it shouldn’t work then?
  9. What version of PW does modifying the imageSizerOptions within config.php work? I've tried applying it in an older install and it throws a server error: Uncaught WireException: Method Config::imageSizerOptions does not exist or is not callable in this context $config->imageSizerOptions('sharpening', 'none'); $config->imageSizerOptions('quality', 100); $config->imageSizerOptions('defaultGamma', -1); I've used this on 3.0+ but this is 2.7.1
  10. You can’t use it in filters() I believe etc... only in a find selector which’ll be fine but I’m curious to find out what “today” is actually returning – as a UNIX timestamp...
  11. Thanks! I’ve used this before but in some circumstances you can’t use it. Do you know ‘today’ is outputting?
  12. What does a date, chosen in a date field, mark as the UNIX timestamp? For example, if I chose 21st April 2018 as my date; is the UNIX timestamp it returns 23:59:59 on the 21st April? Or is it 0:00:00 21st April? Or what does it depend on? I want to return events that are on today or after but when using a page selector of “template=detail, detail_date>=$today” and $today is declared as strtotime(“now”); it won’t be returned but I’m having a hard time working out what $today should be? Midnight today plus 23:59:59?
  13. What about $pages->findMany() – could that work? https://processwire.com/api/ref/pages/find-many/
  14. Thanks for this, Robin. One query is returning 60+ results... no pagination. As soon as I add a limit to it (18) it’s a lot faster. Guess that’s mainly it, right? Interesting to know re the wireCache... but apart from the odd few queries that I will make more efficient I guess it’s down to what’s being returned (rather than queried as you say).