Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/25/2024 in all areas

  1. If you are doing something like this... // Get poi page from Page Reference field $poi_page = $page->my_page_reference_field; // Render poi page echo $poi_page->render(); ...then you can pass variables to the template file of the poi page via the $options array argument. See docs: https://processwire.com/api/ref/page-render/render-page/ // Get poi page from Page Reference field $poi_page = $page->my_page_reference_field; // Render poi page echo $poi_page->render(['rendered_from' => $page]); And in the poi template file: if(!empty($options['rendered_from'])) { $rendered_from = $options['rendered_from']; //... } You can also use the $options['pageStack'] value in the template file. It's mentioned in the docs page linked to above, but probably easiest to understand if you just dump it and see what it contains.
    2 points
  2. Tracy's RequestInfo panel has a PagePermissions section which checks the permissions for the current user and each role. One of the permissions it checks is "moveable". If you don't want these calls to happen you can disable this section in Tracy's settings.
    2 points
  3. Yes, encapsulation is a very important concept to read about, I forgot to mention it in my message. Yes, the book is written based on neuroscientific knowledge that facilitates learning, and it works incredibly well. Before I read this book, I had been trying to understand Design Patterns for weeks or months through discussions on forums with good developers, web tutorials... But I couldn't understand anything, I saw no point in coding DPs. Then I received this book, read 2 or 3 chapters the first evening, it was very exciting to read, I dreamed all night of boxes connecting together (classes/objects), and the next morning I understood everything! ??
    1 point
  4. I second this wholeheartedly. It's truly too much to cover in a comment, but this is what I mean when I said "thinking with objects". It requires starting to work with encapsulation and breaking down/dividing your code into behavioral chunks. I'm pretty sure at some point I read the book that @da² recommended. The Head First series really does explain things in ways that I have seldom seen elsewhere. Also +1 for real life books, I find that they let me "unplug" from the problem at hand and focus on the content presented. In my closing list of items I mentioned "single responsibility", "composition over inheritance", "does not expose how it calculates", and an example of how properties and methods can each have their purposes and roles. You're going to immediately be introduced to these fundamental concepts as soon as you start down the OOP path, I peppered them in to contextualize them in ProcessWire. I've referenced this site before and it's a good next step. You'll write OOP code and sometimes think "there's got to be a better way to do this", and these are the abstract concepts that you'll be able to take into consideration. Just be mindful of "premature optimization" and get comfortable with OOP to the point where before you even start coding, your mental model will naturally begin with OOP. Approach LLMs with caution while learning. They require that you ask a question the right way and may not tell you why what you asked maybe isn't the right question to ask in the way a human can. You also have to be familiar enough with the concepts to recognize when they give you the wrong answer. LLMs require large scale data ingestion and that means their models are indiscriminately built with code examples whether they're good or bad. You'll get there but they're wrong, a lot, so maybe consider this one a little further down the road. Just my two cents.
    1 point
  5. Thanks @adrian. There's so much in Tracy that I still haven't fully explored. That actually seems a really useful feature. Now I understand why it's called 16 times - because my site has 16 roles (which needs a bit of rationalisation, I think!).
    1 point
  6. Your tasks include the development of agile web applications and websites - mainly based on the CMF ProcessWire. Your talents are: at least 3 years of experience with the content management framework ProcessWire quick perception advanced knowledge of PHP, JavaScript, MySQL advanced backend knowledge: REST APIs, DBs, servers OOP GIT Further information: https://www.incognito.ms/backend-entwickler-m-w-d/ Send your application to: bewerbung@incognito.ms Arne
    1 point
  7. Very happy to hear you enjoyed it!. Writing a course on anything hasn't ever crossed my mind haha. I just put this together to share a great ProcessWire feature that has really boosted my workflow and thought maybe sharing some examples might be useful to others. I hadn't thought about this post as a walkthrough on OOP specifically, but I did want to be descriptive in a way that would be useful to as many people as possible- whether you are familiar with OOP or not, and without any assumptions. All said, I'm happy to try and answer questions if it would help anyone ?
    1 point
  8. Wow, this is so nice. Thank you very much! Have you considered writing a beginner's course on PHP OOP using ProcessWire as the main tool? ?
    1 point
  9. If anyone's interested, I posted a deeper dive into page classes with more real world examples. I like page classes so much I had to write a love letter.
    1 point
  10. Guessing this should do the trick…?
    1 point
  11. Jumplinks is only designed to kick in when a URL 404s. Your best bet is you place the redirect in the template file that is used to display the /recipes/ page, eg: $session->redirect('/docs/!recipes/doku.php');
    1 point
×
×
  • Create New...