Kiwi Chris

Members
  • Content count

    20
  • Joined

  • Last visited

Community Reputation

39 Excellent

About Kiwi Chris

  • Rank
    Jr. Member

Profile Information

  • Location
    New Zealand

Recent Profile Visitors

358 profile views
  1. 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)
  2. 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?
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. I'm pretty comfortable with Processwire templates, and I've found to date existing modules have met my requirements, but I've run into something where I think I'm going to need to create a module. The scenario I have is a site with sub-sites, which are basically just pages in the page tree that use a 'Subsite' template, and are assigned to different people to edit using the Admin Restrict Branch module from the module directory. What I want to be able to do is check how much disk space each sub-site is using for associated files. I figure I can iterate over the PageFiles array for each page that uses the 'subsite' template, and its children. This won't be 100% accurate as some images may have different sized variations generated by Processwire templates. This possibly isn't too much of a problem, as I'm not really needing a completely strict limitation on disk space, but at least I want to track how much space has been used directly via uploads. The bit I'm unsure about is how to go from knowing how much space is used by uploaded files for a page and its children, to getting that value to display on the admin screen when editing a page, and ideally, to prevent further uploads if a sub-site has reached a configurable limit, which may vary for different sub-sites, although initially, just having a common limit for all sub-sites would be a good start. I'm thinking I might need to hook into the PageFilesManager, but given this will be my first attempt at building a module, any guidance would be appreciated.
  13. I've been building something a bit like this. It's not live yet, but you can have a look here: https://test.peloruspeople.org.nz/ It's built on Processwire 3. You'll see a link to subsites on the menu, and each one has different content. I use the restrict admin branch module so that different users can edit different sub-sites. If this is along the lines of what you want, let me know, as I could always export it as a site profile. I was just wondering the other day if it might be useful to other people. I seriously under-quoted on the project, so if what I've done could be re-used, and I could recover some of my development time I'd be very happy. Let me know if what I've done could be useful, and I'll see what I can do. I still have a bit of work to do. The old site was running on a CMS I started on myself before Wordpress was even a thing, so there was all the content to import and update. Processwire makes working on site functionality so much easier, and it's nice not having to worry about trying to maintain the core CMS.
  14. Thanks. That looks like it's exactly what I need. I'll test it to see how it works with Processwire 3.x, but hopefully it will work fine. It doesn't seem to be in the official modules directory, so that might be why I missed it. I can use the Site Profile Exporter module to set up my own site profile with the module included.