-
Posts
45 -
Joined
-
Last visited
Everything posted by POWERFULHORSE
-
I just finished a medium sized website/SPA using processwire and vue with vue router and vuex. Has lots of nice features like server side rendering, happy to share details with people if they'd be interested. Shoot me a PM.
-
I've been looking into both React and Vue.js for a while and how front-end frameworks like these could integrate with my current workflow of building websites with ProcessWire. Ultimately I've decided to go with Vue.js after using it for certain sections of a few previous projects and familiarizing myself with the documentation, but I assume the same concepts I'm trying to work out would apply for both. So for my next project, I was thinking of using ProcessWire to simply manage content and serve what would function as the website's API. Essentially I would install ProcessWire into a subdirectory of my site's root folder, say '/api', and all template files would serve JSON only. The site itself would essentially be a webapp served by a simple node.js server, with all routing handled by the vue-router component of Vue.js. This way I could also utilise some sort of server side rendering to avoid initial asynchronous content loading. I would then set up my ProcessWire tree structure so that the API routes match those defined by vue on the front-end, only prefixed with '/api', subsequent pages could then be loaded asynchronously. Has anyone used ProcessWire in a similar way in the past, or used it in another way alongside React or Vue.js? I would eventually like to start using this approach for client projects, my first attempt will be an internal project however.
-
Interesting to see someone else using PW + Vue.js. Building components in Vue and using things like webpack and hot reloading has been kind of eye opening for me. I've just finished a small website/shop that uses Vue to render some elements. Things like the cart made a lot of sense, calculating/updating prices as quantities are edited for example. The cart in this instance is essentially a popover and doesn't need to be rendered immediately or visible for SEO purposes, which was a primary concern with this site. Where Vue was used to render actual content, I ended up writing duplicate templates in both PHP and using Vue components (the latter overwrites the former) which is obviously not ideal. I'm looking to eventually transition to using Vue/Vuex/Vue Router, moving away from writing PHP based templates and just using PW to expose JSON data via some kind of custom API. But as I almost exclusively build websites and not apps, things like SEO have always been a bit of a concern. I need to read a lot more about how to handle server side rendering with Vue for example. I wonder if there are enough people here who would be interested in some kind of PW/Vue/Webpack project template for use with Vue CLI or similar?
-
Module Page Image Manipulator | API for 1 & 2
POWERFULHORSE replied to horst's topic in Modules/Plugins
You're a genius @Robin S. Thank you! -
Module Page Image Manipulator | API for 1 & 2
POWERFULHORSE replied to horst's topic in Modules/Plugins
Sorry, I should have mentioned that was the method I was using. No luck unfortunately. It seems that neither negate nor colorize preserve transparency. -
Thanks again for this, managed to get the module to install correctly. The changed lines below summarised for anyone else facing a similar problem. This was for PW 3.0.28, PHP 7.0.1 and MySQL 5.7.13. schema-create-mc.sql updated_at TIMESTAMP NULL DEFAULT NULL created_at TIMESTAMP NULL DEFAULT NULL schema-create-main.sql created_at TIMESTAMP NULL DEFAULT NULL updated_at TIMESTAMP NULL DEFAULT NULL schema-update-v2.sql ALTER TABLE <table-name> MODIFY date_start TIMESTAMP NULL DEFAULT NULL; ALTER TABLE <table-name> MODIFY date_end TIMESTAMP NULL DEFAULT NULL; schema-update-v3.sql ALTER TABLE <table-name> ADD COLUMN last_hit TIMESTAMP NULL DEFAULT NULL;
-
Module Page Image Manipulator | API for 1 & 2
POWERFULHORSE replied to horst's topic in Modules/Plugins
Is it possible to invert a PNG with transparency with PIM? I have an image which is essentially a white (255,255,255) shape over a transparent background, and I would like to make the white shape black whilst maintaining the transparent area. -
I've posted question this in the Padloper forum, but realized it might not be Padloper specific so thought I would try here too. The module uses a template to generate a form populated with the template fields on the front end, by default these are for a billing address. Really simple form validation is done by making specific fields required, this all works as it should. However I'm attempting to extend this to include a shipping address. I have a checkbox called "shipping_toggle" which when checked reveals further fields for an alternative shipping address using JS. I need these fields to be required ONLY if the "shipping_toggle" checkbox is checked. I've tried setting these fields as required with the condition that "shipping_toggle=1" in the template but they seem to always be required when the form validates, even with this condition set. Apologies if this is module specific, it seems to validate the form using $form->processInput() which I believe is a PW core method, but I could well be wrong. EDIT Turns out this wasn't a Padloper issue or a problem with field dependencies. I had the following code in my config.php to allow for field dependencies in repeaters, luckily we've moved all the repeaters over to PageTables for this project, so I was able to remove it. $config->InputfieldWrapper = array( 'useDependencies' => false, 'requiredLabel' => 'Missing required value', );
-
No luck with either of those unfortunately. Should I also try to update the created_at lines in schema-create-main.sql and schema-create-msc.sql with the replacement line you quoted?
-
Hi Mike, thanks for carrying this over for me. Using 5.7.13 as far as I can see.
-
Thanks, I just edited the module's uninstall method as it was referencing a missing table that should have been created during module installation (it was never created as the install method threw errors). Seems to have done the trick. EDIT: New errors installing jumplinks, wil have a go at attempting to resolve. Session: Module reported error during install (ProcessJumplinks): SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at' Modules: Failed to init module: ProcessJumplinks - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'website.process_jumplinks' doesn't exist
-
Thanks @adrian. Unfortunately it seems trying to install ProcessRedirects caused some errors and I'm now unable to uninstall it, the module is also interfering with 404s. I'll take a look at jumplinks as soon as I've resolved that.
-
Any tips on using this module with PW3.x? Currently experiencing some problems with it.
-
I'm trying to automatically generate the title and name fields when a new item is added to the PageTable. I've used some code renobird shared with me and Pete's code from this post but it won't quite work for what I need to do. So for example I have a page /foo/bar/title-of-the-download, this contains a PageTable field that lists downloads. The pages created by this field are stored in /downloads/. I want to use the format: 150818-name-01 (date-name-increment) where name is taken from the page which contains the PageTable. So using the example above, I could add several new items to the PageTable with the names automatically created as: 150818-title-of-the-download-1 150818-title-of-the-download-2 150818-title-of-the-download-3 I'm able to get the name and title of the page I'm storing the PageTable pages under (in this case downloads), but not the page which contains the PageTable field. Can anyone advise on how I might do this? Code so far below: <?php class PageRename extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'PageRename', 'summary' => 'Page Rename Module', 'href' => '', 'version' => 001, 'autoload' => true, 'singular' => true, ); } public function ready() { $this->pages->addHookBefore('ProcessPageAdd::execute', $this, 'hookFormatName'); } public function hookFormatName(HookEvent $event) { //if adding child page to /downloads/ (1456) if ($this->input->get->parent_id == 1456) { //how to get origin page? $originPage = ; //gets number of child pages under /downloads/ $increment = $this->pages->get($this->input->get->parent_id)->count()+1; //actual increment needed $increment = $originPage->children()->count()+1; //create new page $page = new Page(); $page->parent = $this->input->get->parent_id; $page->template = 'download'; $page->name = date('ymd').'-'.$originPage->name.'-'.$increment; $page->title = date('ymd').'-'.$originPage->title.'-'.$increment; $page->addStatus(Page::statusUnpublished); $page->save(); $this->session->redirect("../edit/?id=$page"); } } }
-
Hey renobird, is this module something that you plan to release in the future? I'm working on something at present that needs start/end times that are independent of date.
-
I'm currently working on a project that will require multiple user accounts, probably somewhere between 20-50. So far I haven't really had much experience with multiple PW users and setting up custom roles, but I imagine it can't be too complicated? I'm trying to limit certain users so they can only view/edit/add child pages of a particular parent page, which I see is possible using the Access tab when editing the page's corresponding template. However, I want the users to be able to add pages, but not be able to publish them and only be able to edit pages they have created. The idea is that the admincan review these pages and maintain control over what gets published, kind of like an editor. Can anyone point in me in the right direction of where to find out how to approach something like this? Thanks!
-
Released: PadLoper (commercial eCommerce platform for ProcessWire)
POWERFULHORSE replied to apeisa's topic in Modules/Plugins
I'm struggling to understand how product variations work with Padloper, can anyone help me with this? So I've been using a custom cart module up until now, but am keen to switch to Padloper as it seems way more extensive. With my cart module I've been handling product variations with a repeater in the parent product template. So I could add any fields I wanted to this repeater and easily access them by looping and returning something like $product_variant->images for example. So each of these repeater fields essentially became its own product which could be added to the cart. I've tried to use Padloper in the same way but I cannot add a repeater field as a product, as it seems it has to be a page with a template. The only way around this I can see is instead of using a repeater, I use child pages of a parent product page to act as the variants. Padloper seems to have "Padloper Modifiers", are these used for product variants? Am I right in assuming modifiers are attached to templates rather than pages? If I have 20 different products all with unique variants, how do I handle this with Padloper? Do I need to create a new template for each product? -
Shop-for-ProcessWire (@Apeisa)
POWERFULHORSE replied to Nico Knoll's topic in Module/Plugin Development
I'm trying to build an ajax driven cart/checkout system with this module but running into some problems. I'm basically posting the serialized form data via ajax to each url (i.e. checkout/, checkout/confirmation/ etc) and appending the returned data, or the next step in the process, to the page. However I'm not sure if the data I'm posting is being saved as session variables or why it wouldn't be? Does anyone have any experience with this module and ajax and could help me understand why it wouldn't work? -
Module Page Image Manipulator | API for 1 & 2
POWERFULHORSE replied to horst's topic in Modules/Plugins
Still looking for a workaround to my problem. I'm going to try running it on a slightly newer server configuration to see if it helps. Does anyone know if would it be possible to implement this as a hook when I upload images using a certain field? -
Fantastic, works perfectly! That's made my life a whole lot easier.
-
Ah, that's interesting to know. I think the main problem with the PageTable solution is the requirement of entering page titles for every content section (which are a single fields my case). Unfortunately it's too time consuming when adding a lot of content as it essentially doubles the number of required fields. I'm also not so keen on the idea of convincing a client to enter data which in every case is unused/redundant.
-
Nope, tsohost.