dragan

Members
  • Content count

    346
  • Joined

  • Last visited

  • Days Won

    1

dragan last won the day on November 21 2013

dragan had the most liked content!

Community Reputation

213 Excellent

1 Follower

About dragan

  • Rank
    Sr. Member
  • Birthday 10/18/1969

Contact Methods

  • Website URL
    http://www.fantastique.ch/

Profile Information

  • Gender
    Male
  • Location
    Switzerland
  1. Luckily, we have more than a dozen real devices. We don't rely on just desktop browser resizing and emulation. Only exception being responsive HTML emails, where we use Litmus - but thank God we only do such stuff like once a year.
  2. There's always good old pagination you could use... https://processwire.com/api/modules/markup-pager-nav/ Maybe in 2017 that's not considered "sexy", but hey - if it works, it works
  3. I don't think it would resolve the issue. SHDB just saves to DB instead of the file-system. But PHP will still do one session request after another and probably uses db table locks instead of file locks (at least that's my guess). Are you using PW session functions or native PHP? Towards the bottom of this article there is PHP 7 option: session_start([ 'read_and_close' => true, ]); https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/ The author also mentions Redis (there's also a redis session handler db module for PW), but if you're not using it it won't be of much use...
  4. Well, if you're using several videos, this won't work. But you could simply add the two video URLs in data-attributes. <video id='video' data-src-720="<?=$page->video_720->url?>">...</video> <video id='video' data-src-1080="<?=$page->video_1080->url?>">...</video> You could even get rid of IDs altogether. Just create a JS function that sets each video src on resize / window load with reading out the data-attributes. https://www.sitepoint.com/use-html5-data-attributes/
  5. similar problems were reported here: google error-msg site:.processwire.com, e.g. SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data site:.processwire.com
  6. did you try this?
  7. I guess it's possible, but of course not optimal. Maybe try this? https://www.drupal.org/docs/8/modules/json-api/json-api i.e. fetch JSON feeds from Drupal, and import to PW with file_get_contents() + json_decode()
  8. I just tried this and it works as expected: $highestID = $pages->get("template=user, sort=-id, limit=1, roles=intern")->id; echo $highestID; in your case, you'd have to replace id with customer_number, and use your specific role anzeigen-anbieter.
  9. You could check existing users with the role anzeigen-anbieter, get the highest customer_number, and add 1 for your new customer. $pages->find('template=user,sort=-id,limit=1,roles=anzeigen-anbieter');
  10. Do you mean that all 5 images are actually stored? But you can only see 2 of them after uploading, in page-edit view? Check the logs: site\assets\logs - maybe you'll find a hint.
  11. Is the frontend still working fine? You could try this:
  12. Do you see anything suspicious in the browser JS console? (errors, warnings, 404...)
  13. @gmclelland Basically, what I did is installing this module: https://processwire.com/api/modules/lazy-cron/ Then I added this one line at the very bottom of my "search-input" template (the only place I need to ever access that index JSON): wire()->addHook('LazyCron::everyHour', null, 'cronAutocompleteJSONCache'); In file _cron.php, that I include_once("./_cron.php"); in my search-input template, I have this: <?php namespace ProcessWire; function cronAutocompleteJSONCache(HookEvent $e) { $selector = "parent=1041, has_parent!=2"; $matches = wire('pages')->find($selector); foreach ($matches as $match) { $result = array( "title" => htmlspecialchars_decode($match->title), "year" => $match->year, "project_desc_short" => htmlspecialchars_decode($match->project_desc_short) ); $results[] = $result; } $cacheHolderPage = wire('pages')->get(10029); $cacheHolderPage->setOutputFormatting(false); $cacheHolderPage->autocomplete_json = json_encode($results); $cacheHolderPage->last_update = date('d.m.Y h:i:s'); $cacheHolderPage->save(); } Of course, I could have also saved the JSON on the file-system, and check the timestamp, and decide on every request if the static JSON is older or newer than the PW-content, and load/generate one or the other, but for my needs, this seemed like the easiest and most straightforward solution. PS the field last_update I have only added for myself to see if it really works. I made it a "read-only" field in the settings. (not editable)
  14. Can you post your entire code (or at least the relevant bits)? That's simply how sessions work. You can't set new session vars and retrieve them in one go. From http://php.net/manual/en/features.sessions.php The keyword being "subsequent"
  15. Turns out I was using a selector that didn't work... I basically used the same one I use for regular search. In the end my selector just needed to define the parent, that was all. It all works nicely now. I've added a little LazyCron task too: I save the JSON in certain intervals to a (hidden) PW page/field, and only query this JSON data with JS. It really speeds things up. Otherwise (with browser cache cleared) I had to wait a few seconds till the suggestions were loaded. Thanks again for your help, suggestions + patience @AndZyk