Jump to content

monollonom

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by monollonom

  1. Ah and so basically an editor could set one particular copy back to a regular “date” (uncheck “recurring”) and then be able to edit this specific one, which is nicely thought! Maybe this could be implied by the UI (and maybe it already is?!): if there is $date->mainPage, hide the options to create copies and instead display something like “This event is a copy of ‘Main Page’” with an option to break the connection (and allow to create copies from there) or suggest to uncheck “recurring” to be able to edit the event. I wonder if the fields should also show that changes won’t be applied if it’s a copy as well?
  2. It’s an interesting mix indeed. Would you say these copies act as aliases but with their own date? Does it require a special template or is it that your module dynamically add a page reference field to the copies and then your module add hooks to get the main event’s data at runtime? What is very nice is it makes it super easy for the editor to edit a specific copy. Among many other benefits 🙂 The only downside I can think of in your setup is what if a recurring event gets cancelled? Is there a way to easily delete the copies? If you have a page reference field it shouldn’t be too hard actually... Maybe? If I rephrase what’s happening: you create the event, set its date to "recurring" and go ahead and create your copies. Then you save the page. If you edit it again, you have the "recurring" date type selected with the options to create new ones, but no indications of the copies previously created. Is this correct?
  3. I think I missed something: is the "Recurring" option creating copies of the current page (event)? In my case there is no copy, just an array of occurences (array of dates basically) that remain bound to the page and that I’m using when querying events. This does mean I always display the same content. That’s why I’m asking: the dates are generated and then remain, I can disable some and if a selector involves a disabled occurrence, the event will not show up. Thus some occurences can be in the past. But again my question comes from me misunderstanding what your module is doing (even though it’s clearly specified in the fieldset’s label 😅). Another question then: once you created the events, what happens if you save the page? Are the copies displayed in your table or does it start from scratch? (thank you for taking the time to answer)
  4. Another thing got me curious: In your gif it looks like you have a calendar in a page, would the idea be that you could have a calendar in a template and then (maybe) show events that could be child pages or pages that match a selector with a page reference field (e.g. for event categories)? This has a lot of potential I think.
  5. What I’m finding particularly useful is your date Inputfield on steroids allowing you to cover almost all cases. On a recent project I went with a FieldtypeCombo + FieldtypeTable to achieve something similar: If the event is happening indefinitely, I create the first 1000 occurences and have a button to create a 1000 more, like in your screencast (though not live). The one thing missing in my contraption is hiding past occurrences (but keep them just in case). In your example, does clicking on the trash icon delete the occurrence or just deactivate it? Having a calendar UI would of a course be a really nice thing to have as well for clients 🙂
  6. After doing a test and seeing your gif could it be because you’re also slightly moving the mouse on the Y-axis? Maybe the slider should stick to one axis once you passed a certain threshold?
  7. I also had to set the collapsed property dynamically and thankfully @Robin S has got us covered ? Just replace the hook to be on Field::getInpufield and it should work.
  8. In your home page can't you set the English page name as /en/ and leave the German one as / ? Edit: just tried and turns out you can't, as it automatically set the name to the main language's one of you leave empty
  9. Actually having a demo per (first party) site profile would be a good showcase of how these can be good starting points while showing how versatile PW can be, e.g. with the (great) invoice profile.
  10. One can have a look at how others do it: https://plugins.getkirby.com/ There the navigation is clearer as the categories are tucked away under “Types” and allows to have a clearly visible “Paid modules” menu link (Pro Modules could go under there as well as “First party paid modules”). Also they have no centralized way of selling modules, authors adding links to their own ecommerce solution (be it a custom one, Gumroad, ...). One thing I note though is even the paid modules are released on Github (but always mentionning how they are not “free software”), on PW modules are also required to have a Github page to be listed (I assume to be auditable / accountable). Regarding a blog post, I’m not selling anything but I guess it could be nice even though it remains a one-off promotional tool.
  11. This is a bit of a long shot given your description and the fact you don’t have access to the php files but maybe this has to do with URL Segments ? Head to Templates > Course (or whatever the template’s name is) and under the “URLs” tab have a look at “Which URL segments do you want to allow?” and add there the “contact-persons” segment on a new line (if “Allow URL segments?” is on, that is)
  12. You’re not losing your mind ? https://processwire.com/blog/posts/new-repeater-and-repeater-matrix-features/#custom-icons-for-repeater-types
  13. The simplest in this case would be to use the module you mentioned in your first post. To me, it’s not so overkill
  14. Try moving the page in the page tree (e.g. above "Access" and then back) to clear the navigation cache, then it should work:
  15. Yes I noticed it right after posting ?. It’s because the URL is not the one for editing the page. Add this hook to init.php and move back again the page to clear (and update) the navigation bar’s cache: $wire->addHookAfter("AdminThemeFramework::getPrimaryNavArray", function(HookEvent $event) { $settingsPage = $event->pages->get("template=settings"); // replace accordingly $primaryNavArray = $event->return; foreach($primaryNavArray as &$adminPage) { // pass by reference if($adminPage["id"] === $settingsPage->id) { $adminPage["url"] = $settingsPage->editUrl(); break; } } $event->return = $primaryNavArray; });
  16. To have your page shown in the admin menu, you have to have it under the /admin/ page. Move it there, reload, and you should see "Settings" in the menu bar. Edit: actually it's not that simple as the url in the menu is not the one to edit the page! My bad! Let me check for a fix
  17. My unsolicited opinion regarding a media manager: what I like about images / files being tied to a specific page is that it avoids creating clutter since the files are deleted when they're not needed anymore (the page is deleted) whereas if it was in a media manager you would probably end up with a lot of garbage. But I second the idea of maybe having something like @Robin S’ https://processwire.com/modules/process-media-lister/ to select an image from another page that would then be automatically duplicated on save.
  18. Thank you for these updates @ryan! A small note / bug though: you forgot to check if the userActivity module is installed in the `userActivityReady()` function
  19. This is absolutely fantastic and very timely as I was thinking of tackling the same issue in one of our current projects!
  20. It does look more refined now, I was especially triggered by the animation of the “>” not being centered vertically while rotating ?
  21. Congratulations to both of you! I wish you all the best as well. Small note: it seems the font you’re using has a (rather common) vertical metrics issue on Firefox leading to your text being cut by the overflow: hidden You can learn more / test your font here: https://vertical-metrics.netlify.app/ and then maybe get in touch to see if this can be fixed by the type foundry
  22. monollonom

    Dynamic CSS

    I have no idea how Tailwind works but when I need something like this I usually set a CSS variable and add them with the style attribute where needed. Something like: <?php namespace ProcessWire; ?> <div style="--color: <?= $page->color ?>"><!-- My content --></div> When I need something more complex, say a CSS animation depending on some of the page parameters (e.g. children count) then I output in a <style> element within my template.
  23. Sure! In your js: window.addEventListener("load", () => { const headers = new Headers({"X-Requested-With": "XMLHttpRequest"}); // needed for $config->ajax to work const links = document.querySelectorAll("a.ajax"); const main = document.querySelector("main"); for(let i = 0; i < links.length; i++) { links[i].addEventListener("click", async (e) => { e.preventDefault(); loadPage(e.currentTarget.href); }); } async function loadPage(url, options) { const page = await fetch(url, { headers }); main.innerHTML = await page.text(); } }); And in your php: <?php namespace ProcessWire; ?> <?php if(!$config->ajax): ?> <main pw-id="main" pw-append> <?php endif; ?> <article><!-- Your content --></article> <?php if(!$config->ajax): ?> </main> <?php endif; ?> <?php if($config->ajax) exit; When opening the page directly it will go the usual route, outputting your content within <main> but if requested with ajax then it will only send the content and exit() so no other file is appended (_main.php in my case).
  24. @ngrmm both ! I make a fetch call from js and then check in the back-end using $config->ajax to only echo parts of my templates and exiting early to avoid my _main.php to be appended (because of the markup regions output strategy).
  25. I guess best would be to either have a help popup, which I’m not fond of, or display the help text differently. I’ll stick with this for now as I think I’ve made enough changes but maybe I’ll come back to this later on. Thank you again for all the feedbacks. My bad on this one, thanks for pointing it out.
×
×
  • Create New...