-
Posts
1,523 -
Joined
-
Last visited
-
Days Won
21
Everything posted by elabx
-
Save page in PageTable field before close event on Add New modal.
elabx replied to elabx's topic in General Support
Thanks for your answer Robin! Your solution is one of the paths i might take. And thanks for those links! Which basically lead to a solution by Soma saving info in the session variable. Another Idea I haver is to add a url param to the Add New button (also mentioned in a github issue by @Macrura), to have information about the page within the modal, and maybe that way, I would just need a hook on Page::added and getting the "pagetable field owner" through a input->get->owner_field. What's your opinion on this? I'm not entirely STUCK on pagetables, but I like better the way they render (RM is too bulky) and also seems more straightforward to bring as pages to display on another lister. (tho I know i could do this with repeater pages too, just doesn't seemed to me like the best way to go about it). EDIT: I have something like this working now: (credits to @Macrura who also posted a similar idea in a github issue, so gave it a shot): EDIT2: Simplified hook for pagetable add new button markup edit. Thanks @Robin S! $wire->addHookAfter('InputfieldPageTable::render', function ($event) { if($event->object->name == "asignaciones"){ $markup = $event->return; $markup = str_replace("&context=PageTable", "&context=PageTable&field_parent={$event->object->hasPage}", $markup); $event->return = $markup; } }); wire()->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); if($page->template == "asignacion"){ if($this->input->get->field_parent){ $owner = $this->pages->get($this->input->get->field_parent); if($owner->id){ $owner->of(false); $owner->asignaciones->add($page); $owner->save('asignaciones'); } } } }); -
What about $cache? I don't think it saves WireArrays but it can handle normal arrays and PageArrays if that works. https://processwire.com/api/ref/wire-cache/save/
-
This might be a repeated topic from one i created a couple days ago but wanted to rephrase it to be more clear. Is there a way to save pages created through the add new button on PageTable field before it is saved/closed? I see in the field's javascript that the page is only added when closing the modal, I do some after save hook work on the page using the modal window that depends on the page being added to the field.
-
Using owner selector to determine if the owner page is published
elabx replied to a-ok's topic in General Support
For what I understand, the owners elector will try to get the pages where the projects_awards is set, not the actual repeater pages, I'm thinking the template selector is what's causing the error because the template repeater_projects_awards doesn't have a projects_awards field. (but my reasoning could be messed up too haha). I'd try something like this maybe, that would give an array with a PageArray in each item, though you might to flatten the array and have all repeater pages in a single array: $awards = $pages->find('template=projects, projects_awards.count>0')->explode('projects_awards'); -
The title sums it up pretty much! I have a page where I save clients information, and then I create an "assignment" where I can pick a sales person and send them an email (through a hook after page::save) about the clients and this assignments page help me keep track of which salespeople have worked with the client. The problem is, when saving through the hook, i look for the client info like this (to send within the email): $pages->find('assignments=$page'); Where $page, is the assignment being created. Maybe I should hook onto a field save? Or save the page beforehand in the same hook? (though i think I don't have a reference from the parent document, within the pagetable add new modal) EDIT: I have another issue now! When saving the clients page, which has the assignments pagetable field, it's triggering save() in the added pages, is there a way to avoid this?
-
Designme - Visually Layout Your Edit Screens - Preview
elabx replied to joshuag's topic in Modules/Plugins
@MrSnoozles and everyone! This project is certainly halted at the moment and we are discussing what to do with it. We have not publish because one of our original intentions was to make it a Pro module. We still need to clear our heads from work and decide what to do. -
Need help installing Mollie module with composer vendor files
elabx replied to bramwolf's topic in General Support
Maybe I'm being obvious, but have you tried running the shell command "composer require" on the root the module (site/modules/PaymentMollie)? Like this: composer require mollie/mollie-api-php EDIT: Fixed for correctness, thanks @MoritzLost -
Deface (Ruby on Rails Gem) is like ProcessWire MarkupRegions
elabx replied to Jonathan Lahijani's topic in Dev Talk
I just recently started using markup regions and gotta say I'm starting to like it a lot, but honestly I wouldn't think of anything actually "fancy", just really like working as if I were doing direct output, just like MarkupRegions proposes in its docs. -
Numbering and Pagination on Page Table field type
elabx replied to changwuf31's topic in Getting Started
Yes exactly @szabesz, ProFields Table (no pages involved). I also get confused haha- 6 replies
-
- 1
-
-
- pagination
- page table
-
(and 1 more)
Tagged with:
-
Numbering and Pagination on Page Table field type
elabx replied to changwuf31's topic in Getting Started
That's exactly the post I remembered! At least on Table field 0.1.4 you can enable it in the Details tab.- 6 replies
-
- 1
-
-
- pagination
- page table
-
(and 1 more)
Tagged with:
-
Numbering and Pagination on Page Table field type
elabx replied to changwuf31's topic in Getting Started
I can't find the exact blog post, but I remember this feature is implemented in the core but the fields need to be updated to support the pagination, I have only being able to use this feature in the Table Profield.- 6 replies
-
- pagination
- page table
-
(and 1 more)
Tagged with:
-
What if you just output placeholder text? (I'd guess you'd have to use <edit> tags) $page->text ? $page->text : "Input text here.."
-
I can't imagine the amount of work it would require coding a new admin. I'm guessing it would need a rewrite of all "major" Process modules right?
-
Does anyone have the perception the old admin is "snappier"? I'm using both and I get that feeling, could this be the reason?
-
I have also been scratching my head with this a couple times!
-
This crossed my mind too! ?
-
On Istanbul template, assuming location is the template of Turkey: $relatedSublocationsMinusCurrent = $pages->get("template=location,sublocations=$page->id")->sublocations->remove($page); Not tested but should work!
-
Thanks for the reply @Mike Rockett! In a completely different scneario, I am trying this as source: [propiedades]/detalle_propiedad/1363/some-segment[/][?b=1] (As destination it's a plain url) So that it would match: detalle_propiedad/1363/casa-en-preventa-colonia-maya?b=1 detalle_propiedad/1363/casa-en-preventa-colonia-maya/?b=1 propiedades/detalle_propiedad/1363/casa-en-preventa-colonia-maya/?b=1 Does anyone know if I am correct in this assumption? EDIT: Solved it with two jumplinks like this: {segments}/{num:num}/{segment}/?b=1 {segments}/{num:num}/{segment}?b=1 I also think there might be something the community could do to help? Funding? "Crowdfunding"? Though maybe Mike's slammed with client work or sth and that's it haha
-
Well who knows! The devil is in the detail. And I do agree the javascript events would be a powerful enough reason. I also remember reading that conversation a while ago and do agree on your points. Particularly the "auto include" of files, pretty much like the modules.
-
So do you plan on using the frontend Shopify javascript libraries to display the products/enable cart? Or how do you plan to integrate that? I know I'm a bit out off topic haha but maybe it's something we can help you with, too.
-
Heres a VERY rough script and it's very messy. (ran it from command line also) https://gist.github.com/elabx/ba4879fe36ca9430f8d614aaee52fc5a Specifically, check the functions addProduct() and updateProductVariant(), in those two functions is where I call the Shopify client, and all the setup starts here on line 175. This script is meant to grab data from a CSV, by if you look at addProduct you can basically tell how to add a product through the API so instead passing an array to that function you could pass a Page object for example and fill in the gaps. On shopify you would just need to setup a Private application, to get the required key/secret. BEWARE to run the script as is, because it deletes all products on the Shopify store every time the script runs.
-
I have done this (product migration from A to Shopify) and it is fairly simple using Shopify's API and a Shopify private app. I have used this library . Probably what is more time consuming is understanding Shopify's API endpoints. (e.g. took me some time to understand all shopify product objects actually have at least one variant object, where the actual price is kept!) My doubt is, do you plan to completely deprecate the PW website? Or do you plan to embed Shopify somehow into the existing site?
-
I'm curious, how would your module be different from FieldtypeRuntimeMarkup?
-
Didn't work unfortunately ?
-
Hi everyone! Does anyone know if it's possible to map a source url taking into account optional string at the end? For example: Source -> Destination example.com/es/this-is-a-nice-url -> example.com/es/this-is-a-nice-url example.com/es/this-is-a-nice-url-1 -> example.com/posts/this-is-a-nice-url example.com/es/this-is-a-nice-url-2 -> example.com/posts/this-is-a-nice-url Making the "-1" or "-2" optional.