Jump to content

bernhard

Members
  • Posts

    5,722
  • Joined

  • Last visited

  • Days Won

    271

Everything posted by bernhard

  1. No, I thought so as well, but this is really just toggling the visibility. You can then add some animations, but that's not the same as the jQuery slideToggle does: This is UIkit toggle + animation slide-top (see how the yellow div toggles instantly): This is a custom transition changing height from 0 to auto smoothly:
  2. I'm not so sure about that. PW often treats pages as... well... pages. Not plain ids. So it could happen that you load all those pages into memory which would be a huge overhead and could drastically slow down your site. You can even build your own method that gets all users that visited a page: if($page->wasViewedBy($user)) { echo "You have read this post"; } else { echo "Wow! We have new content for you ;)"; } Add a timestamp to your DB table and you can even collect statistics about page visits... Not complicated at all. Try to do that with PW page reference fields ? If you want something future-proof: Overcome your fears and build a custom DB table ?
  3. EDIT: Just realized that this will set the icon of every field! I'll look into that... Add this to /site/ready.php if($page->template == 'admin') { $config->styles->add("/site/assets/fontawesome/css/all.css"); } Then you can use all FontAwesome icons in your backend. To set the icon of an Inputfield you need a little hack, because the InputfieldWrapper adds the FA4 prefix automatically. The fix is quite easy: $wrapper = $field->parent; $wrapper->setMarkup([ 'item_icon' => "<i class='fad fa-image'></i> ", ]); $field->icon = 1; // set icon to anything not null Voila, you can use Duotone icons for your fields: PS: There's also a module by @Macrura but that didn't work for my usecase. And adding 3 lines in site/ready.php to use an existing folder of FontAwesome is better than installing another module and copying files over... PS: My approach does of yourse NOT show icons in the GUI of fields and templates. It's a code- or file-based approach that works in hooks and process modules.
  4. I'd build a custom DB table that holds the id of the page and the id of the user that visited that page. page | user -----|----- 1 | 41 2 | 41 3 | 41 Get all pages that have been visited by the admin? SELECT page FROM visitedpages WHERE user = 41 Get all users that visited page 1? SELECT user FROM visitedpages WHERE page = 1 Executing custom SQL is as easy as that: Thousands of pages? No Problem ? Thousands of users? No Problem ? PS: If you only want an array of all page ids:
  5. Personally I stick to uikit only. Especially on free modules everybody who is still using one of the "old" themes is free to file a PR... But I've never had this request. Maybe nobody is using any of my modules ? But just in case someone was using one, I guess it might make more sense to put the effort into switching from the old themes to uikit than supporting old themes in new modules.
  6. Hi @Jonathan Lahijani thx for that link. It looks nice indeed. Nonetheless I'm not sure how useful it would be. I'm not doing a lot of frontend, and ~5€/month doesn't sound too bad, but, well... it's 60€ per year and I'm not sure if I want to spend that. I think I don't need that fancy screenshot and zooming stuff (or do I?!), so I just hacked together a simple html page that shows an input for an URL and loads iframes in different sizes: https://bernhardbaumrock.github.io/devtools/ First problem I got was the same-origin restriction, so I copied the HTML file to my PW site. Well... that does not have synchronized scrolling but maybe it could still be helpful? This could also quite easily be turned into a PW module that hooks into the 404 exception when logged in as Superuser on /devtools url (or the like). What do you guys think? Anybody up for that? ? Here's the code: https://github.com/BernhardBaumrock/devtools
  7. Hi @ukyo thx for fixing the images. Ok now I also got how one can use their own icons, nice work ? Could you please elaborate a little more on that? I didn't see any problems so far.
  8. Just wanted to thank you @Tom. for that brilliant hint! I'm not that experienced in frontend stuff, so basic tasks like slide-toggling a menu can really be a pain for me ? I've always made it easy for myself and just included jQuery for such things... Today I tried the UIkit JS utils and it's not that hard to do (here I'm using Zepto.js, but that's not a necessity): var util = UIkit.util; $(document).on('click', '.tm-burger', function(e) { e.preventDefault(); var $menu = $('#tm-menu-section'); var element = util.$('#tm-menu-section'); var duration = 700; if($menu.height()) { // hide menu $menu.height(element.scrollHeight); util.Transition.start(element, { 'height': 0, 'overflow': 'hidden', }, duration, 'ease'); } else { // show menu $menu.removeAttr('hidden'); $menu.height(0); $menu.css('overflow', 'hidden'); // trigger window resize to make sure that the menu renders correctly $(window).resize(); util.Transition.start(element, { 'height': element.scrollHeight, 'overflow': 'show', }, duration, 'ease').then(function() { $menu.height('auto'); }); } }); The benefit here is that I don't need any dependencies and I can create any transitions that I need and I'm not limited to jQuery's .slideUp() .slideDown() etc. ?
  9. Thx @netcarver, but that does not seem to be an IconPicker Inputfield, or am I missing something? ? Anyway, it's always good to have options ?
  10. Hi @ukyo I knew there where some Icon Pickers already, but thought it would be fun to build my own ? Also in your module's thread the images are broken, so I didn't get a good first impression... How would I make your module work with a paid version of FontAwesome? Is that possible?
  11. RockAwesome ProcessWire Fieldtype to easily choose FontAwesome Icons Usage Install the module. Set paths in the Inputfield's settings page. Add a RockAwesome field to any template (or change an existing TEXT field). Preview https://modules.processwire.com/modules/fieldtype-rock-awesome/ https://github.com/BernhardBaumrock/RockAwesome
  12. Am I the only one often needing a httpsUrl instead of a httpurl? https://github.com/processwire/processwire/pull/116/commits/25be5b54edc16edc80b337723145142660f795c6 Maybe it would make sense to have not only $config->url() and $config->path() but also $config->httpUrl() and $config->httpsUrl() $config->url("/var/www/foo/bar/site/templates/style.css"); // /site/templates/style.css $config->path("/site/templates/style.css"); // /var/www/foo/bar/site/templates/style.css $config->httpUrl("/site/templates/style.css"); // http://www.foo.bar/site/templates/style.css $config->httpsUrl("/site/templates/style.css"); // https://www.foo.bar/site/templates/style.css $config->httpsUrl($pages->get(2)); // https://www.foo.bar/processwire/ What do you think? You can support my request here: https://github.com/processwire/processwire-requests/issues/326
  13. Just use the root user with no password (of course only for development). See
  14. Thx, seems that I missed that ?
  15. Just a FYI @teppo I'll definitely need a site search on my next project so I'll try your module soon. I've found https://markjs.io/ today and it seems to be great (and MIT). Maybe this could be implemented into your module for highlighting the results? Or did you have any other solutions in mind? Would you be interested in me bringing markjs into your module or would you prefer if I build something seperate?
  16. Snippet for adding a module config class: "Module Config Class": { "prefix": "moduleConfig", "body": [ "class ${YourModule}Config extends ModuleConfig {", " public function getDefaults() {", " return [", " 'fullname' => '',", " ];", " }", " public function getInputfields() {", " \\$inputfields = parent::getInputfields();", " ", " \\$f = \\$this->modules->get('InputfieldText');", " \\$f->attr('name', 'fullname');", " \\$f->label = 'Full Name';", " \\$f->required = true;", " \\$inputfields->add(\\$f);", " ", " return \\$inputfields;", " }", "}", "", ], "description": "Module Config Class" },
  17. ?? At first I thought my version was better readable. But I quite like this one: $this->addHookAfter('ProcessPageList::find', function (HookEvent $event) { $event->return->find([ "template!=" => ['admin', 'basic-page'], // keep them ])->each(function($p) use ($event) { if(!$p->editable() AND !$p->addable()) $event->return->remove($p); }); });
  18. ...to get rich? ...to find a woman? ...to get happier in life? ...just for fun? ? Little bit kidding here, but imho the most important question is the "why". Or the "goal" why you are showcasing that. Did you see last weeks showcase of https://siebennull.com/ ? It can be as simple as that: That's what marketing people call "call to action". I didn't see one on your site Just checked back and found it: Has it been there before? If the main goal of your website is getting possible new clients I'd say that a small single line with your e-mail is maybe not the best option ? If you don't want to get spammed by client requests because it's a just-for-fun-showcase website, then that would be fine - it's all about the main goal ?
  19. Nice, thx for sharing and welcome back to ProcessWire ? I like the design and I think it gives a good impression of who you are. I also had not the best experience with the navigation. First try was to scroll down but nothing happened, only the menu disappeared. Scrolling several times more finally showed the next section. What could be missing (if that's not intentional) is a statement what you are looking for. Are you available for hire? Or do you just want to share your projects? I don't get that from the website ?
  20. Thx @DV-JF I've gone ahead and created an issue: https://github.com/processwire/processwire-issues/issues/1020
  21. @Noel Boss did you find a solution? This thread is related:
  22. Hi @Ralf, what exactly is the problem? The example in the readme shows how you generate the pdf. You'll get an object with properties url, path and httpUrl. Then you can use the file for whatever you want and however you want...
×
×
  • Create New...