• Content count

  • Joined

  • Last visited

Community Reputation

58 Excellent

About oma

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,223 profile views
  1. I'm curious. In order to share a link via Twitter you do something like the following<?php echo $page->title; ?>&url=<?php echo $page->httpURL; ?>&via=processwire And in most instances that works fine. However, if the page title has an ampersand in it then it breaks the text. I've looked at using $sanitizer for this but doesn't seem to do the job. What I've found out works is the following: htmlspecialchars(urlencode(html_entity_decode($page->title, ENT_COMPAT, 'UTF-8')), ENT_COMPAT, 'UTF-8'); However I'm wondering if there is a way to use $sanitizer to achieve this? Or some other way with the API? Thanks!
  2. 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?
  3. oma

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

    Ah I love it when a law isn't clear.
  5. 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...
  6. 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?
  7. Yep! I’m assuming so? No specific permissions set.
  8. 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.
  9. oma

    Hmm so no reason it shouldn’t work then?
  10. 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
  11. 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...
  12. Thanks! I’ve used this before but in some circumstances you can’t use it. Do you know ‘today’ is outputting?
  13. 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?
  14. What about $pages->findMany() – could that work?