Jump to content

bernhard

Members
  • Content Count

    3,083
  • Joined

  • Last visited

  • Days Won

    91

bernhard last won the day on December 4

bernhard had the most liked content!

Community Reputation

4,103 Excellent

About bernhard

  • Rank
    baumrock.com

Contact Methods

  • Website URL
    https://www.baumrock.com

Profile Information

  • Gender
    Male
  • Location
    Vienna, Austria
  • Interests
    Sports

Recent Profile Visitors

13,716 profile views
  1. Not all, but all that are necessary (or at least useful) for other projects and users as well. Not sure what others think of that idea, especially @adrian @Robin S ?
  2. Yeah, the idea is to have a shared place where we can apply those fixes and do not have to wait for core fixes. The benefit compared to placing hooks into /site/ready.php is that we can share our code, it's easier to test in different environments and we can provide better suggestions for a fix to ryan. PS: Happy 1000 @wbmnfktr πŸ₯³
  3. Sorry for the confusion πŸ™‚ There are several issues with the PW core. Some of them get fixed quickly, some don't. All those issues exist on every project and one has to fix them on every project. This module makes it easy to place fixes in a central place and activate them one by one. It was just a quick idea when I read this comment today: https://github.com/processwire/processwire-issues/issues/802 I've just added a fix for the annoying 404 error: https://github.com/BernhardBaumrock/PwCoreFixes/commit/c4fa410654d0d4a4f8a50c53315a350cdf60d347
  4. PwCoreFixes This module is intended to serve as a collection of PW core fixes that can easily be enabled via checkboxes in the module's config. Usage Just add your fixes in the fixes folder and activate them in the config of this module (via checkbox). See the Foo example module how to add JS and CSS. https://github.com/BernhardBaumrock/PwCoreFixes
  5. Thx, then I think it's probably the best time for creating seperate accounts for them πŸ™‚ What if one user has the same page opened in two tabs? This would be the same session but could also be unwanted (and overwriting/losing changes).
  6. What does the devtools network tab say?
  7. Hi Ryan, thank you! That's a very welcome addition! 😎 I'll buy it soon. One quick question: How does it handle situations when some people share the same PW user to log in and edit pages?
  8. Setting the icon markup of the wrapper does not work, because this also affects all following inputfields and always sets the same icon on all inputfields. This is what I came up with now: // add method to set icon of inputfield manually $this->addHook("Inputfield::setIcon", function($event) { $field = $event->object; $name = $field->name; $icon = $event->arguments(0); $field->parent->addHookAfter('render', function($event) use($name, $icon) { $search = " for='Inputfield_$name'>"; $event->return = str_replace( $search, $search."<i class='$icon'></i> ", $event->return ); }); }); Usage is even simpler: $field->setIcon('fad fa-link');
  9. I'm glad you believe @Robin S if you didn't want to believe me πŸ˜› Just create a custom $page method that does your logic, then you have your own performant API. That should get you started: $wire->addHook("Page::readByUser", function($event) { $result = $this->database->query("SELECT id,templates_id FROM pages LIMIT 5"); $ids = $result->fetchAll(\PDO::FETCH_OBJ); $user = $event->arguments(0); d("check for user $user"); $event->return = $ids; }); d($page->readByUser($user));
  10. Thx for the example. Yeah, I need auto height - seems to be possible only via javascript πŸ™‚ Not for me πŸ˜… This answer states this solution: .fa-rotate-45 { -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } So if I wanted to rotate an icon 45 degrees when hovered I'd have to create a class like .hover-45:hover { transform: rotate(45deg); } Do I still need those -webkit -moz -o ... versions? Is using javascript for that any bad? Sorry, we are getting off-topic. So maybe someone can ask my questions and then we'll come back to the web manifesto πŸ˜„
  11. Did you see my example gifs? Maybe you (or anybody else) can show me how I can SLIDE-toggle the white div here: https://jsfiddle.net/baumrock/1uaLmxo7/7/ BTW: It's also easy to rotate elements with the uikit js framework πŸ™‚ util.Transition.start(burger, { 'transform': 'rotate(270deg)', }, duration, 'ease');
  12. What exactly is easier? I'd be happy to get an example.
  13. 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:
  14. 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 πŸ˜‰
  15. 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.
Γ—
Γ—
  • Create New...