Leaderboard
Popular Content
Showing content with the highest reputation on 02/27/2025 in Posts
-
I put the styles for it in the head section of my html/_main.php manual in a <style>-tag. For example: <style> /* Cookie Banner */ .show-banner>.privacywire-page-wrapper, .show-options>.privacywire-page-wrapper, .show-message>.privacywire-page-wrapper { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; } .privacywire { display: none; } .show-banner .privacywire.privacywire-banner, .show-options .privacywire.privacywire-options, .show-message .privacywire.privacywire-message { display: block; position: relative; left: auto; right: auto; bottom: auto; max-width: 850px; padding: 2rem; color: #000; background-color: #fff; } .privacywire-page-wrapper input { margin-right: 0.5rem; } .privacywire-page-links { margin-top: 1rem; } .privacywire-buttons button, .privacywire-page-links a { margin: 0.5rem 0.5rem 0.5rem 0; } @media screen and (min-width: 992px) { .privacywire-buttons button, .privacywire-page-links a { margin: 0.5rem; } /* Don't give the first button margin-left */ .privacywire-buttons button:first-child, .privacywire-page-links a:first-child { margin-left: 0; } } </style> So it loaded as first. That resolved it for my sites. (Also with fixed/relative notation)4 points
-
I've done something like this once, neatly grouped in chapters, with screenshots and even short video-captures. Everything the client needed was covered. Problem was... that particular client mostly forgot to look it up in the first place - even though that manual wasn't hidden away in some obscure place, or distributed as a separate file. It lived right there in the PW admin as a custom admin page. I'd share it here, but a) it was in german, b) the site's setup is way too custom-tailored to make sense for most other people and c) it uses pro modules like Form Builder and Lister Pro. Also, afair the screenshots contain sensitive information, and the rich-text editor in use was CKE with a non-standard choice of buttons. I'm not sure I would ever do such a manual again, seeing how much work went into it, and how easily it can be overlooked. I would invest my time even more into UX; e.g. for some sites, it makes sense to completely hide the page-tree. Also, use field labels and hint texts liberally. Hide, rename or otherwise simplify admin stuff (hooks? Admin On Steroids - or whatever the successor is called now? there's plenty of tools and examples around). Some stuff is right there in the core, e.g. restrict templates by page-tree, or disable changing the template etc.3 points
-
Yeah! Really useful feature. Has been a quite long way to get it π See https://processwire.com/talk/topic/27528-weekly-update-β 2-september-2022/ for all available options. Even the link was quite hard to find, so no wonder not many know about it...2 points
-
Ever felt like your ProcessWire emails look like they're stuck in 1999? You know the drill - sending emails is super easy with WireMail: $m = new WireMail(); $m->from('foo@bar.com'); $m->to('xxx@yyy.com'); $m->subject('Hello there!'); $m->bodyHTML('<h1>This is great!</h1><p>I am an ugly mail...</p>'); $m->send(); But let's be honest - they look about as pretty as a website built with Microsoft FrontPage! π πͺ Enter the Mail Pimp Hook! Drop this magical hook into your /site/ready.php (or even better Site.module.php), and watch your emails transform from ugly ducklings into beautiful swans: <?php $wire->addHookBefore('WireMail::send', function(HookEvent $event) { // double check that we got a wiremail instance // this also tells the IDE what $mail is (to get IntelliSense) $mail = $event->object; if (!$mail instanceof WireMail) return; // get current mail body $html = $mail->get('bodyHTML'); if (!$html) return; // get email layout markup $layoutFile = wire()->config->paths->templates . 'mails/default.html'; if (!is_file($layoutFile)) return; // replace ##content## with actual mail content $html = str_replace( '##content##', $html, wire()->files->render($layoutFile) ); // write new body to mail $mail->bodyHTML($html); }); The HTML Just create a beautiful MJML template at /site/templates/mails/default.mjml, put ##content## where your email content should go, convert it to HTML and BOOM! π₯ Every email gets automatically wrapped in your gorgeous template. No more CSS wrestling matches, no more "Why does this look different in Outlook?" headaches. Just pure email beauty, automagically! β¨ Now your clients will think you spent days crafting those emails, when in reality, you're sipping coffee while your hook does all the heavy lifting. Work smarter, not harder! π #ProcessWire #EmailMagic #NoMoreUglyEmails PS: This is the MJML template that I used: <mjml> <mj-head> <mj-attributes> <mj-all font-family="Tahoma" /> <mj-text line-height="140%" /> </mj-attributes> </mj-head> <mj-body background-color="#efefef"> <mj-section background-color="#ffffff" background-repeat="repeat" padding-bottom="30px" padding-top="30px" text-align="center" > <mj-column> <mj-image align="center" padding="25px" src="xxx" target="_blank" width="200px" alt="Logo" ></mj-image> <mj-text>##content##</mj-text> </mj-column> </mj-section> <mj-section> <mj-column> <mj-text font-size="10px" color="#a0a0a0" align="center" > powered by <a href="https://www.baumrock.com/" style="color: #158f66" >baumrock.com</a > </mj-text> </mj-column> </mj-section> </mj-body> </mjml> VSCode has an extension to get a live preview and export MJML to HTML: And here are some other free templates: https://mjml.io/templates I use https://www.base64-image.de/ to add the logo to my mail template as src="data:image/jpeg;base64,/9j/4QAWRXhpZgAATU0AKgAAAA..." to avoid headaches with image paths, remote assets blocking etc.1 point
-
Hey @neophron sorry for the trouble. But no reason to be desperate - I'm here to help and this one will be quite easy to fix π Background: Unfortunately I had to introduce a breaking change with how assets are managed and injected. In the old version I relied on RockFrontend's styles() and scripts() methods to inject styles/scripts into the frontend. The new version leaves that up to the user. This means he/she has more control over their final frontend markup (no automatically injected styles and scripts) but it also means more to do during the initial setup. Can you share your _init.php please? Especially around line 9. PM if you don't want to share it here.1 point
-
Thanks for the great ecosystem of tools you have build Today i tried to setup a new clean site using the ``site-rockfrontend`` profile. Right out of the box less compiling, and live reloading doesn't work. I have read the documentation, and watched your Youtube video's, but all didn't help. Finally I came here, and read that the livereload has moved to RockDevTools. So the setting in the site config should be ``$config->rockdevtools = true;`` and not ``$config->livereload = 1;`` I think to documentation, and the site-profile are behind at the moment.1 point
-
1 point
-
<?php class EventActivityPage { /** * Gets hero image or fallback hero image if one does not exist for this activity */ public function heroImage(): Pageimage { return $this->getFormatted('hero_image.first') ?: $this->eventPage()->getFormatted('activity_fallback_hero_image.first'); } } Using getFormatted + .first you can force the return type so no matter what setting or output formatting is applied your method will return the correct value.1 point
-
1 point
-
1 point
-
Thanks, Iβll look into this soon. Iβm using MariaDB almost exclusively, and it seems that this is not an issue there. There seems to be one potential gotcha with the suggested solution: https://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause. Might be better to do two queries instead.1 point
-
Is it possible the output formatting is off within the saveReady hook? A PageImage will always default to a PageImages regardless of this option when the output formatting is off.1 point
-
@ryan Are you using this in your tool chain? If so, could you update the repo with any additional tests you've added, like the subfield test you mentioned above? Thanks.1 point