Jump to content

Kiwi Chris

Members
  • Posts

    304
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Kiwi Chris

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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?
  10. 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.
×
×
  • Create New...