-
Posts
302 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Kiwi Chris
-
You got me thinking. I do work as a single developer, but increasingly I'm finding I want to deploy solutions I've developed for one project to another, and just copying and pasting via the admin isn't ideal. I was having a look at Silverstripe recently, as I have a possible project where Processwire, though I'm sure can do the job, might meet some resistance, whereas Silverstripe will almost certainly be accepted as it's mandated as the CMS of choice by government here (NZ). What struck me is that you can do far more with Processwire with less coding, but in some cases defining data structures via coding rather than via an admin UI may be more appropriate for sharing code between projects or in the case of a team between team members. Processwire is perfectly capable of doing this as the admin UI is just a layer on top of the API, so there's no reason why fields and templates can't be defined programmatically in modules that are subject to version control. I notice that some of the existing modules actually consist of several dependant sub-modules, bundled in a common folder, so it would be easy to set up something like this with git version control. Silverstripe automatically rebuilds database schema by using a /build URL, however it doesn't remove unneeded fields or tables after a schema change, whereas the Processwire API makes it fairly easy to both add and remove fields via a module. Processwire will detect changes to a module version, and run any update process automatically, so even though it bypasses the ease of use of the admin UI, developing your database schema programmatically in modules might ease collaborative development.
- 6 replies
-
- 8
-
-
- deployment
- git
-
(and 2 more)
Tagged with:
-
IMagick vs Google PageSpeed Insights
Kiwi Chris replied to heldercervantes's topic in General Support
Are you using the HTML5 srcset attribute to provide different sizes of the images for different screen resolutions? I've found about 60 quality is as optimised as is needed, so long as the images are the right size for the resolution they are displaying at. Even if you're only a few pixels larger than the screen resolution being rendered, I think Pagespeed insights can make a fuss. Also, in the core - can't remember the exact module, I think I changed the image resizing function to use progressive encoding, as that can result in faster rendering of jpgs as they can start rendering before they're loaded. I can't find where I did this now, and it would be nice for it to be officially part of the core to have the option for progressive encoded jpgs. -
What are the methods to sort/filter $pages query in front end?
Kiwi Chris replied to Vigilante's topic in General Support
The beauty of Processwire is that it doesn't predefine output of content, so there's no reason why you couldn't create a template that returns JSON and call it using an ajax request from the HTML template that you want to update. It does mean two templates for one page, although using URL segments it might be possible to have a single template that can return either HTML or JSON depending on the value of the URL segment, although you could do that with parameters as well. -
Flexible input forms on a budget and with limited coding required
Kiwi Chris replied to Kiwi Chris's topic in Tutorials
Good question. I'm not sure how good it is as it stands, but it is built on top of Processwire's form handling classes. I think it would be pretty easy to modify Form Template Processor. There's already a property 'skipFields' to list fields from the template that are not rendered, and this is checked at both the point of rendering, and before sending an email. It would be easy enough to add another property say 'hiddenFields' that are rendered but not output in email, and with a bit of CSS set up a hidden field that can be used as a honeypot. -
I just had an issue with a site where end users were pasting content from Word. There is a Paste From Word plugin, but that still leaves a lot of formatting and overrides the paste as plain text. To resolve this I did the following: Custom Config Options forcePasteAsPlainText: true Remove Plugins I added pastefromword to the end of the list already there.
-
Forms are an essential part of most websites, and it's no surprise that there's an excellent premium module Form Builder but what if you're on a zero budget for whatever reason? It is possible to build forms quickly and easily by making use of a couple of free modules and the admin UI to give you a great deal of flexibility and speed of development, particularly if you need multiple forms on a website with different fields. 1. First you're going to need to install a couple of modules: Form Template Processor Fieldtype Select External Option 2. For each form that you want to display, create a template without a template file and add fields to it as you normally would. (eg I have formContact, formRegister etc) Tip: under the Advanced tab in the setup for each template, I add a tag Forms so that all my forms templates are nicely grouped together in admin. 3. Create a new field of type Select External Option and call it formTemplate In the section Create options from any database table select templates as the source table id as the Option Value name as the Option Label 4. Create a new template file and call it renderForm.php (or whatever else you like) Add an email field to this form - This will be the email address that forms get submitted to. Add the formTemplate field you previously created to this form. This will allow you to select which of the templates you previously created such as formContact, formRegister etc you want to render. Add any other fields as usual that you want to render on the page. Add the following PHP code to the template file. $recipient = $page->email; $form = $modules->get('FormTemplateProcessor'); $form->template = $templates->get($page->formTemplate->label); // required $form->requiredFields = array('contactName', 'contactEmail', 'contactMesssage'); //Optional: This can be improved by having a field in the page template with a CSV list of required fields eg $form->requiredFields = explode(',', $page->requiredFields) $form->email = $recipient; // optional, sends form as email. FormTemplateProcessor can also save forms to the database. $content .= $form->render(); //generate the form to display. Note: this doesn't actually render the form at this point, but you have it in the $content variable ready to output wherever you want in your template. Add any template HTML or other PHP code and echo $content; wherever you want to render the form. 5. Create a page using the renderForm template, and provide an email address, and select a form that you want to display. 6. Use CSS to style the form as required. 7. View your new page, and check that the form renders correctly. 8. You can modify the templates you created at step 2 or create new ones as required if your requirements for what fields forms display changes. Note: The Form Template Processor module can also save form input as pages, and the FieldType Select External Option can be set up with filtering, so this solution can probably be refined further.
-
Apart from what I've already mentioned, in response to DaveP, I'm running on PHP 7.1 I noticed over in another thread here: https://processwire.com/talk/topic/17707-php-in-2017-rasmus-lerdorf-wearedevelopers-conference-2017/ The creator of PHP mentioned in the video that there's a big difference in performance between PHP 5.x and 7.x so that may be having some impact on performance too.
-
I have to admit I like Umbraco as an ASP.Net CMS as it has a similar philosophy to Processwire where everything is customisable, and you can create templates with whatever fields you like out of the box. ASP.Net is both its strength and weakness though in that if you need an ASP.Net based solution, Umbraco is good, but most of the time a PHP based solution is fine. I think Processwire is easier for beginners without a lot of coding experience. I like Umbraco's permissions system better, and the separation between document types and templates is handy if you need multiple templates for the same data, but just creates extra work if you don't. I'd say Processwire's documentation is outstanding, and quite apart from the CMS itself is part of what sets it apart.
-
Hopefully there will be some listings for the Wakamarina on there in future. I remember school camps up at Deep Creek. The old site was pretty ugly and I suspect that didn't attract members. Hopefully with the refresh, people will be more enthusiastic about the site and it will grow.
-
When someone first introduced me to Processwire, I spent about 20 minutes reading the documentation and I knew enough to start building things with it. In contrast, I spent about two hours reading Wordpress documentation, and I still didn't find it incredibly clear if I wanted to build a site from scratch as opposed to just grabbing an existing theme and plugins. If you come from a CMS where you can just install ready-made themes and plugins, Processwire can seem a bit minimalistic, but once you work out how fields and templates work, you realise you can do what other systems can require multiple plugins for out of the box, built into the core CMS. There are modules (in place of plugins) that can speed up development. I found the SITE PROFILE EXPORTER module very handy, as once I'd built a few sites, I could duplicate much of the setup quickly and easily from an existing site if I really wanted to copy anything.
-
Processwire's image handling is great for generating different sized images for the srcset attribute in HTML 5. It can make the initial page load a bit slow after an image is first uploaded, but it's fast after that.
-
More than a year after I submitted a proposal, I finally was given the contract to build a new website for a regional promotion organisation, promoting a very sparsely populated part of NZ. https://www.pelorus.nz/ The original website I think was running CMS Made Simple, however it was not mobile friendly, and the organisation of directory listings into categories was unreliable, and edits required requests to the original developer. My brief was to make the site mobile friendly, and user editable, although I also ended up providing some of the photography as some of the site owners were slow to come forward with material themselves. I didn't rewrite content as that was beyond the scope of what I was asked to provide. Bootstrap 4 came out after I'd already started the project, so it's built using Bootstrap 3. Modules I used: Admin Restrict Branch (So owners of listings can log in and edit their own listings, but nothing more) AIOM+ - I found the LESS compilation handy, as I could work with the Bootstrap source files and adjust variables rather than overriding compiled bootstrap. Fieldtype Phone - so I could easily format phone numbers so that they would work both as URLs and display correctly. Social Share Buttons - although I created a modified colour set of icons. Jumplinks - to map URLs from old site to maintain SEO.
-
Nice site. Saudades! I met my wife in Porto and loved the place even though it's almost the antipodes of where I live. Processwire certainly lends itself to redeveloping sites. I inherited a tediously slow Concrete 5 site some time ago and found it easy to convert to Processwire. I also had a lot of old sites I'd built with a proprietary CMS I'd developed myself from way back before Wordpress was a thing. I love the way Processwire gets out of your way and lets you build whatever site structure you want without imposing itself. It makes adapting existing sites easy.
-
I'm having an issue with the module. When I add an additional field to an existing image field and try to edit the page I get an error like: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_headerImage.title' in 'field list' I get a similar but more verbose error on the frontend trying to view the page. Removing the additional field resumes normal behaviour for the page. I have other fields that I've added a title field to that work fine, so it's worked in the past, and image fields that already have custom fields have no problem, but I can't add more. I'm working with the latest build of PW (3.0.79)
-
I have a structure where sub-pages have a headerImage field, but not all sub-pages have the image set. I want to get all of these images and pass them off to a function to render a slideshow. I've tried: $carouselPages = $pages->get("name=categories")->children(); $page->carouselImages = new \ProcessWire\Pageimages(); foreach ($carouselPages as $cp) { if ($cp->headerImage) { $page->carouselImages->add($cp->headerImage); } } I know if I don't save $page, then $page->carouselImages will be temporary, and I can do this kind of thing ok with text values. But I get an error on the second line. How is the best way to handle what I'm trying to do here?
-
Where will I find more themes/templates for ProcessWire?
Kiwi Chris replied to davede's topic in Themes and Profiles
The reason why Processwire doesn't have a whole lot of themes is that it makes no assumptions about what data structures you want. Wordpress has Posts and Pages. Processwire has things called Pages, but they're really completely different to Wordpress pages. A Processwire page has whatever fields you want it to have, and that doesn't necessarily mean an HTML content area like a page in Wordpress or other CMSs. It can do, but doesn't have to. A 'Page' could actually be a product with price, weight, description, and image fields. It could equally be a calendar event with start date and time, finish date and time, venue, and description. Processwire Site profiles are a bit like themes, but because of the flexibility of Processwire, they have to define data structures for the page types they're theming a well. I find using a CSS framework like Bootstrap makes it far easier to 'theme' Processwire. You've already got a range of useful components, and it's easy to customise Bootstrap with different colours and fonts, so that way you've got the foundations of a decent looking site without having to be a graphic designer, but with the flexibility that Processwire offers. -
How to convince my client to switch to Processwire from Wordpress
Kiwi Chris replied to nickngqs's topic in Pub
I've encountered the same problem with many people specifying that any bids for a web site must be Wordpress. I come from a database development background, mostly doing Microsoft Access desktop apps, but also some web development, and even made my own CMS way back when Wordpress was only a dream waiting to happen. I'd describe Processwire as being data driven, whereas Wordpress is content driven. By that I mean that Wordpress revolves around posts and pages, whereas although Processwire calls them Pages, Processwire pages are really totally different beasts to Wordpress pages, and are really a less nerdy name for what are really objects, which can have any properties you like, and may not even be 'pages' in the publishing sense at all. If you want a blog using an existing theme, Wordpress is the way to go. If you want a web site that has to deal with pretty much any data structures you want to throw at it, Processwire is the way to go. Wordpress needs a plugin to do custom field types, and plugins to do lots of other things, and those plugins don't necessarily peacefully coexist or have consistent UIs. With Processwire, you start off bare-bones but can build anything you like quickly and efficiently. The development process for me is far more like building something with Microsoft Access, in that you design you data structures (fields, and I believe with Profields, you can actually do tables, but I haven't had enough work to justify that yet) and then add them to templates which are like forms or reports in Access. Site profiles are a bit like predefined Access templates for specific tasks. Perhaps it would be good to work towards a wider range of free and premium site templates available, but rather than modelling them on Wordpress themes, model them on Access templates, then people will see that Processwire is more of an app platform than just a web site CMS. Processwire can't really have 'themes' in the Wordpress sense, because those rely on assumptions about what data structures you have, whereas with Processwire, a site profile has to define data structures as well as presentation, as Processwire doesn't have any inherent data structures like posts or pages in a Wordpress sense. The reason Access was, and still is so wildly popular amongst a small group of developers is that it is the quickest way to develop a desktop front end for pretty much any kind of database app you might want to build, even if it has some inherent issues that IT departments don't always like. There are a few things I wish Processwire did differently, eg I'd like referential integrity at the database level, and I'd like to be able to use other database systems other than mySQL/MariaDB, (eg PostgreSQL, SQL Server) , but the reality is it's the most efficient tool I've found for quickly defining and presenting any kind of data on the web. With Wordpress, structured data is an afterthought, with Processwire it's core.- 10 replies
-
- 13
-
-
The basic functionality of the module is great, but I wanted the capacity to add paths, and potentially geometric areas, and the easiest way I found to generate them was using something like Google Earth, or various mobile GPS apps which export KML files. KML files can contain map markers as well, but the module already handles these fine. The Google Maps API allows adding KML layers, and of course Processwire already has a files fieldtype, so it's easy to create a files field that only allows files of type kml. I had to make a few modifications to the FieldTypeMapMarker as well. MarkupGoogleMap.js //Add support for KML overlays, eg exported from Google Earth, or various GPS apps. this.addKml = function (url) { var zIndex = 99999 + this.numMarkers + 1; var layerOptions = { url: url, map: this.map, zIndex: zIndex } var kml = new google.maps.KmlLayer(layerOptions); } MarkupGoogleMap.module I added a 'postinit' property that is output after the map has been rendered. I found that the overlays can only be added after the map has been initialised, so the existing 'init' property didn't work. Here's how I used it in a template: $map = $modules->get('MarkupGoogleMap'); foreach ($page->kml as $kmlFile) { $overlays .= "mgmap1.addKml('$kmlFile->httpUrl'); "; } $content .= $map->render($page, 'location', array('type' => 'ROADMAP', 'postinit' => $overlays)); The code could probably be improved to have the foreach loop inside MarkupGoogleMap.module, and just pass the name of the overlay field if any, but it needs to be optional, as not all maps will have an associated field with kml files.
-
I'm having issues with a responsive map using the MarkupGoogleMap output of the FieldTypeMapMarker not centering properly when it displays. It appears the map is loading assuming a much wider map resulting in the map marker being offset by a considerable amount to the side so that is is out of sight without dragging the map. I think the MarkupGoogleMap.js file needs tweaking, but I'm not quite sure where.
-
Years ago before Wordpress had even been invented, I started work on a site providing information about my local region of New Zealand. Back then, most people were on dialup, and if you wanted a CMS you had to roll it yourself - if you could find a host that supported server scripting at an affordable price. This year, with a quiet patch with essentially no paid work, I finally decided it was time to make the move from a home-grown CMS using an obscure scripting language to something more modern, so I could spend more time adding content and features, and less time maintaining the core CMS. www.marlboroughonline.co.nz I love Processwire because it works the way I think, and when I was first introduced to it, I was up and running within 20 minutes of reading the documentation, vs several hours reading Wordpress documentation, and still not entirely sure how to create my own fields and create a theme from scratch. I come from a database programming background, particularly Microsoft Access, so being able to make fields and add them to a form or report, is the way I'm used to working, although it took a bit of getting used to Processwire not adding fields to a table by default, although I see Pro-Fields or custom field types can achieve this. (I haven't used Pro-Fields in this project as I'm essentially on a zero budget). The site itself doesn't use anything particularly fancy. I use the following modules: Map Marker Form Template Processor Social Share Buttons (With my own colour version of the button icons) AIOM+ (This is particularly handy as I'm using a customised version of Bootstrap, and it handles compiling all the LESS files) Jumplinks The biggest task was importing all the content from my existing CMS, but since I wrote it, it was easier than dealing with some third-party CMS. The site had been around for a long time, and had numerous inward links including a number from Wikipedia, and I didn't want to break them in the conversion. If you're converting a site to Processwire with a URL structure that can't be replicated in Processwire, Jumplinks is a must-have module, as it handles complex URL redirects very nicely. The site has quite a bit of content, much of it which needed updating in addition to changing the CMS, so there might be odd bits that don't look right, but that's certainly not Processwire's fault.
-
Thanks for spotting. It worked fine on my WAMP development server, but of course I didn't have the .mvc file there. I've renamed it, and tested for an actual URL from the old site /index.mvc?ArticleID=181 and it's working as it should. With regard to the CSS, I was trying to follow best practice according to Google Pagespeed Insights, but perhaps I'm being a bit overly picky trying to get a good Pagespeed rating.
-
Oops! Good spotting. Fixed now. I still need to go through and clean up a lot of the old content, as some of it's ancient, and maybe not all that relevant now, but I wanted to get the new site up ASAP as the old one was ugly. At least Processwire is both developer and end-user friendly, so I can go through and clean up the content pretty quickly.
-
I've been a bit like the proverbial plumber with a leaky tap, with a rather ugly site myself, but I've had a period recently with very little work, so I thought it might be time to give my own site Create IT a refresh. I've got more work to do on it, but it's enough of a step up that I'm not totally embarrassed by it now. My site was running on a CMS I've developed myself since 1999 using an obscure language Mivascript, that was actually quite popular at the time, and my first exposure to a server scripting language. To put that in context, the first version of Wordpress only came out in 2003, and to be honest my code looks quite messy in the light of modern programming best practice. I've decided I'd rather focus on adding functionality and content than maintaining an entire CMS myself, and I love Processwire for its speed and flexibility of development. I had to import my existing content which was in a mySQL database. Having written the system myself, I knew the data structure well, so the issue was how to replicate the functionality. My old CMS was started before the days of SEO and security got a great deal of attention so I had urls like index.mvc?article=6. I had to come up with a safe way to redirect these to knew Processwire URLS. The Jumplinks module came to the rescue there, as when I'd imported my data, I'd already imported the old page ids into a field in processwire, so it ended up being pretty easy to provide automatic redirects from the old URLs with just a single jumplink using a selector. The other thing I wanted to do was use Bootstrap, but customise it without creating a mess of overrides. AIOM+ came to the rescue here, with its built in ability to compile LESS files. Rather than messing around with any third party LESS compiler, I could just put the Bootstrap source directly into my project and include the LESS files directly. Processwire never fails to impress how quickly and efficiently it enables often quite complex things to be done.
-
Saudades. Although I live almost exactly at the antipodes of northern Portugal in New Zealand, I met my wife in Porto, and learned to speak Portuguese fluently, so I can read the content on the site. It's interesting to see Processwire is literally being used to the ends of the earth.