Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/07/2021 in all areas

  1. https://www.kaumberg.gv.at/ Hello everybody! Today I want to share a project that I've been working on for a year or so: The new website for municipal Kaumberg - a beautiful village near Vienna. To be honest, this project was way more work than I initially expected. The site has tons of content and the client came with lots of good ideas during the process of building this site. For example after we launched the site several organisations of the village realized that the system works great and is easy to use, so they wanted their own section with their own color scheme... Right now the system is maintained by several user accounts that populate content to the site. Some of them only in the news-section, others are allowed to publish to the sub-sites (eg for the fire department). Recently we won the 2nd price out of 190 cities in lower austria - where Kaumberg was by far the smallest one also having the smallest budget of the top rated cities! ### NOTE ### This system was built with scalability in mind. If you know any other municipals (preferable in a german speaking country) that could possibly need a new website using my setup write me a PM. If you are a marketing guru and know how we can sell this product to 100s of municipals, let me know. I know how to do that from the technical point of view ? ### HIGHLIGHTS ### CONTENT Custom multi-level menu for managing loads of content pages that also works well with keyboard navigation ? --- EVENT MANAGEMENT Events are managed via the PW backend and presented as calendar on the website plus can be downloaded as PDF calendar in A3 format for printing: --- CONTENT BLOCKS I've developed a new (private) module called RockMatrix for versatile, easy and fool-proof content creation for this project. This setup ensures that even non-tech-savvy users can create content that looks nice and works on all devices from desktop to mobile: --- SITE SEARCH Another new module that was developed for this project is RockSearch. I hate site searches that do work on the first sight but do not on the second. For example if they show older results on top of newer ones. Or if they do not index content that is not stored within a regular text field but for example as image description. On the other hand I did not want to use ElasticSearch because it seemed to be overhead to send data to another service that is already stored in the database of my PW installation... RockSearch shows results based on different weighing mechanisms, for exampe a search for the garbage collection schedule first shows results that are nearer to the current date than others (both future and past). That means that a date two days in the future will be shown above one that is 10 days in the past. Also results get different score based on where the term was found - matches in the site title get higher scores than matches in the body or in image descriptions or the like. Each content block is a RockMatrix block that has a render() method to define the output on the website and - for RockSearch - has a method called "searchIndex()" that defines the content that is written to the search index that is queried for every search request: This setup makes it super easy to add new content elements and to add them to the search index ? --- SUB-SITES The client can create sub-sites for different organisations of the village having custom color schemes and managing user access: News can be tagged to show up on different areas of the website: --- OTHER The site uses no cookies and can therefore be used without an annoying cookie banner. Page hit statistics are gathered by PageHitCounter and shown by RockHitCounter Some other little features are short-links for social media (eg https://www.kaumberg.gv.at/goto-1027 ) or the possibility for creating custom subdomains for sub-sites like http://araburg.kaumberg.at/ I'm quite sure I forgot lots of great stuff, but I hope you enjoyed reading this article nevertheless ? Looking forward to your feedback!
    3 points
  2. I'm also really looking forward to seeing this in action as a middle tier alternative/woocommerce alternative. Hopefully the testing will go well.
    2 points
  3. Thx @Stefanowitsch It's a module based on the core repeater fieldtype that manages the necessary templates and fields for content blocks via RockMigrations. Every block is a custom ProcessWire page having a custom template. The matrix field: Each block itself looks something like this: ...which makes it extremely easy to work with on the backend and to organize code well. That means each content block has its own file that defines all the necessary pieces, eg which icon and description to show for the button, which label to use on the sortable matrix field and which code to use for output rendering: Only drawback is that it does not support nesting yet - but I'm not sure if that is really a drawback because I don't think the average user would understand how to use such a feature...
    2 points
  4. I created a companion module for Fluency to translate all fields on a page at once: https://github.com/robertweiss/ProcessTranslatePage You can find the corresponding conversation about it in the Fluency thread (link below), but I decided to add the module to the official list so others who have a need for this have an easier time finding it.
    1 point
  5. Come on, man, you can do this ? That’s the same error message from before. Also, like I said, I’m pretty sure you just had to move the one ] to a different place. The number of brackets was correct. I haven’t been on the computer much today. I can look at the language stuff tomorrow, if you want. Btw a good “trick” is to just skim the actual source code of PW methods. I often find the docs a little lacking, unfortunately. Ryan’s code is quite readable, and usually one is only interested in what happens to the arguments, where best to hook etc. Somewhat superficial stuff like that, if you will, so it’s not too bad. For example, it seems your code is mixing up the fielname/value array and the options array when calling setAndSave(). PW functions often takes multiple different types in multiple different places, which can be a blessing and a curse.
    1 point
  6. v0.6 is released with the following changes: New setting: Source language (thx for the idea to @Ivan Gretsky and for the pull request to @theoretic) Languages for source and exclude can only be selected if they have been defined in the fluency config first I had to do some refactoring of the translation strings and the module config, so please validate/correct your settings after the update to v0.6!
    1 point
  7. Ok thanks i will have a second look at it. It works now but the code can be optimized.
    1 point
  8. You'll need to save your modifications by using $page->save() method: https://processwire.com/api/ref/page/save/ So just replace: $ts_entry->edit(); With: $ts_entry->save();
    1 point
  9. Hey Bernhard. Just to confirm: do you mean that the corrected image rotations array didn't fix the issue for you? If so, did you have client side image resizing enabled, and did you try if disabling that makes any change? PM'd.
    1 point
  10. Hi, have you achieved your desired results yet? Just a quick note: if you change multiple fields on one page it’s probably more efficient to just change them individually and then call $page->save() once, instead of using $page->setAndSave() multiple times. Read the docs for more info. Also be aware you’re changing the page’s name every time (well, kind of) Address or Ort change. That can be desirable, but if the page is accessible at its default URL, that URL won’t be stable, and as everybody knows, cool URLs don’t change. I’m not sure I completely understand your requirements, but it looks like it should kinda work? Obviously when you generate the page name in Pages:added and save it, the Pages::saved hook will be triggered and override that change, so you might want to run the first one with ['noHooks' => true] or just get rid of it.
    1 point
  11. I guess because you are in a module you have output formatting OFF which means that $page->image is an array of images and not a single PageImage object. Using $page->image->first()->size should work. PS: To make everything clear and reduce chances for errors you can be more verbose and use $page->getUnformatted('image')->first()... PPS: Better check if an image was uploaded before using ->size(...) $img = $page->getUnformatted('image'); if($img AND $img->count()) { $img = $img->first(); $img->size(...)->... }
    1 point
  12. Just to go against the grain a bit: Those modules are way, way overkill for 99% of sites. Just looking at the screenshot in the Seo Maestro thread, all those options would confuse most of my clients. Who really wants or needs to manually edit the change frequency of a single page? Some of those options should also be generated automatically (Locale, based on the current language) or set globally (Site Name, for example). I get that you can control which fields to show and that it's kind of a framework which you can use for all kinds of sites. But in my experience, showing five screens of SEO settings on every page is the best way to get clients/editors to be scared of them and never use them. Three fields - title, description, preview image - are all you need most of the time. KISS. I would use external tools for this. There are many tools that are much better at this stuff than Yoast, and they look at the page as a whole, not just the body content. For example, at work we have at some points used the following tools among others, in no particular order: Ryte, Seobility, Semrush, Sistrix. And many more ...
    1 point
  13. Ok, in that case you can still filter out the unnecessary paragraph with the non-breaking space inside. Your str_replace function probably doesn't work because you are trying to replace the literal string &nbsp;. That won't work because the non-breaking space is (most likely) stored inside the database as a Unicode character, not as the HTML entity. Matching "<p> </p>" won't work either, because that is a regular space, not a non-breaking space. To replace the non-breaking space, you can use a regular expression and match the specific NO-BREAK SPACE Unicode character. This works for me: $string = "<p>&nbsp;</p>"; $string_unicode = html_entity_decode($string); // $string_unicode now contains a non-breaking space unicode character echo preg_replace('/<p>\x{00A0}<\/p>/u', 'Successfully replaced!', $string_unicode); // Successfully replaced! Make sure to include the u flag to treat the string as UTF-8. You could also modify this to match multiple non-breaking spaces or whatever CK Editor throws at you ? You can use that either to remove the superfluous paragraph in your template output, or write a little script to convert the text saved in the database (which is the cleaner way to go, if you ask me).
    1 point
  14. For CK Editor fields, I always use the option to force pasting text as plain text. This strips any markup and formatting when pasting, it has prevented so many headaches for me ... It does mean that you can't paste formatted text even if you know what you're doing, but this way no weird formatting from Word can make it into the source code. You can activate this option through the Custom Config Options for the CK Editor field: forcePasteAsPlainText: true I'm not sure that will remove the extra non-breaking space (the paragraphs get added by CK Editor, so you only need to get rid of the NBSP), but it's worth a try and it does deal with most problems when pasting from Word.
    1 point
×
×
  • Create New...