-
Posts
1,358 -
Joined
-
Last visited
-
Days Won
16
Everything posted by elabx
-
if($item->matches('parent=1223')){ ... } Maybe try this?
-
Repeater Backend Edit: Can’t save page ... Call $page->of(false)
elabx replied to kater's topic in General Support
Iterating for output shouldn't be an issue, could you post a more complete code sample?? I only see an empty for loop on your previous post. -
Repeater Backend Edit: Can’t save page ... Call $page->of(false)
elabx replied to kater's topic in General Support
Before editing/saving any repeater item call: $item1->of(false); $item1->title = "new title"; $item1->save(); More info here: https://processwire.com/api/ref/page/of/ Repeater items are themselves RepeaterPage objects which is a class that inherits from Page, hence the formatting flag applies too. -
Can you try: wire('pages')->find("template=repeater_grid, mp4!='', ratio='', check_access=0"); find() won't find the repeater data pages since they would be restricted due to access control.
-
For publish/hide you will only need to setup access control accordingly in the role that the users will have. Settings can be disabled with RestrictTabView. I think this is the one that might require some css to display none, or look for a hook where you could edit this markup.
-
That's weird, they should show on any page that has the right template with the repeater and with the fields added to it. Do you have more info to share? Some screenshots maybe? And you shouldn't need to delete and repopulate anything, new fields should just show up!
- 1 reply
-
- 1
-
-
[SOLVED] Page Field Select From Grand Parent of Page?
elabx replied to prestoav's topic in General Support
I think the error comes from trying to use PHP variables? I have approached this using the getSelectablePages hook and a couple others to enable dynamically adding them to different parents depending on their position within the tree,. (Bear with me since I am basing this example this from a very old project I have that "cascades" options into children page fields, it might not work exactly in a copy/paste fashion) Ok so this hook gets the pages only under the closest faq-parent of the current page with the reference field: $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { $page = $event->arguments('page'); $event->return = $page->closest('template=faq-parent')->children('template=faq-category'); }); Now, the tricky part when doing this dynamically and adding new pages is selecting the right parent, which from some old code I have lying around has to be done sort of like this: $wire->addHookBefore('InputfieldPage::processInputAddPages', function($event) { $field = $event->object; $page = $field->hasPage; $parent_id = $page->closest('template=faq-parent'); $field->set("parent_id", $parent_id); }); And this last step I am not super sure, but I think it is needed to enable the Add New pages part. $wire->addHookBefore('InputfieldPage::renderAddable', function($event) { $field = $event->object; $page = $field->hasPage; $parent_id = $page->closest('template=faq-parent'); $field->set("parent_id", $parent_id); }) -
I can confirm I use this a lot too!! It also merges updates on fields and templates. I think the only caveat I have is that it doesn't work 100% with FieldtypeOptions. And the pages import/export is crazy good, works with absolutely every native field I've tested with, even complex Repeater Matrix/Repeaters. I just recently used it to migrate some old sites, into a new "template field schema" and I cannot even estimate how much work it saved lol
-
I think the current best way out to handle this is using RockMigrations. And yes, you write a migration script that runs on the live DB, to updated whatever configuration you need on processwire templates/fields. Be sure to have your backups in place ?
-
I'm a big fan of HTMX. It's kindof like "lower level" than hotwire and not sure if even comparable to Livewire. And there is also the Intertia.js adapter if you want to take a look.
-
@benbyf still in very early progress and I don't see how it would help with the front week view. The original module did have some rendering modules attached but those are the last priority in this refactor.
-
module Recurme – Processwire Recurring Dates Field & Custom Calendar Module.
elabx replied to joshuag's topic in Modules/Plugins
Supposedly this dude is rebuilding it ? Ok seriously, trying hard, but my time is also limited right now, I almost have the UI rebuilt in Alpine, just need to wrap my head around the Fieldtype interface. But I'd say it's still at like 20% - 30% I am trying to get a run at it asap to build the bare minimum, without the Markup modules, which I also need anyway lol -
Wire404Exception() and wire404() causing redirect loop
elabx replied to digitalbricks's topic in General Support
Hi @digitalbricks! Did you ever figure out what was going on? I am having a similar situation while loading two pw instances. -
Is it possible to do this now? Say, for example, I want to save a FieldsetPage doing something like: $page->setAndSave('button.url_address', $value); EDIT: I think it's not, just reviewed the Page class ?
-
I read on twitter, "an HTMX ad!" ?
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
elabx replied to Nico Knoll's topic in Modules/Plugins
Though I wonder what do you want to do?? To updated the title/description/image if it has changed? -
PW 3.0.175 – Core updates: new DB scalability feature
elabx replied to ryan's topic in News & Announcements
Not the exact same scenario, but I experienced this using Amazon RDS and even if queries where fast, I did notice the hit of latency. But like 99% of my experience is with mysql hosted on the same machine, so nothing more to add here. -
MarkupSEO - The all-in-one SEO solution for ProcessWire.
elabx replied to Nico Knoll's topic in Modules/Plugins
@fruid I think the fields is named "seo_title"?? So it would be $page->seo_title = $page->academicrank.' '.$page->givenname.' '.$page->lastname; -
Something I remember trying too, but don't recall if it worked, is adding some Js to the admin to dynamically add the options after an ajax call literally editing the markup. If you're working on recent PW version I'm going it should be straightforward with the new URL hooks. So: Listen to on change event on the theme fiel, call backend with picked value, and do some js work to generate the options for the field and append them to the highlight colors select. Maybe something like this will work better for the scenario where you wan't to use repeaters, although I guess it will involve more work to handle the creation of new repeaters, but I am almost sure there are js events for that. Another idea that I also don't remember if it worked is, using the reload method on the inputfield.js API. So maybe then you just have to listen to the on change on the first field, and trigger reload? Maybe that'll load the field again with the right options?
-
Not sure sure this can be achieved only with the configuration fields. My first idea is using the Custom PHP code option of the Page field, where you can hook into InputfieldPage::getSelectablePages, then after you have selected the Theme options and saved the page, you can use this hook on the Highlight Color options to get only the colors available through the specific theme previously selected. Check the field's option to view an example. Alas, this might not be the most "intuitive" There is also the Dynamic Selects option which most likely will provide the best interface (without having to do the page save)
-
Just stumbled into this package and reminded me of this discussion, thought it might be worth dumping it here, maybe the goals it means to solve resonate with the ideas exchanged here: https://fractal.thephpleague.com/
-
Did you try using transactions ?? That worked for me to save an indefinite number of pages without running out of memory. Thanks for sharing!
-
Not really, since from the beginning it has been PHP >= 7.0.0
-
Yes! No updates on code, it really works out of the box in most cases! It grabs the output of your templates and right before rendering it does it all, swaps the script, style tags and there you go, minified and merged. What I do when I have this requirements is to just minify what is required on every page, and whatever libraries that are just loaded to work on a specific context I load them separately, you can add "?NoMinify" to the src url to let know ProCache that a specific file should not be loaded. Comments are removed from HTML for sure! Not sure if from CSS too, I can't remember now. <!-- this might include jquery, htmx or some other library you'll be using everywhere, and are originally placed like this in your template file: <script src="/site/templates/js/jquery.js"> <script src="/site/templates/js/somethingesle.js"> ProCache turns it into the following, right before output: --> <script src="/site/assets/ProCache/minified.pwpc.js"> <!-- that other fancy slideshow library you use in a specific block, this won't get minified/merged in the block above --> <script src="/site/templates/js/slideshow.min.js?NoMinify">
-
Display multiple fields in the page search (backend)
elabx replied to lenoir's topic in General Support
Or InputfieldPageAutocomplete? haha