-
Posts
1,307 -
Joined
-
Last visited
-
Days Won
16
Everything posted by elabx
-
Calculate estimated reading time of content inside matrix field
elabx replied to Zeka's topic in General Support
What about finding the fields first? $textFields = $fields->find('type=FieldtypeTextarea|FieldtypeText') $page->builder->find("$textFields!=''")->each(function ($item) use (&$content, $sanitizer) { $content .= $item->get(...); }); EDIT: Oh just read again about "text extended fields". This obviously won't work :/ Maybe: $textExtendedFields = []; $fields->each(function($f){ if(wireInstanceOf($f->type, "FieldtypeText") === true) { $textExtendedFields[] = $f; }; }) -
I wonder if you should rather, delete() every page also, not use removeAll() because I think it's just removing it from the object, not from the db. foreach($pages->get("template=home")->submissions as $s){ $s->delete(); }
-
Wow old issue! This is still not working! :O
-
Has anyone done a non-geographical map? That is, an image of a mall, a park, plaza, etc with markers and some navigations (zoom/pan). Any js libraries to recommend? Found this: https://leafletjs.com/examples/crs-simple/crs-simple.html Something like this is the closest i could find, but don't know how much I'll be able to hack it to save maps in PW: https://codecanyon.net/item/image-map-pro-jquery-interactive-image-map-builder/2792438
-
Repeater Matrix - Populating a Repeater Matrix via API
elabx replied to Marc H.'s topic in API & Templates
I THINK, in your saveReady code you are trying to get a page that is not yet saved, so that's why you get a Null reference. This two lines are king of redundant, because argument 0 will always be a Page object, but saveReady is happening like the hooks says, just before saving, so when you try to find a page with $pages it doesn't find it even if you already have a Page with an id. -
Repeater Matrix - Populating a Repeater Matrix via API
elabx replied to Marc H.'s topic in API & Templates
When creating the page you have to set the number in the field "repeater_matrix_type". $repeater_field->repeater_matrix_type = 2 Now the problem is how to get the numbers, if you inspect the repeater matrix module configuration ($modules->getConfig('FieldtypeRepeaterMatrix')), you could get the info from there. Basically every repeater matrix type has a number. You can also get this info by inspecting the html from a repeater matrix field, you will see that the fields have a number prepended. That sounds like you are referencing the page in the wrong way, if you can paste all the code of your hook we could help a little bit more, the page being saved should be accessed like this: $page = $event->arguments(0); -
@Juergen this is too much for monday! haha. But you know, looking at the config page, this list probably generated on runtime because there is also no way to delete them on the config screen, I took a look at the source code and I THINK, it's happening here, so maybe you can call executeNavJSON?: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module#L151
-
Maybe it's because the Array is printing as true? I don't see what could be going wrong! Have you tried: print_r($data, true);
-
HI! Awesome module @Wanze! Does anyone know if this module allows a fallback field (or lists of them) within the page if for example, the description is not set?
-
You don't need to include_once() if the vendor folder is in the ProcessWire installation root, it has loaded the libraries already, if i remember correctly the index.php of PW takes care of this. I am also almost sure you also have to have the use statement like @Edison points in the examples.
- 9 replies
-
- 1
-
- include
- phpspreadsheet
-
(and 1 more)
Tagged with:
-
Hi! Has anyone tested this module with recent ProcessWire versions?
-
Why is composer an overkill? You are one command away from the library! The docs don't seem to offer the library as a package.
- 9 replies
-
- 2
-
- include
- phpspreadsheet
-
(and 1 more)
Tagged with:
-
Yep, getting the exact same behaviour!
- 6 replies
-
- forum
- bad gateway
-
(and 1 more)
Tagged with:
-
You could use a Table (or multiplier) field to set this up. And when rendering your JSON output, generate the variations using the Table field data on the page.
-
I think there is no way around this currently.
-
When you say page listings you mean Listers?
-
I don't know how many times I write ProcessDatabaseBackup just to find out it needs to be plural.
- 8 replies
-
- 1
-
- module
- autocomplete
-
(and 3 more)
Tagged with:
-
TemplateFile::render does seem to be a good place to tweak the markup right before it goes into the MarkupRegions class. Is that one not working? Here is where the template is rendered: https://github.com/processwire/processwire/blob/master/wire/modules/PageRender.module#L514 Here is where the markup regions are populated: https://github.com/processwire/processwire/blob/master/wire/modules/PageRender.module#L524
-
The fields are created from the template tags! It's been a long time so I don't remember the complete process for a complex field (e.g. repeater type), but I do remember that setting up a text field is done this way. You write the tag in your code and it shows up in the backend. Not really my goal here! haha. But just today I was thinking how I could leverage on tools like Webflow (which I like a lot) but allow for better maintainability if you update your design. Anyway, just ideas ? Maybe this belongs to Dev Talk now that I think about it?
-
WOW did you seriously just build this?! Thanks a lot!! Very educational code. I'll just rip this from the Perch documentation: <perch:repeater id="images" label="Images" max="5"> <perch:before><ul></perch:before> <li> <img src="<perch:content type="image" id="image" label="Image">" alt="<perch:content type="text" id="alt" label="Description">"> </li> <perch:after></ul></perch:after> </perch:repeater> I THINK I could also see how something like this could be implemented too. Anyway, thanks a BUNCH, I might work on your proof of concept a bit further down the road.
-
According to here: https://www.php.net/manual/en/function.curl-setopt.php It does look like it's the same, those two dots at the end seem to indicate the password is coming, though stripe doesn't seem to need it.
-
Hi everyone! Does anyone know if there is a way to render field values in this way: <div data-field="home_text"></div> And then if field exists it just fills in? I'm thinking of the case of using a tool for designing markup like Webflow. A little bit like how Perch CMS handles their content tags: <perch:content id="heading" type="text" label="Heading" /> I feel a lot of this is also in the markup regions area ?
-
Hi! Doesn't seem to be ready, I see it commented here : https://github.com/processwire/processwire/blob/master/wire/core/WireHttp.php#L545
-
I don't know how to do this in PW, but I'm guessing something like GROUP BY in mysql should work. Check RockFinder I see some examples: https://github.com/BernhardBaumrock/RockFinder#custom-sql-aggregations-groupings-distincts
-
Hi everyone! Reviving this. I have a PageArray with pages with two different templates, both with different date properties/fields which need to be used for sorting. Anyone got a suggestion for this? EDIT: Found this solution from @LostKobrakai which might work. I'd wonder if I could simply do the sorting right in the db like @LostKobrakai suggests.