Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/12/2017 in all areas

  1. Feeling the love for ProcessWire today. Two sites launched and owners over the moon happy. Two additional sites ordered by existing clients and both specified ProcessWire as the platform. New sites: 1. https://flywithmehorses.com.au/ Owner is just starting out in business and had already spent $100's dollars and 6+ months on a 'free' website without success. She helped me so I sponsored development of her site. Client's comment: "OMGOSH this is sooo exciting!!!!!!! YAY!! Thank you alot!!!!! Can't wait to tell everyone!!! THANK YOU!!!" ProcessWire 3.0.63 2. https://cttcfilmcourse.com/ Original site built in WordPress. Over 1000 lines of code on the home page and the https://validator.w3.org/ bombed out at line 124 with "Too many errors". Google's page speed insights were cringingly bad. Project was to keep the visuals and rebuild the site in PW with a solid foundation. Job done. No validation errors and vastly improved page speed insights. Also added search and better site navigation. Client's comment: "So good!" ProcessWire 3.0.63 Looking forward to working on the next two sites, both of which will be website apps with workflows rather than informational sites. As ever, grateful for comments/feedback to improve either site.
    5 points
  2. I woke up this morning and this was the very first forum topic I had read. I was really happy to start the day with a ProcessWire success story, it made my day. Thank you for sharing it with us and keep up the good work! Cheers from the other side of the Globe
    4 points
  3. That would have been my guess as well. Nine out of ten times, session fingerprinting is the cause of such problems, especially with corporate networks where outgoing IP addresses may change on the fly and security solutions might change request headers to make tracking harder.
    3 points
  4. @ocr_b, you get the JSON parse error because the response from the server is some error message rather than the JSON object that is expected. If you search the forum (using Google) you'll find a number of topics that could be useful in tracking down the problem. Here are a couple: Based on comments in the forum some things to look at are: post_max_size, upload_max_filesize, max_execution_time, max_input_time, memory_limit mod_security (disable it) upload_tmp_dir
    3 points
  5. Hi everyone, I'm proud to share my first fieldtype module and I think it's a quite handy one It helps you to create all kinds of table/matrix inputs very quickly and easily. You have loads of options for customizing your field via plain javascript. See the handsontable docs for that Please consider this module ALPHA until i got some more time to test it. Any help would be highly appreciated Numbers are for example always tricky. Different locale settings, different types, rounding errors and so on... Download: https://gitlab.com/baumrock/FieldtypeHandsontable Result: Installation/Configuration: Just install the Fieldtype, add a field to your template and set the handsontable options in the fields details. If you have InputfieldAceExtended installed you will also have code highlighting for your code: Get data: If you retrieve the data from the API with outputformatting ON you have some helper methods available: getData() + getRows() get all data of the field getRow($row) get one special row, eg getRow(1) or getRow("2017") getCols() get all data but by columns not by rows getCol($col) get one special column, eg getCol(1) or getCol("mycolumnheader") You can also access rowHeaders and colHeaders directly (see examples) Simple Example: Caution: the examples below are outdated! see this post:
    2 points
  6. This is a joy to read congratulations
    2 points
  7. You don't entirely have to disable it, just fingerprint the browser for instance. There are several options. See this commit in wire/config.php by ryan.
    2 points
  8. The problem in my case is that this project will have more than 2000 users that will logon from all over the world. So I guess I will have to disable session fingerprinting to make sure that everyone can connect without issues.
    2 points
  9. Thanks @PWaddict All working now Thanks everyone for introducing me to something new. I can see how this will be useful as the site grows. Even now it easily replaces several lines of PHP if statements .
    2 points
  10. I think $pages->count() supports the same selectors as $pages->find(), plus you can supply an options array with "findAll", so should be no problem counting hidden or unpublished pages.
    2 points
  11. please see this screencast. i have two questions: dou you also experience the bug related to inputfield toggles that i demonstrate at 0:09 ? one does not see it clearly but i click the inputfield but the field does not get collapsed. i have this in all my installations. you have to click the chevron icon on the right first. after you clicked it once you can click everywhere on the inputfields label to toggle it. why is the opened and openReady event fired twice? i tried to understand the code but i have no explanation yet. the trigger is here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/templates-admin/scripts/inputfields.js#L1018 i put a console.log() here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/templates-admin/scripts/inputfields.js#L1000 (fired only once) but if i catch the opened event like this, i always get 2 logs: <script> $(document).on('opened', 'li', function(e) { console.log('opened!'); console.log($(e.target)); }); $(document).on('openReady', 'li', function() { console.log('openReady!'); }); </script> i thought maybe the event is fired on different li elements, but e.target returns the same element...
    1 point
  12. New website created by myself for Hannah Shaw Children's book illustrator: http://hannahshawillustrator.co.uk/ Modules used: AIOM+ Croppable Image 3 PageTable extended - used to create layouts such as: 2up, 3up, 1third-2thirds, video, slideshow etc. Image Animated GIF Site-wide File Manager PublishToTwitter3 Video embed for YouTube/Vimeo Template Notes lots of Javascript and CSS animations to give it some fun flare where possible.
    1 point
  13. Why do you need more? You check if the page exists, so one is enough. Also adding the parent to the selector will make your check more accurate, there might be other pages with the same title but with a different parent.
    1 point
  14. Hello, I have a situation were a user cannot logon to several different PW installs fromdifferent machines on his workplace network. Sometimes the initial logon is working but when navigating the PW backend he gets thrown out. Sometimes even the initial logon is not working and he is redirected too many times and the browser throws a redirection error. This points to PW loosing it's session. But the same sites are working fine when accessed from within other network environments. The user's workplace network has some pretty tight security (firewall) restrictions in place that prevent PW keeping it's session. I don't know enough about network security so I can't tell what exactly could cause that problem. I checked in the browser settings to make sure session cookies are allowed and there. Has anyone ever experienced issues like that and would there be a way to make PW keep it's session under these circumstances?
    1 point
  15. This. We've ran into this on so many occassions I have disabled IP addresses from the fingerprint in all our configs. I initially felt the same. Then I realised: you are taking one brick of the security wall. There are probably more issues with human errors like people with bad passwords or outdated computers prone to trojans and such.
    1 point
  16. Reminds me of this one: Is it a similar or same issue? I'm not quite sure, that's why I'm asking. "They have two VDSL lines into the building that feed their router through a load balancer. It seems that their setup meant that responses to outbound traffic did not necessarily come back in via the same line."
    1 point
  17. in fact this is wrong! this is correct: $pages->get(123); // returns also hidden and unpublished pages $pages->find('id=123'); // returns a "PageArray", but only published + visible pages $pages->findOne('id=123'); // returns a single "Page" object, also only published + visible pages find and findOne can be modified with your selector like "include=hidden"...
    1 point
  18. @bernhard I'll see what I can do with the $config->sessionFingerprint settings to avoid these problems. Although I don't feel comfortable messing with security features...
    1 point
  19. thank you both for your feedback. Is there anything we can do to work around those security restrictions? EDIT: guess it has something to do with $config->sessionFingerprint setting. I'll play around with that.
    1 point
  20. @benbyf ah, sorry. i just found out that you created the podcast profile (https://github.com/benbyford/pw-podcast/) and updated it. sorry and thanks!
    1 point
  21. i had something similar 2 times until now...
    1 point
  22. Welcome @Mirza, If you are talking about the backend, only supersusers have access to setup/template/. No other users can edit templates, fields, modules or admin pages.
    1 point
  23. These variables do still exist, but in their default states. As I said, processwire does not handle the webrequest if it's bootstrapped into another script. So if you want processwire to do so you need to bring your other php files into processwire as well even if you don't need the content manangement tools, but you need the session/user tools. The other method, which I really don't recommend, is to try to copy the user initialization from /wire/core/ProcessWire.php. It might work, but each processwire update can potentially break it.
    1 point
  24. You shouldn't need to touch index.php, unless you're doing something really unorthodox. Are you logged into the PW admin (assuming that resolves)? Verbose errors will be supressed if not. You also might check /site/assets/logs/ for an error log, or your server logs. Hope that helps! Welcome.
    1 point
  25. Instead of $pages->count you may prefer to use $pages->findOne, so you can search for pages hidden or unpublished. See: https://processwire.com/api/ref/pages/find-one/ So: <?php $firstname = $sanitizer->text($input->get->firstname); // firstname should be the name of the input field $lastname = $sanitizer->text($input->get->lastname); $fullname = $firstname . $lastname; $sitetocheck = strtolower($fullname); $p = $pages->findOne("name=$sitetocheck"); if ( $p->id ) { echo "Sorry, seems you 're already registered"; } else { $p = new Page(); $p->template = 'basic-page'; // set template $p->parent = wire('pages')->get('/about/'); // set the parent $p->name = '$fullname'; $p->title = '$fullname'; $p->save(); echo "Thanks for registration"; } ?>
    1 point
  26. 1. Put the _init.php under site/templates directory. 2. Add the following code on the site/config.php file and you're ready: /** * Prepend template file * * PHP file in /site/templates/ that will be loaded before each page's template file. * Example: _init.php * * @var string * */ $config->prependTemplateFile = '_init.php';
    1 point
  27. The name is a bit misleading. Just look in the modules section in your backend under "install". It's distributed with every core version, not installed though.
    1 point
  28. Yay, update: https://github.com/blynx/MarkupProcesswirePhotoswipe Now has some simple 'themes', cooler ones later ... <?php $pwpswp = $modules->get('MarkupProcesswirePhotoswipe'); echo $pwpswp->renderGallery($page->nicePictures, ['theme' => 'h-scroller']); // available themes: plain, flex, h-scroller 0.7 - 2017/07/11, themes fixed: Size option correctly adopts height value added: Theme functionality added: Simple themes 'plain' (previous default), 'flex', 'h-scroller' other: Updated readme other: No notice on undefined photoswipe options other: Refactoring
    1 point
  29. Maybe you can try http://modules.processwire.com/modules/auto-smush/ But I'm thinking about using Cloudinary for my next project: http://cloudinary.com/ One of the greatest features of their service is to auto detect and serve .webp files if the browser supports. This format has a better compression that jpg or png.
    1 point
  30. Only the bits and pieces I picked up in forum discussions. A search for "uncache" brings up some interesting topics, mostly about manipulating large numbers of pages through the api.
    1 point
  31. @Sergei thanks. I am big on performance but I always struggle to add image compression to my workflow as i kind of want it running on the server for all new image uploads too but dont know of a good solution... whatever happened to that module that did that?!
    1 point
  32. In a similar scenario, I update a free ticket counter field on the event page whenever a booking is made. This works for both solutions and enables a blazing fast search.
    1 point
  33. @dweeda, it would probably be better to put your code into a template file. Then instead of redirecting to the PHP file you redirect to some page URL that uses the template file. That way you can use the $user and $session variables as expected.
    1 point
  34. Bootstrapping processwire does skip the whole web request stuff, so theirs neither a current_user nor any $input items and other things dependent on a webrequest. It's only meant for api work and it cannot piggyback onto a webrequest of the php script pw was included into.
    1 point
  35. 1 point
  36. translations.php _x('Поиск', 'General'); function _t($text, $context = 'General', $textdomain = '/site/templates/helpers/translations.php') { return _x($text, $context, $textdomain); } echo _t('Поиск');
    1 point
  37. I don't have much time to figure out why at the moment, but I discovered that InputfieldPageListSelect::renderReady is not being called for non-superusers. It is inside this that the ProcessPageList module is loaded, so as a quick hack so I can move on for now, I added: if($page->template->name == 'admin' && $user->isLoggedIn()) $this->wire('modules')->get('ProcessPageList'); to site/ready.php which gets things working properly again. I hope to find some time to get back to this and investigate properly, but if anyone else has any ideas that would be awesome
    1 point
  38. Posting in the hope this helps someone out of a hole! Having built 20+ sites on PW in the last couple of years (and loving it...) I came across a really odd situation recently. The client's IT company and I 've been battling for a couple of weeks and today, finally, we have an answer! The site is built and temporarily housed on a shared hosting account we have for development. All tested well here so Access was granted to the client to start adding content. The next day I get a call from the client to say the admin side of the site is logging them out every 30-40 seconds and they have to log back in again each time to continue. I tested again from our office with their login but all worked as expected. Other browsers, PCs etc. were all tried by the client but the problem persisted. So, I get in my car and drive to the client's site. Sure enough, I see the issue on one of their iMacs. So I open up my MBP, connect to their network, log in as them and the problem is there. So, next, I came off of their network and onto my tethered iPhone on 4G. Bingo! The problem goes away. So it's their network that's the issue. Their IT company were called and, with us helping them wherever possible, they worked on it for 2 weeks to find the problem. I captured the port numbers in use by PW admin (60992, 60993, 61000, 61001, 61002, 61003 by the way) and the IT company opened those ports on the router but still, the problem remained :-( And then the breakthrough... They have two VDSL lines into the building that feed their router through a load balancer. It seems that their setup meant that responses to outbound traffic did not necessarily come back in via the same line. Processwire admin does not like this! So, the IT company put in a rule to direct all traffic from the IP of the shared hosting through the same route in and out of the building and BOOM! it all works as expected. Phew! All's well that end's well but it certainly put us through the wringer tracking it down. Actually, I think it's pretty cool that PW does this. A good extra security measure. Several other CMSs (no names...) worked just fine with this scenario but not PW. Anyway, happy client, happy me. Hopefully, this story helps someone else here too.
    1 point
  39. ProcessBatcher is not compatible with 3.0 devns at the moment, as far as I know. But why not try some custom code? It's just four lines actually. <?php $pagesToDelete = $pages->find('id>1000,template=mytemplate'); foreach ($pagesToDelete as $p) { $pages->delete($p, true); }
    1 point
  40. Thank you for this very helpful piece of code, Ryan I use the sitemap for a multilanguage site (two languages only – en and de). Englisch is default (www.domain.net), German is de (www.domain.net/de) Referring to this article (https://support.google.com/webmasters/answer/2620865?hl=en or in German https://support.google.com/webmasters/answer/2620865?hl=de) I extended the "renderSitemapPage" function to indicate which page is a translation (and which language the current page is). It's not really automated / generic for more languages, and I also added "https://" manually. But it might be a help for someone. If anyone want's to optimize – you're welcome! function renderSitemapPage(Page $page) { return "\n<url>" . "\n\t<loc>" . $page->httpUrl . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>" . "\n\t<xhtml:link rel='alternate' hreflang='de' href='https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "' />" . "\n\t<xhtml:link rel='alternate' hreflang='en' href='". $page->httpUrl . "' />" . "\n</url>" . "\n<url>" . "\n\t<loc>https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>" . "\n\t<xhtml:link rel='alternate' hreflang='en' href='". $page->httpUrl . "' />" . "\n\t<xhtml:link rel='alternate' hreflang='de' href='https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "' />" . "\n</url>"; } With this function you only have to submit www.domain.net/sitemap/ to google to include both languges. Attention: www.domain.net/de/sitemap generates a faulty sitemap with the code above and should not be submitted to google. One more thing to do: To make the markup valide, you also have to add the namespace in the urlset-Element: function renderSitemapXML(array $paths = array()) { $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">';
    1 point
  41. You have moved those pages around from amother parent? Move those out of the parent and then back in. Works?
    1 point
×
×
  • Create New...