-
Posts
339 -
Joined
-
Last visited
-
Days Won
8
Everything posted by monollonom
-
Hm this is actually happening when saving the page, while I was looking to be able to show the "Create new" link in the admin panel. Sorry I must have not been clear enough in my post. But you pointed me to the right place to look at, I think I should instead change the parent_id in a beforeHook of https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module#L682
-
Hi, I'm looking for the right hook to change the parent_id property of an InputfieldPage. I have another InputfieldPage in my template which determines the parent of the selectable pages using this hook : $wire->addHookAfter("InputfieldPage::getSelectablePages", function($event) { $page = $event->arguments(0); if($event->object->hasField == "subcategories") { if ($page->category) { $event->return = $event->pages->find("template=subcategory,parent=$page->category"); } else { $event->return = []; } } }); But in order to be able to create new pages using the field I need to dynamically change the parent_id before it [the field] is created in the edit page. What would be the right hook (or way ?) to do so ? Thanks !
-
ProcessWire .htaccess adding URL parameter to redirects
monollonom replied to FireWire's topic in General Support
I'm going to have to do the same — migrate a website to Processwire and redirect to new pages’ url if need be — but I thought of using the Page Path History (core) module and its ability to add new redirect URLs per page. Have you tried it ? Have anybody used it that way ?- 15 replies
-
- multilanguage
- redirects
-
(and 2 more)
Tagged with:
-
processwire.dev — Tutorials for web development with ProcessWire
monollonom replied to MoritzLost's topic in Tutorials
Thank you for sharing ! I've already had a good read and it's interesting to see your way of dealing with PW. I'm not sure I'm into Twig, but I really like the way you're organising your files and allowing to use composer / nodejs, I'll try that in my next project. I would also be interested to read more about your development flow, like how you deal with git or the transition between local and prod environments. -
Hi all, After seing the website featured in the latest Processwire weekly (thank you @teppo !!), I thought it could be nice to post some details here. I have actually made a few websites using Processwire, but it's the first time I'm posting one in the showcase. Backstory I made a first version of this website in end-2017 when I was starting to use Processwire after a friend recommended it to me. I was in charge of the front/back-end, and helped a bit on the design. At the time there was a slideshow of featured projects as the homepage, the project page was the only template with content blocks, and the information pages (about / contact) were specific templates. About the content blocks, I didn't know about the Repeater Matrix module so I kinda implemented my own, having a simple Repeater with a Select Options field defining which fields to display. All in all the website was pretty nice when it came out and I learned a lot in the process, but this year the agency wanted an update to fit their new narrative, so it was a nice opportunity to make some due changes. Back-end Modules I used : Repeater Matrix ProCache Seo Maestro Email Obfuscation Inputfield Chosen Select Color Minimal Fieldset Page Field Edit Links Runtime Only Tracy Debugger (of course!) This new version is all about content flexibility. The information pages now all share the same template, allowing them to create as many as they want. Each visible templates ("home" / "page" / "project") contains a Repeater Matrix field for content blocks, with 15 different types to choose from and options to add variations in the layout. Front-end To answer to the PW Weekly : it is indeed all custom-made except for three external libraries : plyrjs, flickity and lottiejs. I really like sveltejs but I still have to figure out how I could mix it with PW in my process. The animation in the introduction is described by a .json file and displayed as a SVG using Lottie. The transition colors can be changed. The menu order is defined by the manual sorting in the admin... I don't really know what to say here since it's all hand-made, let me know if you have any question! Screenshots Thanks !
-
For one of the latest website I did, the client asked if there could be an integration of some sort with DeepL since they were using it for translation. And now your amazing contribution is out ! It looks great and I might use it for the next project with this client next year. Thank you !
- 220 replies
-
- 1
-
- translation
- language
-
(and 1 more)
Tagged with:
-
Module Module: RuntimeMarkup Fieldtype & Inputfield
monollonom replied to kongondo's topic in Modules/Plugins
No worries and sorry, I must have missed these posts... -
Module Module: RuntimeMarkup Fieldtype & Inputfield
monollonom replied to kongondo's topic in Modules/Plugins
Hi, I tried your module but in the end went for @Robin S 's one. However when trying to uninstall the inputfield first, I had an error saying the class "RuntimeMarkupUtilities" did not exist. I just cut-pasted it from the fieldtype to the inputfield and all went good after that. I don't know if it changes anything when using the module, but it might be worth to update the code to ease the uninstall process. -
Hi, (disclaimer : I'm a noob at sql) I am facing a situation where I would need to get the titles of pages linked in a page reference within a repeater. I tried a few combinations but each time I get an empty array. Maybe somebody can point me to the right direction ? Context : I have an event page with sub-events (repeater), each of which are held by different persons (page reference). Thanks ! Edit : in the end I created a page reference field in my template that is populated with the persons linked in each sub-events, using a hook. Simpler...
-
Hey, PR author here, just wanted to thank you for this great module @bernhard. I wrote a module which was loading more than a thousand pages and it was taking almost a minute to load... now it's down to a second or less ! ?
-
Hi, I have an issue when I try to save a profile page from a non-superuser. The server gets stuck and returns a Allowed memory size of X bytes exhausted It is pointing to a line in a file, usually WireHooks.php, but I couldn't get anything more out of Tracy nor Processwire's logs so I started to put some echos here and there in the runHooks() function. Apparently what is happening is that a "viewable" method gets called in loop through hooks. It seems to be related to a PagePermissions object as seen in the attached screenshot (here's a gist with the echos in the runHooks() function : https://gist.github.com/romaincazier/453261d49310aee4a279ac1c2352df9f) but I don't really know what to do from here. I tried to check the "user" template's view and edit access but it doesn't have any effects. In my setup I created some modules that add hooks but nothing related to this. Just in case I tried to uninstall them but it didn't have any effects as well. Is it possible that hooks are persistent ? Is it possible to remove all custom hooks ? Yeah... I am pretty lost here. Last step would be to do a clean install, install my modules, and see how that goes. Thanks in advance.
-
(TL;DR : I extended from Inputfield instead of InputfieldMulti. Still learning...) Hi, I'm trying to create my own Fieldtype to go along a custom Inputfield, but I can't manage to get it to work, even though it's almost identical to @ryan's FieldtypeEvents exemple. For some reason, when I hit save, there is an error saying PHP Warning: PDO::quote() expects parameter 1 to be string, array given in .../Ateliers-Renens/cms/wire/core/WireDatabasePDO.php:675 Trying to debug by comparing with the initial example behaviour, I can see that my data is properly received / translated in sleepValue() but then in sanitizeValue(), $value returns me an empty instance of my custom class. I attached screenshots showing that for both Fieldtype (the first three dumps are from sleepValue() and the last dump is from sanitizeValue()). I don't know if it has anything to do with my problem, and I must admit that I'm not that fluent in either PHP / SQL (even though ProcessWire makes me learn a lot !). In the meantime, I am going to go for another solution (just using two regular fields), but I will be glad if someone could help me on this (and make me understand where the problem is !). Just in case I made a gist : https://gist.github.com/romaincazier/43fb7c0ee1e57395fb9e839039f38100 and attached a zip (MapRoom.zip) if someone wants to install on their side, the Inputfield expect something like "0|1" (0 = room n°0, 1 = 1st floor). Thanks !
-
Not a question but just a thank you @bernhard for your great tutorial. I was already amazed by Processwire's capabilities (at my beginner level) but this new tool is coming very handy for a current project I have but also future ones. Actually I may have a question: is there a way to execute a function before you exit a page ? I have a cancel button which brings me back to the previous screen, along with a notification warning that the adding process has been canceled, but would it be possible to do the same when clicking in a tree link for example ? Thanks ! Edit: I'm using this for the inputfield, works as well: $form->add($this->fields->get('field')->getInputfield($this->page));