-
Posts
284 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Kiwi Chris
-
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.
-
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.
-
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.
-
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.
-
Marlborough Camera Club Originally this was a site built in Concrete 5 that I inherited when the previous webmaster became pregnant. It was horribly slow, and very hard to edit without making mistakes. I kept the existing theme, but converted the whole site to Processwire, resulting in a massive improvement in performance, and the ability to delegate authority for editing parts of the site to other club members. Not publicly visible, but another feature I added was an competition entry form that integrates with Dropbox so instead of having email entries, frequently with errors, they could enter directly via the site.
-
Thanks, I'll have another look at that module. Last time I tried, I didn't seem to be able to get it to work, but it looks as though it's been updated since. If I'm reading the description correctly, it's not quite what I'm looking for although it's a step in the right direction. Some editors might have responsibility for more than one branch of the tree, so restricting to just a single branch isn't ideal. Rather than restricting a role to a specific branch, it would be more useful to assign a role(s) to a branch, so that a given role can have access to multiple branches if necessary.
-
I'd really like Processwire to have a robust page based permissions system rather than just template based out of the box. If the page tree is compared to a file system, it would be nice to be able to set owner (user), group (role) and public permissions on a page and have this propagate to sub-pages unless explicitly over-ridden. With a large site, it's quite possible to have multiple sections that use the same templates, but where editing needs to be assigned to different people, for different parts of a site. I've seen some proofs of concept that have never been updated or maintained, so I'm sure it can be done, but this is a bit of a show-stopper for me with an otherwise excellent CMS. I might be able to have a go at something myself, but since this is security related, and I haven't had a go at module development before, it would be really handy to have something robust that just works.
-
the FormTemplateProcessor module generally works well for what I need it for, but when it comes to FieldTypeOptions, fields, the index is what shows up when emailing a form. I've tried the following, but it doesn't fix it: if($field->type instanceof FieldtypeOptions){ $value = htmlentities($this->contact->get($field->name)->title); }else{ $value = htmlentities($this->contact->get($field->name)); } In documentation for FieldTypeOptions is says that it's possible to assign a value like this: 1=value|label Even if I do, I don't seem to be able to get the value to display, and only the index number is returned in the email whether I use $this->contact->get($field->name)->title or $this->contact->get($field->name)->value Where am I going wrong?
-
I guess it's testament to how well documented and easy to use Processwire is that I've been using it for a bit over a year without having to ask for help, after I had to use it for some contracting work, but this is the first time I've needed to modify a module so, here's my scenario: The FormTemplateProcessor works well for me in that I can allow set up of fields via the UI, and allow submission by email, but I'm thinking I'd like to make it resistant to spam. After reading up discussion on the evils of captchas and alternative methods, I thought adding a honeypot seemed like the best solution. So far so good. In the template that displays the form, I've got this: //Set notABot when user visits home page, as most normal user would before they go to form. if ($session->notABot) { ... } That works fine, but just in case there's a bad bot that crawls the site, I've also added this in the body of the template: <script type="text/javascript"> $('#wrap_Inputfield_robots').hide(); $('#Inputfield_robots').val('<?= $session->spamCheck ?>'); </script> $session->spamCheck is a random string generated when a visitor visits the site home page. It wouldn't be hard to make #wrap_Inputfield_robots a user selectable field something like $page->honeypotField What I'm trying to work out how to do is to get the FormTemplateProcessor module to check whether the field #Inputfield_robots refers to matches $session->spamCheck either in the ___sendEmail function, or better yet, in the ___render() function so $this->sendEmail($form); never gets called at all. Beyond just getting it to work, I'd like it to be as flexible as possible, so that in the template, when it's possible to do something like: $form->spamCheck = $page->hiddenFieldName $form->email = $recipient->email; so it's possible to specify if you want to have a hidden field or not, and what field should be used. I can probably work it out, but I'm feeling tired, so thought I'd ask, and also make it known how much I appreciate Processwire.