Jump to content

Michael van Laar

Members
  • Posts

    105
  • Joined

  • Last visited

Posts posted by Michael van Laar

  1. Sérgio, this is a side effect of the lazysizes script. The fallback image, which has a different aspect ratio, is loaded first. Then the apppropriate image for the screensize is loaded and displayed.

    I just changed the behavior by not using the lazysizes script for this particular image. Now it takes a bit longer until anything is displayed on this place. So the perceived loading speed is a bit slower. But it’s definitely better because there is no change in aspect ratio of the image without the browser window being resized.

  2. A friend of mine asked me to build a website for the dog training business she just started. She already had a graphic designer create a logo and a small print brochure and wanted a clean, simple website.

    www.hundeschule-grosse-freiheit.de is the result.

    The website is neither big nor fancy. But it has some nice details:

    • Responsive, lazy loading images
      Almost all images (except the SVGs and the badge image in the footer) are maintained via the ProcessWire backend. Each image is rendered in eight different sizes – using respimage and lazysizes for frontend display.
      All images are created using the great ImageFocusArea module – something I wanted to be able to use in ProcessWire since I first worked with Drupal’s “ImageField Focus” module. Of course all images are minified using minimize.pw.
       
    • Central asset management for images
      Because most of the decorative images are used on more than one page, it made sense to build a central image management – using a specific “settings” part of the page tree with one page per image.
      Images in sidebars or on the gallery page are chosen using page fields in combination with the Page List Image Label module:
      post-531-0-07689000-1428274459_thumb.jpg
      So an editor’s experience regarding the visual representation of the “linked” images is not so much different from working with default image fields.
       
    • Consequent usage of a cookieless subdomain for static content.
      The cookieless subdomain specified in the AIOM+ module’s setting is also used to deliver images.
       
    • Multi-language content.
      Nothing big, but my first ProcessWire site with more than one language. Of course it uses the Autodetect Language module for the homepage – as well as “hreflang” links in each page’s head to give Google as much language information as possible.
       
    • Feedback and ratings
      The feedback page, which features quotes and pictures of happy clients, is populated semi-automatically. Feedback is collected using a Form Builder form on a secret page. After a training has ended the site owner sends an email to clients, thanking them for taking part and asking them for their feedback with a link to the secret form page. Clients can enter a quote, a 5-star rating and optionally an image – as well as their permission to use the quote and the image (necessary to avoid legal problems). This information is saved as a new unpublished page. After a new feedback entry page is published by the site owner, the new entry is displayed on the main feedback page. The pages used to save feedback entries feature multi-language fields. So it’s possible to present all testimonial quotes in both languages.
      The footer of each page features an aggregated 5-star rating, calculated from all single ratings displayed on the feedback page.
      Each individual feedback entry on the feedback page as well as the aggregated rating are formated using Schema.org markup. So it can be read and understood by Google and thus has the potential to be displayed as rich snippet on Google result pages.

    Oh by the way: The decision to use email links rather than a contact form was made by the site owner.

    post-531-0-58156500-1428274226_thumb.jpg

    • Like 9
  3. Having the same problem here, I investigated a little and found a bug and a workaround.

    First, there is a bug in LanguageTabs.module, lines 83 and 84. This prevents the JS and CSS file from being found.

    Wrong:

    $this->config->scripts->add($this->config->urls->LanguageTabs . "LanguageTabs.js");
    $this->config->styles->add($this->config->urls->LanguageTabs . "LanguageTabs.css");

    Right:

    $this->config->scripts->add($this->config->urls->LanguageSupport . "LanguageTabs.js");
    $this->config->styles->add($this->config->urls->LanguageSupport . "LanguageTabs.css");
    But this doesn’t solve the bug that the module doesn’t show up in the Core section of the module list. The quick and dirty workaround to fix this: Move the file LanguageTabs.module from directory /wire/modules/LanguageSupport to /wire/modules 
     
    Unfortunately I have no idea why this fixes the problem. I have not found any hint in any file which would indicate that ProcessWire doesn’t like the file LanguageTabs.module in the subdirectory /wire/modules/LanguageSupport
  4. caching the results will give you first boost.

    That’s what I did in my current project. I have a “more topics in this blog“ box on every tag page. The box features a list of links to all tags – except the current tag page. So every tag page has a different "more topics" list, wich is cached for 24 hours. Probably a far longer cache period would be reasonable, since I’m not going to add new tags every day.

    <?php
    $tags = $pages->find("template=tag, sort=title");
    $cache_topic_name = 'more_tags_list_for_' . $page->name;
    $cache = $modules->get("MarkupCache");
    if(!$more_tags_list = $cache->get($cache_topic_name, 86400)) {
     $more_tags_list = '<ul>';
     foreach ($tags as $tag) {
       if ($pages->find("template=blog-article, tags=$tag")->count() > 0) {
         $more_tags_list .= '<li><a href="' . $tag->url . '">' . $tag->title . '</a></li>';
       }
     }
     $more_tags_list .= '</ul>';
     $cache->save($more_tags_list);
    }
    echo $more_tags_list;
    ?>
    
    • Like 1
  5. Great! Exactly what I was looking for to display related content based on common tags.

    If I find the time – and if my limited PHP knowledge will be sufficient :huh: – I’m going to extend this to be able to find related content based on more than one field. This would also be a great addition to display search results based on their relevance. If there is not yet a solution which does so …

  6. By the way, being able to extend the comment form would be nice anyway. A typical use case would be an additional checkbox which a commenter can check to subscribe for a newsletter. You would then “only” have to hook into comment processing to pass this information (in combination with his e-mail address) through to an e-mail marketing service provider’s API.

    But this is just an idea.

  7. OK, meanwhile I had a deeper look at Ryan’s blog profile.

    And of course using pages as tags is great, because you can add a description field (like you do with categories), which makes tag pages performing way better regarding SEO. I used pages as categories in my old MODX based blog. But adding new categories/tags was not as easy as it is here.

  8. I know that I could solve this with a page type field. But for my taste this is still not as easy to use as a “real” tag field.

    I doubt that my developer skills are sufficient. But I will at least try to build a tag fieldtype.

    Theoretically it should not be that difficult. One “only” has to preprocess all the content which is stored site wide in this field and create a clickable listing under the text field. A little jQuery onclick action and that’s it – at least in theory ;) And using Nico’s TextboxList module I think it could look really good.

    • Like 1
  9. OK, the client I was talking about can not (yet) afford a shop :-(

    Anyway, I want to start working on a small shop based on ProcessWire. Perhaps we should just make list what has to be done resp. changed or extended, so that the shop module meets German requirements.

    For my clients I compiled a little summary with all the regulatory requirements a German online shop has to meet. If you want, I’ll send you the PDF. I would also have my lawyer check the outcome of our work, so that we can be sure that at least the development aspect of the module is OK. Content like general business terms, cancellation policy etc. have to be written or at least checked by a lawyer for each individual shop anyway.

×
×
  • Create New...