Jump to content

monollonom

Members
  • Posts

    338
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by monollonom

  1. The simplest in this case would be to use the module you mentioned in your first post. To me, it’s not so overkill
  2. Try moving the page in the page tree (e.g. above "Access" and then back) to clear the navigation cache, then it should work:
  3. 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; });
  4. 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
  5. 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.
  6. 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
  7. This is absolutely fantastic and very timely as I was thinking of tackling the same issue in one of our current projects!
  8. It does look more refined now, I was especially triggered by the animation of the “>” not being centered vertically while rotating ?
  9. 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
  10. 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.
  11. 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).
  12. @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).
  13. 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.
  14. I should give you guys an early access to our websites in the Beer Garden lol Thank you though for the valuable feedbacks, it’s the kind of things you can have a hard time to see once you’re deep into projects with unconventional design: you get used to it and think it’s “understandable” enough. I went ahead and made the grey text darker and I’ve displayed the title in the center when you hover the outer strands. I also increased the contrast when hovering these. I hope this will do. Please don’t look at my code ?
  15. This is pretty neat, thanks for sharing! Until now I was adding these admin css tweaks through $config->styles in admin.php and thus I had a plethora of “!important” in my CSS...
  16. There is actually a help text: the one on the rotating circle inside (desktop) / outside (mobile) but it’s dismissed after the first click wherever. I’m going to change it so it remains as long as you didn’t click on a “post” strand. Also, were you on mobile when seeing the website? It’s a tougher UI there for sure without hover... If not, did you notice the title of the post appearing in the bottom bar when hovering a strand? Maybe I could add at least a title="Open ”Title of the post”" so you have another hint when hovering. In any case, thank you for you comment @teppo! Edit: changes applied ?
  17. Hi all, I'm happy to share with you this website we launched two weeks ago for a Swiss movie in pre-production phase. The client wanted to have a blog to document the project and allow users to contribute posts through a form but also with a login to the admin which — once approved — gives them access to more options for their contribution’s content. Right at the beginning they came to us with scientific visualizations as references and thus I finally got to try D3.js. I’ve known about it for a very long time but never got a chance to try it out. It wasn’t easy but in the end I managed to get (what I think is) a pretty satisfying result. And here is a sample of the modules we used: - Fluency ⭐ - TracyDebugger - FormBuilder - RepeaterMatrix - AdminRestrictBranch - FieldtypeOembed - PageRenameOptions - MarkupComponents - Login Magic Link: this is a new one allowing to login with a link sent to the user’s email (inspired by this thread). It’s almost ready to share but I want to create a Process to have an overview of the generated links first Enjoy!
  18. Maybe then the version would finally bump from 3.0.x to 4.0.0... ?
  19. I’ve never tried myself, but I assume you could achieve this using the “PagefileSecure” option in your template holding the files: Which would then allow you to hook into ProcessPageView::sendFile: $wire->addHookAfter("ProcessPageView::sendFile", function(HookEvent $event) { /** @var Page $page */ $page = $event->arguments("page"); if($page->template == 'admin') return; /** @var Pagefile $file */ $file = $page->filesManager()->getFile($event->arguments("basename")); $page->of(false); $count = (int) $file->filedata("downloadsCount"); $file->filedata("downloadsCount", ++$count); $page->save(); }); And then later on retrieve and display the downloads count.
  20. Then you need to look for the home’s name in the user’s language, either $pages->get(1)->getLanguageValue($user->language, "name"); or $pages->get(1)->localName($user->language);
  21. If you’re talking about the current page you could go with https://processwire.com/api/ref/wire-input/canonical-url/
  22. Most likely it’s because FieldtypeOptions is not an allowed fieldtype as a custom field. You can check this in FieldtypeFile’s module page (or in PW’s source code). I don’t know why that is though. An alternative could be to use a FieldtypePage instead.
  23. If this content is not editable you could use FieldtypeCache (a core module) and FieldtypeRuntimeOnly. Create a FieldtypeCache field “sms” and select the fields you would like to combine under the “Details” tab. Create a FieldtypeRuntimeOnly field “preview_sms_content” (instead of your textarea) and edit the associated php file to have something like: if(empty($page->sms)) { return "No content yet"; } else { $sms = implode(" ", $page->sms); return "$sms (" . strlen($sms) . " characters)"; } Add both fields to your repeater, save and you should see the SMS preview. Edit: actually you could skip the FieldtypeCache and just concatenate your strings in the FieldtypeRuntimeOnly php file...
  24. But then you lose the ability to contextually edit the field or set the column width, though I agree InputfieldTextTags has a great UX and I try to use it whenever I can. There could be an equivalent to InputfieldPageAutocomplete for fields but I always feel it’s way slower than text tags...
×
×
  • Create New...