Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/19/2024 in all areas

  1. PageListCustomSort Github: https://github.com/eprcstudio/PageListCustomSort Modules directory: https://processwire.com/modules/page-list-custom-sort/ This module enables the use of a custom sort setting for children, using multiple properties. About This module is similar to ProcessPageListMultipleSorting by David Karich but is closer to what could (should?) be in the core as it adds the custom sort setting in both the template’s “Family” tab and in the page’s “Children” tab (when applicable). Usage Once a custom sort is set, it is applied in the page list but also when calling $page->children() or $page->siblings(). You can also apply the custom sort when calling $page->find("sort=_custom") or $pages->find("parent_id|has_parent=$id,sort=_custom"). Unfortunately this won’t work the same way sort=sort does if you only specify the template in your selector.
    1 point
  2. I tested all TracyDebugger versions back to 4.26.26 and the issue starts with version 4.26.27. It is the following line in /panels/ConsolePanel.php: # /panels/ConsolePanel.php line 406 xmlhttp.open("POST", "/", true); When I change the line to it's previous version, it works for me: xmlhttp.open("POST", "./", true); Could that be some hosting specific issue? Could it be triggered by .htaccess rules? Okay, I deleted my ready.php and it works too, so it's likely a correlation with some crazy redirect stuff I am using. I'll test that ... Edit: Yes, my redirect code in ready.php caused the error. Thanks for your help @adrian – and thanks again for the great TracyDebugger module. I couldn't imagine to ever work without it again!
    1 point
  3. https://github.com/wanze/FieldtypeSecureFile Could get some inspiration from there. I think this is a well needed core feature personally.
    1 point
  4. 1 point
  5. I have a little update on this procedure: When disabling the two-factor authorization it is straight-forward and fast to add the customers instagram account into the app. First you don't have to ask the customer for the security code (on each login attempt) and second you don't need to add the clients instagram account to your facebook accounts center in the first place. When the app is working the client can feel free to re-activate the two-factor authorization.
    1 point
  6. I have to implement Google Consent v2 together with PrivacyWire for the first time. I tried to summarize the most imporant things and make a quick example. Hope that helps. Improvements welcome. Basically Google wants you to send the user preferences. This way Google can process at least anonymized data if the user denies permissions (and promises to respect privacy). Luckily PrivacyWire gives us the possibility to define a custom js function in the module configuration, which is executed whenever user preferences change. PrivacyWire stores user preferences in localStorage. From there we can fetch this information when needed. So we have to: 1. Integrate Google Tag Manger without modifying the script tag. 2. Set Consent v2 defaults (by default deny every permission): <!-- GOOGLE CONSENT V2 --> <script async src="https://www.googletagmanager.com/gtag/js?id=GTM-ID-HERE"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied' }); gtag('js', new Date()); gtag('config', 'GTM-ID-HERE'); </script> <!-- End GOOGLE CONSENT V2 --> 3. Use a function called by PrivacyWire, when user changes preferences. Fetch user preferences from localStorage and send them to Google: function updateConsentFromPrivacyWire() { console.log('update consent from privacy wire...'); const privacyWireData = localStorage.getItem('privacywire'); if (privacyWireData) { try { const consentData = JSON.parse(privacyWireData); const consentPreferences = { // Set Google params based on user preferences 'ad_storage': consentData.cookieGroups.marketing ? 'granted' : 'denied', 'analytics_storage': consentData.cookieGroups.statistics ? 'granted' : 'denied', 'ad_user_data': consentData.cookieGroups.marketing ? 'granted' : 'denied', 'ad_personalization': consentData.cookieGroups.marketing ? 'granted' : 'denied' }; // Update google consent gtag('consent', 'update', consentPreferences); console.log(consentPreferences); } catch (e) { console.error('Error parsing PrivacyWire-Data:', e); } } else { console.warn('No PrivacyWire-Data found in localStorage'); } } // Update consent at pageload document.addEventListener('DOMContentLoaded', updateConsentFromPrivacyWire); 5. This is what the parameters control: ad_storage: Controls whether ad-related cookies and identifiers are stored (e.g., for remarketing). analytics_storage: Controls whether analytics-related cookies are stored (e.g., for Google Analytics tracking). ad_user_data: Controls the collection and use of user data for advertising purposes. ad_personalization: Controls the use of data to personalize ads based on user behavior and preferences. 4. Configure the function name (here updateConsentFromPrivacyWire) in PrivacyWire module settings.
    1 point
  7. @adrian, thanks for looking into this request but after some more investigation I don't think there will be a good way for PageRenameOptions to deal with the ProcessPageClone issue. It's something that would need to be addressed within ProcessPageClone. It works out the copy number - (copy 2), (copy 3), etc - by looking at the page name to check for an existing number suffix. So it needs to name the first clone with a "1" suffix and yet it wants to title that first clone without the "1". If we change PageRenameOptions to set the clone name from the title then there's no number suffix on the first clone and so it messes up the calculation for subsequent clones. I don't think there will be changes to ProcessPageClone any time soon, and in fact the whole problem would largely be avoided if my request from 2018 was actioned. So instead I'm going to solve this with a couple of extra hooks: // Make ProcessPageClone always use "Copy Page" form // https://github.com/processwire/processwire-requests/issues/186 $wire->addHookAfter('ProcessPageListActions::getExtraActions', function(HookEvent $event) { $page = $event->arguments(0); $actions = $event->return; if(empty($actions['copy'])) return; $config = $event->wire()->config; $actions['copy']['url'] = "{$config->urls->admin}page/clone/?id={$page->id}"; $event->return = $actions; }, ['priority' => 200]); // Set "Copy Page" name field to match title field $wire->addHookAfter('ProcessPageClone::buildForm', function(HookEvent $event) { /** @var InputfieldForm $form */ $form = $event->return; $title_field = $form->getChildByName('clone_page_title'); $name_field = $form->getChildByName('clone_page_name'); if($title_field && $name_field) { $name_field->value = $event->wire()->sanitizer->pageName($title_field->value, Sanitizer::translate); } }); With these hooks PageRenameOptions will do its normal thing and sync the name field as I type a new title in the ProcessPageClone "Copy Page" form.
    1 point
×
×
  • Create New...