Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/11/2021 in all areas

  1. @Pixrael Thanks for your help. Your thread is one of those I read before, but it didn’t lead me much further. It seems as if the error can have approximately thousand different causes and so the 127+ forum topics you mentioned are mostly guesswork with some enviably happy winners. That’s not meant sneeringly, I know that server based issues can be very hard to catch. In my case I’m not sure whether I’m struggling with a server case at all. When you go to bed with a working site and wake up the next morning with an unworking one without any changes on your system, it’s not very likely that your database acts suddenly strange or your PHP session path is not writable anymore. Furthermore I copied the site to a local environment in the meantime, where precisely the same shit happens. As far as I can see, it has to be something inside the /site/ directory or the database. As I updated to the latest dev version, /wire/, index.php and htaccess should be fine.
    1 point
  2. I do not understand what you were trying in your examples -- I think maybe you are muddled about how $sanitizer works? All it does it return the sanitized value. All you need to do is this: $activepost = $sanitizer->selectorValue($page->title); $articles = $pages->find("template=post, cbpage2=$author, limit=2, title!=$activepost, sort=-cbdate" ); /** * OR: in case you need to use it unsanitized elsewhere */ $activepost = $page->title; // note the position of the sanitizer method $articles = $pages->find("template=post, cbpage2=$author, limit=2, title!=" . $sanitizer->selectorValue($activepost) . ", sort=-cbdate" ); /** * OR (again): if $activepost is only used in the selector, you can ditch it altogether and use $page->title directly */ $articles = $pages->find("template=post, cbpage2=$author, limit=2, title!=" . $sanitizer->selectorValue($page->title) . ", sort=-cbdate" ); */
    1 point
  3. I just added a small function for this usecase in v1.0.7. You can trigger this "re-initiating" by calling window.PrivacyWire.reHandleExternalButtons() Updated / Added code: https://github.com/webworkerJoshua/privacywire/blob/1.0.7/src/js/PrivacyWire.js#L146-L149
    1 point
  4. Do you mean this? https://processwire.com/api/ref/page/edit-url/
    1 point
  5. I have just found this module and once again am astonished at the scope of interest and productivity of @adrian! Whatever I am looking for years after I started using PW he already has a module for written when I was just messing around ? This one is the great example. But the module is not as perfect as it could be. There is an issue (see above) that does not allow it to work as desired. I just added my thumbs up for the issue on github that makes the enhancement of the module (and custom hooks too) possible. Bumping this thread, so those of us working with multi-language sites could give their thumbs too to move the issue forward (it was waiting for us for a long time)) P.S. Multi-language support is one of the PW's selling points, so I feel proud making any step to improvement in this field)
    1 point
  6. That was one of the first games I had on PC!! I was like 10 or something, I couldn't believe there was such a funny game haha, it really opened my eyes to what could exist as a videogame. Now I'm thirsty for some table melting quality grog.
    1 point
  7. Yep. Remember loading those on a ZX Spectrum from a tape recorder and playing on a black and white TV screen. Greetings to you, my fellow oldfags)))
    1 point
  8. I build and use one template that is bound to a single page in PW where both are simply named "ajax". I can access it per URL "/ajax/" and use it for everything that needs to send or retrieve data in the background. Here is an example from a project where different forms send data that need to be validated first and then send to final (external) destinations. The client browser optionally gets back HTML like "success messages" or error descriptions. <?php namespace ProcessWire; /*============================================================================== XXXXXXXXXX :: site/templates/ajax.php 2019-07-04 ==============================================================================*/ /******************************************************************************* * * This template file handles form submissions that are raised via AJAX! * * Sanitize, validate, log and submit to final destinations. * * // how the used JS looks like $.ajax({ url : gAjaxUrl, // /ajax/ type : 'POST', async : true, dataType : 'html', // returned data has to be HTML data : submitData, // submitted data object success : function(markup) { if('' != selector) { // a selector string to match the $(selector).html(markup); // markup container } } }); ... * *******************************************************************************/ // only process AJAX calls if(!$config->ajax) return 'WRONG ACCESS METHOD'; // only process POST requests with valid required id if(!$input->post->hidden_id) return 'WRONG ACCESS METHOD'; // ... followed by all project specific validations etc. So, with your example I would check if there is a post value named theme, and if the value is one out of a whitelist of valid theme values: // does this belong to theme selection if($input->post->theme) { $validThemeValues = ['dark', 'light']; if(!in_array($input->post->text('theme'), $validThemeValues)) { header('HTTP/1.1 403 Forbidden'); return; } $session->set('selectedTheme', $input->post->text('theme')); return; } // does this belong to another thing? if($input->post->anotherThing) { // first validate, then process data // ... return; }
    1 point
  9. You can choose sort settings for all children that use a template by going to Admin>Setup>Templates Choose the template you want to edit Click on the Family menu item Expand the "Sort setings for childen" section Choose the "Children are sorted by" option you want Toggle the direction of sort if needed Save your changes
    1 point
×
×
  • Create New...