Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/01/2022 in all areas

  1. 🚨 [[ UPDATE December 6, 2022 ]] 🚨 I prepared a small landing page to validate how many of you would be willing to take the course, so that we would have a rough estimate of how many people would be willing to take the course. πŸ”— Show me your interest here πŸ”— ------------------------------------------------------- Hello to the entire wonderful Processwire community! I am here to announce my willingness to create a video course for beginner/mid-level developers interested in learning more about the main aspects of our beloved CMS. I have been working with Processwire continuously for years now, so I feel confident that I can share what I have learned to other developers interested in becoming faster and more efficient in their day-to-day work. I have noticed that lately many people here in the forum have complained about a lack of material and tutorials for taking the first steps, and although so many resources are already present within the board, I understand how complicated it can be to be able to connect the dots and have a clear reference on how to get started or how to find clear answers in a short time. As you know Processwire is a very broad tool, very flexible and able to be adapted to any need, so it will not be possible to dissect every aspect in this course, especially the more advanced ones that can help in rarer cases (at least in my personal experience). πŸŽ‰ But don't worry, I plan to explain with many practical examples many tips and tricks that can help you in developing sites, even particularly structured ones! πŸŽ‰ So I am here to test your interest and ask you what aspects you would be most interested in me covering, even those related to design (css, scss, postcss, tailwind) or javascript libraries/frameworks integrations (vue, alpine.js, greensock for animations,etc.). My idea would be to create together a magazine with a restricted area for users, newsletter integration, catalog filtering according to different parameters (year, author, topics, etc.) and much more.πŸ’£ It will be a paid course, I have not yet decided what the price will be, but it will be affordable for everyone πŸ‘. For a small period of time, I would be pleased if you would give me pointers and ideas, so I can see what your real interest is (if any!) and also motivate me πŸ™‚ Let me know! Thanks! πŸ™
    8 points
  2. Really rough, but gets the job done. You could easily put this into a function. This builds up the name of variation (assuming you want 330x330), checks to see if it exists and if it doesn't then we need to go old school and get the page object and image and generate the variation. Then next time the page is loaded, the variation will exist and we can display it with $imageUrl as the image src directly from the data returned by findRaw. if(count($p->image) > 0) { $imageOrigUrl = $config->urls->files. $p->id . '/' . $p->image[0]['data']; $path_parts = pathinfo($imageOrigUrl); $imageVarFilename = $path_parts['filename'] . '.330x330.' . $path_parts['extension']; $imageUrl = $config->urls->files . $p->id . '/' . $imageVarFilename; if(!file_exists($config->paths->files. $p->id . '/' . $imageVarFilename)) { $image = $pages->get($p->id)->image->size(330, 330); $imageUrl = $image->url; } }
    3 points
  3. This is something I used in a couple of modules recently and it could be useful as a standalone hook. It adds classes to the body tag in the admin theme for: roles the user has if the user is a non-superuser the user's name You could use this if you want to tweak the admin interface for a role using CSS/JS (e.g. with Admin Custom Files). There is also an old wishlist item requesting this. $this->addHookAfter('AdminTheme::getExtraMarkup', function($event) { $theme = $event->object; $user = $this->user; foreach($user->roles as $role) { $theme->addBodyClass("role-{$role->name}"); } if(!$user->isSuperuser()) $theme->addBodyClass("role-nonsuperuser"); $theme->addBodyClass("user-{$user->name}"); });
    2 points
  4. Thank you AndZyk, I will remove it and refresh.
    1 point
  5. You can set the collation per database. See here: https://dev.mysql.com/doc/refman/8.0/en/charset-database.html You can run this query for a database to see current charset and collation: USE db_name; SELECT @@character_set_database, @@collation_database; You can run this query for a database to change charset and collation: ALTER DATABASE db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
    1 point
  6. Here's another alternative to add to the list that looks pretty interesting: https://withcabin.com/ Not being charged for pageviews might work for some of our larger clients and the dashboard looks like a happy medium between Fathom and Mamoto both of which we currently use. We've managed to shift a few clients away from GA recently. In part because the shift to GA4 meant there was going to be some disruption anyway so they might as well switch to a more privacy friendly alternative. Also interesting is that I found out about Cabin on Mastodon instead of Twitter .... that's probably a different thread tho.
    1 point
  7. I am assuming the template for those users is named 'member'. What is the setting in template member "URLs" tab, particularly the "Should page URLs end with a slash?" setting. If this is set to Yes (default), you need to append a trailing slash to the redirect URL, e.g. mydomain.com/medlemmar/username/ to avoid unnecessary redirects. if ($sanitizer->pageName($userloggedinname) !== $pagename) { $session->redirect($pages->get('/')->url . "medlemmar/{$userloggedinname}/"); }
    1 point
  8. Hi @Flashmaster82 How about this: <?php $userloggedinname = $user->name; $pagename = $page->name; $redirecturl = $pages->get(1)->httpUrl . "medlemmar/" . $userloggedinname; { $session->redirect( $redirecturl ); } ?> Gideon
    1 point
  9. Without seeing the code for your redirection there is not much to suggest.
    1 point
  10. v2.9.0 adds support for rfShrink() 😍 div { border: rfShrink(20px, 5px) solid red; } which means 20px border @ 375px viewport and 5px border @ 1440px viewport and fluid in between. div { border: rfShrink(20px, 5px, 600, 1000) solid red; } 20px@600 / 5px@1000
    1 point
  11. Hi @johnners 1. Create a new template whatever name you think fit, such as update-home-body. 2. Create a page and assign the template created above to it. 3. Create a new template php file named the same name as the template created in step 1 such as update-home-body.php in the site/template folder. 4. Put the following code in the template file. <?php $home = $pages->get(1); $home->of(false); $content = "whatever you want or read it from somewhere"; $home->body = $content; $home->save(); 5. Create a cron job to access the page at the designated time. Hope this helps. Gideon ?>
    1 point
  12. The latest site of the week reminded me of https://senderkataster.rtr.at/ that I built with a friend some time ago and that I want to share. Tech: ProcessWire (obviously) https://getuikit.com/ (also quite obvious πŸ˜„ ) https://tabulator.info/ for all kinds of filters https://leafletjs.com/ for the map https://basemap.at/ using an Open Government Data License Some GDAL command line magic to transform the overlay source data into PNGs that are stored in ProcessWire pages and can then be queried and correctly placed on the map. ProcessWire has been a great platform for that project! If you need help with a ProcessWire project that needs some geo-magic or powerful web maps drop me line πŸ™‚ I'm not responsible for the red background πŸ˜… Show details of a tower Choose a program by name or type and show its radio coverage (not in the screenshot): Expert mode for nerds:
    1 point
  13. If you just need the url for a redirect this does work: $session->redirect('.');
    1 point
Γ—
Γ—
  • Create New...