Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/25/2023 in all areas

  1. <?php $wire->addHookAfter("Pages::saved", function (HookEvent $event) { $page = $event->arguments(0); // early exits based on your needs if($page->template != 'your-static-template') return; // save some variables for later $lang = $this->wire->user->language; $user = $this->wire->user; // create markup for all languages // render everything as guest user $this->wire->users->setCurrentUser($this->wire->users->getGuestUser()); foreach ($this->wire->languages as $l) { // key for page meta data, eg static-german or static-english $key = "static-" . $l->name; // set temp language $this->wire->user->language = $l; // render page and save it to meta data $page->meta($key, $page->render()); } // change user back to what it was $this->wire->users->setCurrentUser($user); $this->wire->user->language = $lang; }); This would save the static markup in $page->meta("static-default") or $page->meta("static-english") etc... You can then do whatever you want with that piece of data ? You could also create files instead of saving everything to the database - depends on your setup which would be better.
    4 points
  2. I did my first talk ever yesterday @ PHP Meetup Vienna!! Once more everything was a lot more work than I first thought, but I'm quite proud of the result ? What do you think? Did I forget something important? It was really hard to put 10 years into one hour... The recording was not planned at first, but I thought I'd just give it a try and everything worked quite well ? If you like what you see please share it with others so that ProcessWire gets the attention that it deserves ? Special thanks to @gebeer for showing me ProcessWire in 2013 ?
    2 points
  3. I think I've fixed that ? Does it work now?
    2 points
  4. Here you go ? https://codingpad.maryspad.com/2013/07/19/interview-with-ryan-cramer-processwire-cms-founder-and-lead-developer/ Here are the interesting bits for this particular topic: Edit: I knew there was another one https://www.cloudways.com/blog/processwire-ryan-cramer-interview/
    2 points
  5. Maybe your editor is able to use / change configurations via .editorconfig? Then it would be easy to train it. ? (We use it in PW, like in many other projects too. https://editorconfig.org/)
    1 point
  6. Thanks @bernhard, it works! I would never have believed that this was really possible. If you knew for how long I have tried this ... The generated markup is now correctly rendered as if a guest user would see it in the frontend: User is not logged in, user has the role "guest", user()->isGuest() is true and user()->isSuperuser() is false. Everything works perfectly ? You are genius. Many, many thanks!
    1 point
  7. @bernhard so... I just installed a new instance of Umami on Railway and local, yet the newest version doesn't work with your module anymore - for now. The same issue. I found something in regards to server headers, yet... those didn't fix that issue. Might look into it the next days I find time for it.
    1 point
  8. Art bot, Databass selector and.WireArray selector diffnt things and not do same thing .this is the way one.is airplane / other is tractor WireArray selector for any.things in memory : fields : templates : fieldgroupos : smogashsnags : ur own tipos : and if necessario - pages in memory { b.coz PageArray extendo WireArray } but u shlud use airplane for.pages not tractor WireArray selectors = genral purpoose for any things u can hold in WireArray in mem. ,, tractor Databass selector == more power ful and optimizely justed for.pages ,, airplane !!! if u using WireArray selector for |find|filter| pages then you are loaded pages u should not / not necessario / not fficent / donut push pages round in.tractor fly, $willyc
    1 point
  9. How about: $level = count($page->parents);
    1 point
×
×
  • Create New...