Jump to content

bernhard

Members
  • Posts

    6,312
  • Joined

  • Last visited

  • Days Won

    318

Everything posted by bernhard

  1. Hey @BrendonKoz no worries we are in DevTalk ? And I have had such a great idea yesterday, I almost can't believe it myself ? It solves all those weird scaling issues and makes it possible to scale any css rule that has a numeric value, like font-size, border, padding/margin, border-radius etc... It's so great and mighty that I have to do a video about that!! And it even comes with a helper to write values in PX that will automatically be converted to REM units ? Sneak Peak: /* default viewport settings: min=400, max=1440 */ /* all min/max values will be fluid in between! */ .fluid-box { /* font size 20px@400 30px@1440 */ /* px will be converted to REM automatically! */ font-size: rfGrow(20pxrem, 30pxrem); /* border-width 2px@400 10px@1440 (PX-->REM) */ border: rfGrow(2pxrem, 10pxrem) solid red; /* border-radius 5px@400 20px@1440 (PX) */ border-radius: rfGrow(5px, 20px); } Want to customize min and max width setting? Easy ? $rockfrontend->growMin('800'); $rockfrontend->growMax('1200'); Here is a demo with slightly different values: I'm loving it ?
  2. Great stuff @ryan ! While reading (and because a client asked that this week) I wonder if that would open the doors for a kind of "undo" feature? I guess that would be a lot more difficult to implement? But maybe the activity log could easily be extended with some kind of "undo" information? Just thinking out loud... ?
  3. Thx @gornycreative really happy to hear that! ?
  4. @jrg don't forget processwire.rocks ??
  5. Your question is very short, so we cant know anything about your intentions... If your intention is to get live updates in your browser while working on the markup of your ProcessWire site than be sure to check out RockFrontend: You might want to check out DDEV: https://processwire.com/talk/topic/27433-using-ddev-for-local-processwire-development-tips-tricks/ Quoting @netcarver here:
  6. Thx to another PR by @gebeer RockMigrations 2.0.9 can now also install System Permissions ? https://github.com/baumrock/RockMigrations/pull/14 * Usage: * $rm->installSystemPermissions('page-hide'); * $rm->installSystemPermissions([ * 'page-hide', * 'page-publish', * ); ?
  7. I was wrong ? Simply install AdminStyleRock and get all the benefits. And then - if you need - add /site/templates/admin.less and customise what you need ?
  8. InputfieldTextTags is perfect for such things: https://processwire.com/blog/posts/pw-3.0.177/
  9. For me it was the opposite ? Bootstrap always needed those weird row-wrappers which is totally strange to me. Maybe I didn't understand it correctly but defining the rows via row wrapper in the markup?? How should that work if I need eg 1 item per row on mobile and 3 items per row on desktop? In UIkit that's as simple as this: <div class="uk-grid-width-1-1 uk-grid-width-1-3@m" uk-grid> <div>foo</div> <div>bar</div> <div>baz</div> <div>foo</div> <div>bar</div> <div>baz</div> </div> 12-column-grid? Did you see this? https://github.com/uikit/uikit/issues/217#issuecomment-31829807 ?
  10. The latest version adds a Textformatter and some JS magic to easily add a (multilingual) opt-out-link to your privacy page (which is a GDPR requirement even though you are allowed to track without consent by default). Add this to your text: [rockanalytics-opt-out] And make sure to update your tracking code snippet: // in your main markup file echo $modules->get('RockAnalytics')->render([ 'domain' => $config->httpHost, // see description on next section 'src' => 'https://plausible.yourdomain.com/js/plausible.js', 'onlyGuests' => true, // only load script for guest users ]); See the docs here: https://github.com/baumrock/RockAnalytics
  11. So I guess it should be possible to use UIkit + https://github.com/twbs/rfs/tree/v9.0.6#installation ? ? Maybe @gebeer could show how that could be added to the postcss workflow of RockFrontendTailwind? If you need another plus for UIkit be sure to check out their JavaScript framework: https://github.com/uikit/uikit-site/blob/feature/js-utils/docs/pages/javascript-utilities.md It's really great because you can add custom JS very easily and manipulate all the great UIkit components or use helpers like addClass() or util.each(array, () => { ... }); etc! Another plus might be the great integration of RockFrontend and some additional components that I put there: https://github.com/baumrock/RockFrontend/tree/main/uikit @rick thx!
  12. Hey Frontend Gurus, I'm curious: How do you handle font/headline sizes? In px? rem? percent or vw/vh? I'm not so much into frontend and we have had some discussion design/dev in our latest project... So I wonder what is the best way for frontend font-sizes/paddings/margins in 2022? @szabesz pointed me to https://getbootstrap.com/docs/5.2/getting-started/rfs/ in a related topic. The textformatter solves the problem of fixed font sizes breaking at custom positions. But maybe it would better to adjust headline fontsize dynamically instead of using two or three breakpoints? Thx for your help ?
  13. That's one of the very rare cases where I thought a full module (github + modules directory) would be overkill ? Thx, very interesting! I'll start a topic in devtalk!
  14. <?php namespace ProcessWire; class TextformatterRockSoftbreaks extends Textformatter { public static function getModuleInfo() { return [ 'title' => 'RockSoftbreaks', 'version' => '1.0.0', 'summary' => 'Textformatter to replace strings by HTML softbreak', ]; } public function format(&$str) { $str = str_replace("---", "&#8203;", $str); $str = str_replace("--", "&shy;", $str); } } There's always the problem of too large words on too small screens... In the past I often did a str_replace in my template file, but when using frontend editing that's no option because you need the original markup in the edited text and the replaced version in the presented markup. Textformatters do exactly that and that's why I build a textformatter for it. Feel free to change the replaced string to whatever you need ? Update: 3 dashes will insert a zero-width-space to make it possible to insert non-dash-softbreaks where dashes would be misleading (eg in mail addresses or in foo/bar which would otherwise result in foo/- bar) PS: If you have better solutions for that problem please let me know!
  15. No. I just tried it again: // home.php <?php namespace ProcessWire; echo $rockfrontend->render("home.latte"); // home.latte <div id="markupregion">home.latte</div> // footer.latte <div id="markupregion"> original content </div> <section>I am the footer</section> Neither PW nor RockFrontend care about where the markup comes from. You just need to make sure that your region content is above the region markup. This is what it looks like when disabling $config->useMarkupRegions: You can even do that. Not sure if that's something that should be added to RockFrontend though. I'll add an entry to the WIKI... Here it is: https://github.com/baumrock/RockFrontend/wiki/RockFrontend-and-Markup-Regions#advanced-setup
  16. MagicPages (eg HomePage.php) do now also load the related CSS and JS files (eg HomePage.js and HomePage.css) in the backend page editor ? And there is a new WIKI page about MagicPages: https://github.com/baumrock/RockMigrations/wiki/MagicPages Magic Assets If your page is a MagicPage it will load YourPage.css and YourPage.js files automatically in the PW backend when editing any page of type YourPage. Example: // /site/classes/HomePage.php // /site/classes/HomePage.css div { outline: 2px solid red; } // /site/classes/HomePage.js alert('You are editing the HomePage');
  17. v2.0.4 improves deployment and thx to another 2 PRs by @gebeer docs and features of permission handling were improved ?
  18. Yeah that's what I tried to explain. You don't need admin.less - you only need the module that adds the custom admin style in init() or ready() ? Now that I'm writing I realise that one can't customize my style once the module is installed. Because it won't pick up the admin.less file as it's overwriting this setting to use the module's style. That might be an improvement ?
  19. Interesting need. I've stopped using MarkupRegions because it was more confusing than helpful for me. But you can use them with RockFrontend of course. RockFrontend does not care where the markup comes from and so does ProcessWire. So for example you could just render a latte file from your home.php file that holds the markup for the markup region and then in your main markup file (or any rendered LATTE file) you simply add that region and it will hold the content of the markup you put in home.php If that sounds confusing I'm sorry, but that's how it is when using markup regions ? // home.php <?php echo $rockfrontend->render("sections/home.latte"); // sections/home.latte <div id='foo'> <h1>{$page->title} - foo!</h1> </div> // _main.php <html> <body> <?= $rockfrontend->render('sections/main.latte') ?> </body> </html> // sections/main.latte <div>This is main latte</div> <div id="foo"></div> <div>End of main latte file</div> Does that make sense?
  20. Maybe we could join forces and extend my module with a simple toggle (light mode/dark mode)?
  21. Hey @flydev ?? great to see another admin style coming up ? Check out https://github.com/baumrock/AdminStyleRock/ to see how you can create a module for 1-click-install without the need to copy files! This is all you have to add to your module: https://github.com/baumrock/AdminStyleRock/blob/30c91c9832ac8bc54fa64fbee416919824a1983d/AdminStyleRock.module.php#L35-L53
  22. No, I mean {$site->color = 'blue'} ? which sets the "color" property of my site module to 'blue' and later I can echo that setting (also in other latte files!): <h1 style="color: {$site->color}">foo bar!</h1> {var ...} does only define a variable in the current latte file. That is a latte thing. What I tried to show is how you can use regular PHP. ?
  23. Hey @pmichaelis thx for the module. I've had some weird issues on my current project and tracked it down to the textformatter. Turned out that your module turned this: <p>xxx</p> Into that: <html><body><p>xxx</p></body></html> This is the fix that works for me: https://stackoverflow.com/a/22490902/6370411 I'll comment that on github if you want to fix this ? I don't think that the textformatter should add <html> and <body> to the markup, or was that intended?
  24. Would be interesting to see the difference (before/after) ?? No. You can execute PHP code like {alfred($page)} or {bd('foo bar')} or assign new variables like {$site->color = 'blue'} but not much more..
Γ—
Γ—
  • Create New...