Jump to content

bernhard

Members
  • Posts

    6,259
  • Joined

  • Last visited

  • Days Won

    312

Everything posted by bernhard

  1. I'm working on a website for a local municipal and they have a section showing logos of partners: Now the designer and I were wondering: How would we present that on mobile? Logos one by one in a slider? Logos 2x2 in a slider? Just a list of logos to scroll? Or maybe a div with max-height that fades out to white at the bottom and shows a button "show all"?
  2. I can't remember exactly but Ryan mentioned some time ago that in some situations it's not enough to set the template as string. ProcessWire usually converts that into a template object, but in the wrong context this does not work. When calling the method statically this seems to be the case. So just like wire()->pages->get() works for the parent you can also use wire()->templates->get(...) for the template instead of a plain template name. When using a function call like @Jonathan Lahijani does in the issue the context is different again and makes the code work.
  3. Thx! I knew this must be possible. I think I even saw this problem recently, but forgot ? .modal-buttons { display: flex; flex-wrap: wrap; gap: 5px 1rem; > button { flex: 1; min-width: fit-content; } } Solved that one as well! Im using an absolutely positioned (left-0 bottom-0 right-0) wrapper inside the button. There I use flex + flex-wrap so that elements stack on top of each other if there is not enough space. And then I use overflow-hidden on the button to hide overflowing words ?
  4. Follow-up question! In the background you see the "add to cart" button. It is done like this at the moment: <a href class='@container uk-button uk-button-primary uk-width-1-1 !bg-maletschek' @click.prevent='addToCart' > <span class='hidden @[180px]:inline-block'>In den</span> Warenkorb </a> I'm using container queries here with a setting of 180px, which is again a hardcoded value. Is there any way to show "In den Warenkorb" if there is enough space for the button and show "Warenkorb" if not?
  5. I'm working on RockCommerce cart functionality and I'm using this markup at the moment (UIkit + TailwindCSS combo): <div class="uk-flex flex-col [@media(min-width:500px)]:flex-row uk-flex-between gap-1"> So for screens <500px it's flex-col and above it's flex-row with uk-flex-between to make the buttons left and right aligned. I don't really like the custom breakpoint though. This website is single-language, but what if it was translatable? The breakpoint of 500px would probably cause issues. So I'd like to know if anybody has some css magic to make it work the way I want in all situations? ? Thx!
  6. The latest release fixes a bug that was caused by a recent chrome update where moving blocks led to selecting the underlying text: And after the fix: Happy dragging&dropping ?
  7. I did not try, but maybe you could redirect any non-ascii url to some custom php file (like redirect.php in the site root) and that file could bootstrap PW and redirect to the new page? Something like this: # Redirect URLs with umlauts to redirect.php RewriteCond %{REQUEST_URI} [äöüÄÖÜ] RewriteRule ^(.*)$ redirect.php?url=$1 [QSA,L] <?php // Include ProcessWire bootstrap include "index.php"; // Get the URL from the GET parameter 'url' $url = isset($_GET['url']) ? $_GET['url'] : ''; // Sanitize the name using pageNameTranslate $pageName = $wire->sanitizer->pageNameTranslate($url); // Find the page with the sanitized name $page = $wire->pages->get("name=$pageName"); // Redirect to the found page if ($page->id) { $session->redirect($page->url); } else { // Handle the case where the page is not found $session->redirect('/'); }
  8. Everybody using the cool ajax endpoints feature please update to v3.16.1 as it contains an important fix (added missing return statement in public endpoints). @gebeer
  9. I don't think it's off, because in ProcessWire we have both the Frontend and the Backend. As far as my research took me I don't think that Strapi offers that, does it? So you have to build your frontend on your own, add another tool and tech stack...
  10. v1.7.0 now ships with all DejaVu fonts by default, so you can use all combinations of bold and italic text without the need of adding custom fonts beforehand ?
  11. Update: The module is now available in the modules directory ?
  12. If the developer of your website hasn't implemented such a feature, you won't be able to find it. ProcessWire will only let you do things that the developer thought were a good idea. And many developers will probably think that letting the client insert untrusted code is not a good idea... You'll find the code of the website on the server. Usually you can connect via FTP or some hosting providers have web based file management tools. From there it should be quite easy to find the file to put the code into. Usually it will be in the /site/templates folder. If you have a _main.php file there this will most likely hold the main markup of your website that all pages use. If not you can open /site/templates/home.php or /site/templates/basic-page.php and inspect the code there. If those files all have something like <?= include('sections/footer.php') ?> you'd put your markup in one of the included files that get's included by all templates.
  13. Hey ProcessWire friends! @protro asked something about Strapi in another thread, so I did a quick research on how to build a basic frontend for content stored in Strapi and found this 20+ video on youtube: Now, don't get me wrong, Strapi is cool and all and the video is really great, but I couldn't help but chuckle thinking about how we do basically the same in ProcessWire. Here's our "epic" version: <?php foreach($pages->find('template=faq') as $faq) { echo "<div><h2>{$faq->question}</h2>{$faq->answer}</div>"; } Boom! Done in a few lines. No need for popcorn or a comfy chair. ? Cheers to simplicity and efficiency! ? #ProcessWireFTW #KeepItSimple #LessIsMore
  14. Hey @netcarver and @gebeer great news for you (and all RockFrontend users) I've fixed an issue with ajax endpoints not replacing ALFRED markup (thx for the report @gebeer) and while working on that I got quite a lot of errors in the console about the livereload stream having a wrong mimetype, which has also been observed and reported by @netcarver some time ago. So I fixed that as well ? Please try the latest version on the dev branch, which will be merged to master in some days. LiveReload only reloads the visible tab. This is to avoid endless loops where one window reload causes the other one to reload as well and vice versa. In older versions you had to reload the tab manually once you switched back to it. In the latest version it will wait and as soon as you switch back to the tab it will be reloaded automatically if a file changed in the meantime ?
  15. Thx @adrian I have to clarify this: In my inputfield (InputfieldRockGrid, but could be any inputfield) I have added a method "renderReady" like so: <?php public function renderReady(Inputfield $parent = null, $renderValueMode = false) { $grid = rockgrid()->getGrid($this); if (!$grid) return; wire()->modules->get('JqueryUI')->use('modal'); // load all dependencies // this can safely be called multiple times // it will only load the assets once $this->wire->config->scripts->add( rockgrid()->url(__DIR__ . '/lib/tabulator.min.js', true) ); // some more assets here return parent::renderReady($parent, $renderValueMode); } I always thought this would be the way to go when creating inputfields/fieldtypes, but renderReady is never triggered. That's why I created the hook shown in the first post, which is executed on the parent's "render".
  16. I'm having some troubles with using the renderReady method of inputfields. The first problem that came up was discussed with @adrian here: https://github.com/baumrock/RockAdminTweaks/commit/1c327039f22138725c2dfdc9e659525f2f59011b#commitcomment-142442415 It looks like the renderReady() method is never called for InputfieldCheckboxes. Another problem came up today when developing RockGrid. That inputfield needs some JS+CSS assets to be loaded whenever an inputfield of this type is rendered in the backend. I thought loading the assets in renderReady would be the right thing to do. But it does not work if the field is inside a repeater. I used this hook to fix this: <?php public function init(): void { wire()->addHookAfter('Inputfield::render', $this, 'preloadRockGrid'); } protected function preloadRockGrid(HookEvent $event): void { // if it's not the repeater field exit $f = $event->object; if ($f->name !== self::field_variations) return; // loop through all fields of the repeater and load their assets foreach ($f->hasField->fields as $fname) { $field = wire()->fields->get($fname); $inputfield = $field->getInputfield($event->process->getPage()); $inputfield->renderReady(); } } This works but it is really hacky and I'd like to have a proper solution for the problem and try to understand better what's going on and why things do not work as expected. Can anybody shed some light on this?
  17. Hi @Christophe I can't reproduce. Please provide step by step instructions then I can try to fix it.
  18. Thx for sharing! I'm not having any issues, so I'm wondering why? I'm using latest UIkit and latest LESS module. Do I have to adjust something specific? Would it be worth to create an issue for the uikit team so that they can account for that use case?
  19. Another very interesting approach by @netcarver and @FireWire:
  20. Hey Ryan, thx for these additions! I'm wondering if there is a way to open a modal and then react/wait for something within that modal. For example we could maybe create an action for a page reference field to create a new page. When the page is successfully created in the modal and the modal is closed we could trigger the inputfield's reload event and the user could instantly select the newly created page.
  21. @sebibu you can easily hook into https://processwire.com/api/ref/session/login-success/ and add the last login timestamp as $page->meta('lastlogin', time()) on the $user object (for example).
  22. AI help sounds good: Certainly! You can use a hook to modify the output of a Page Reference field when it is set to "Open + Locked (not editable)" by hooking into the `renderValue` method of the `InputfieldPage` class. Here is an example of how you can achieve this in ProcessWire: // Add this to your site/ready.php or a custom module $wire->addHookAfter('InputfieldPage::renderValue', function(HookEvent $event) { $inputfield = $event->object; $page = $inputfield->value; if($page instanceof Page) { // Modify the output to include a link to the referenced page $event->return = "<a href='{$page->url}'>{$page->title}</a>"; } }); This hook will intercept the rendering of the value for `InputfieldPage` fields and modify it to include a link to the referenced page. Make sure to place this code in a file that is executed on every request, such as `site/ready.php` or within a custom module's `init` method. For more information on hooks in ProcessWire, you can refer to the https://processwire.com/docs/modules/hooks/
×
×
  • Create New...