Leaderboard
Popular Content
Showing content with the highest reputation on 08/17/2020 in all areas
-
When I started working professionally on web projects... (don't you just love when folks start with that? "oh man, it's going to be another rant!") ... some of the first CMS' I had the pleasure to work with were kind of "static site generators": they generated static HTML files when you saved the content, and if your site had subdirectories, those were literal directories on the disk with more HTML files in them. I believe this was in part because server-side rendering back then was pretty darn slow and clunky, but also because it was easier to build a clean site structure with actual directories filled with static HTML files. "Dynamic" features, comment forms, polls, and whatnot were not quite as important back then, mind you. Now, I get that modern SSG's are a different beast in many ways, and I think they're actually pretty rad. What bugs me, though, is the amount of marketing bullsh... uhm, opinionated information floating around. Things like this gem from the staticgen.com website (emphasis added): I mean... how is this what a "typical CMS driven website" looks like? Any half-decent CMS has built-in caching support, at least to some extent, and caching plugins regularly pop up amongst those lists of most popular plugins for platform X. You don't need to be a rocket scientist to figure out that running a server-side rendered, CMS generated website with no caching whatsoever is a Very Bad Idea™. Comparisons like this may make the SSG approach sound good, but they've also got little to do with how things actually work. Without hopefully being too blunt, I don't think this is necessarily the best question to ask. If you define SSG as an application that reads markdown files from disk and generates a static site from those (that's one of the first definitions that comes up if you search for the term) then I don't see this as a solution most of us could push to our clients. At least not unless the site in question is a static one that doesn't need to update too often, and/or you can convince the client to pay you for each modification on a case-by-case basis. On the other hand if you think of an SSG as something that generates static site from dynamic content managed by some piece of software, well... that software you use to generate the content for the SSG? That's a CMS. It may be a headless CMS, but a CMS nevertheless ? I'm also going to agree with @MoritzLost on the point that ProcessWire + ProCache is indeed a kind of an SSG. Keeping a few potential pitfalls in mind one could definitely use this combination to build a setup that pre-renders the whole site and thus doesn't depend on request time server-side rendering. The web is full of interesting tech: headless CMS', static site generators, APIs, and whatnot. While the "best" choice depends on the use case — you would have to consider the pros vs. cons and figure out what's best for each particular project, client, and team — in my opinion it's also rarely all that important. Websites are created for end users and end users don't care what you're running the site on — as long as it works, serves their needs, is fast (enough), etc. ... and you can get that with any platform ? Sorry, that last part was a bit off-topic. Overall the SSG market is well worth keeping tabs on. Personally I tend to lean on the "dynamic CMS generated content rendered server-side with efficient caching policy" approach, but that's mostly because I feel it makes sense for the kind of projects and clients I tend to work with. Pros and cons ?♂️8 points
-
You can use the count selector to get to the number of selected options, and use a descending sort order to show pages with the most selected items first: $results = $pages->find('sort=-categories.count'); Add the rest of your selectors and replace categories with the name of your page reference field ? See Using selectors in ProcessWire -> Count selectors.3 points
-
11ty is great. It's super flexible and doesn't lock you into a certain way of using it or fixed templating. Static site generators make a lot of sense for anything in the realms of corporate or product marketing page. You can keep all the stuff, which rarely changes in plain html. Form submissions and such can just be sent to a different headless endpoint. There's also things like Netlify CMS or similar tools, which allow you to trigger rebuilds whenever something in the underlying data changes. This is nice if you don't want to involve a dev every time some copy changes. For more dynamic content like e.g. comments I'd still not use a static site generator. They make sense if the cost of rebuilding for each change is outweight by the simplicity of deployment / putting the site up somewhere, but not really if you're constantly rebuilding. I don't really subscribe to the idea of having highly dynamic content just rendered client side, but people do use ssg's as an alternative to the dreaded SPA. Dynamic content is still all loaded/rendered in js, but at least it's multi page with some static bits.3 points
-
Maybe worth a try: https://php-download.com/ PS: https://stackoverflow.com/questions/40545795/how-do-i-install-composer-php-packages-without-composer2 points
-
There are always discussions how PW handles heavy sites. I redesign our webpage www.kentvitrini.com (Turkish City Portal -> News, events, directy etc) This page has now 49.500 news entries. On the left you see a list of states. If you click on any state then you see list of cities on the left . The numbers are the news count under each state or city. State and City names are UrlSegments in the url. In real it is whole running on the Home page but gets filtered by UrlSegment1 = State and UrlSegment2 = City. The news are pulled from a turkish news agency's RSS every 30 minutes with Cronjob. So the news list increases 1000-2500 news every day. This is not the final design and functionality. I put the site online to get Google indexes the pages. I am still working on the site. There will be a Company Directory, Events system and a ads system etc. I wanted to only shere to show you the performance of a website with 50.000 pages running on PW . Please note that i get 94% PageSpeed Score on Gmetrix without Google ads. So theese ads are slowing down the website. With ads i get only around 70% Score. P.S: This is not a Showcase post yet. so did not post it to the Showcase section. When it is totaly ready then i will share it there again.2 points
-
Static site generators will probably be 'the next big thing'. You get way better performance and security by default than you could have with any CMS by definition. Which doesn't mean that you can't have dynamic content like comments, e-commerce etc. But instead of bundling that functionality, you're using external services, APIs, serverless functions and build automation to persist data and trigger builds whenever something changes. I'd recommend reading the Jamstack book (created by the Netlify people), you can get the ebook for free and it explains all the concepts related to SSG. By the way, you don't need NodeJS / NPM to have a static site generator. Though many SSG are built with JavaScript, they use NodeJS only as a runtime for the build step, not as an actual server. But there are SSG written in all kinds of languages - check out this site if you want to find one you like. One could argue, by the way, that the ProCache module for ProcessWire is also kind of a SSG generator, even though it works a bit differently than most tools on that list. My current recommendation is eleventy, I'm currently rebuilding a couple of my own sites as well as a ProcessWire-related project that I might release soon with it ?2 points
-
--- Module Directory: https://modules.processwire.com/modules/privacy-wire/ Github: https://github.com/blaueQuelle/privacywire/ Packagist:https://packagist.org/packages/blauequelle/privacywire Module Class Name: PrivacyWire Changelog: https://github.com/blaueQuelle/privacywire/blob/master/Changelog.md --- This module is (yet another) way for implementing a cookie management solution. Of course there are several other possibilities: - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/ - https://github.com/webmanufaktur/CookieManagementBanner - https://github.com/johannesdachsel/cookiemonster - https://www.oiljs.org/ - ... and so on ... In this module you can configure which kind of cookie categories you want to manage: You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience. Currently there are four possible cookie groups: - Necessary (always enabled) - Functional - Statistics - Marketing - External Media All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ... When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax: <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The data-attributes (data-type and data-category) are required to get recognized by PrivacyWire. the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision. If you want to give the users the possibility to change their consent, you can use the following Textformatter: [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie. You can also add a custom link to output the banner again with a link / button with following class: <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> I would love to hear your feedback ? CHANGELOG You can find the always up-to-date changelog file here.1 point
-
Hello friends! I have another module for you, which will make your daily work as a Processwire developer easier. Introducing: AppApi This module helps you to create api-endpoints, to which an app or an external service can connect to. Features Simple routing definition Authentication - Three different authentication-mechanisms are ready to use. Access-management via UI Multiple different applications with unique access-rights and authentication-mechanisms can be defined The documentation has become quite extensive, so have a look at the Github repository for details: Installation Defining Applications Api-Keys PHP-Session (Recommended for on-site usage) Single JWT (Recommended for external server-calls) Double JWT (Recommended for apps) Creating Endpoints Output Formatting Error Handling Example: Listing Users Example: Universal Twack Api Routes Page Handlers File Handlers A special thanks goes to Thomas Aull , whose module RestApi was the starting point to this project. This module is not meant to replace this module because it does a great job. But if you want to connect and manage multiple apps or need other authentication methods, this module might help you. I am already very curious about your feedback and would be glad if the module helps you a little bit.1 point
-
1 point
-
All has gone smoothly with the new master branch version of ProcessWire (3.0.164), officially released last week. Next week we’ll also be releasing 3.0.165 on the master branch, which will fix a couple minor issues that have surfaced. Though we are talking very minor, so there’s no reason to wait on upgrading. The dev branch commit log covers changes since 3.0.164. There will be more commits next week and then we’ll be on version 3.0.165 on both dev and master branches. This week, in addition to some minor core updates, I’ve been working on updates for both ProCache and FormBuilder. The ProCache updates primarily focus on providing better API functions for finding what’s cached, adding more hooks, and providing better control over when and how cached versions of pages originating from URL segments are cleared from the cache. On the FormBuilder side, I’ve been focused on improving our submitted form entry listing tools for the admin side. Prior to the version in progress, it hasn’t been possible to perform custom searches on submitted form entries, the way that you might do in Lister/ListerPro for pages. Nor has it been possible to sort by anything other than created or modified date. That all changes in this new FormBuilder version. Now you can search within and sort on any field in the entries listings. You can search and filter by any number of fields at once. You can select what fields/columns display, and in what order. You can export (CSV) rows that match your search criteria. It’s basically like a mini ListerPro, but for forms submitted on your site. So far I’m finding it extremely useful in testing here, and I'm excited to release it in the FormBuilder support board. Below is a screenshot. I should have this version released in the FormBuilder board in 1-2 weeks, along with some other updates to it. Thanks for reading this quick update and have a great weekend!1 point
-
Could you please show us your code for this bit? Secondly, it is not clear whether you want to store pages from one instance in another instance. If that's the case, maybe this applies to you? https://processwire.com/blog/posts/multi-instance-pw3/#pitfalls-and-considerations1 point
-
Welcome to the forums, @rookie! The question you're asking is very interesting and important. But I think you have to read the forums a bit before continuing with it. For now it seems like any answer will be not good enough for you. So do search the forums for 'page builder' and 'content builder'. It is better to search with google though) It is possible to do it with the page structure you're showing. But without Repeater an PageTable fields (or preferably RepeaterMatrix) it will be pretty hard to maintain. So take your time to explore a bit.1 point
-
@Robin S this is perfect! Works like a charm. Thank you!! EDIT: After some testing I realized that the icons disappear once a new item is added to the pagetable. So I guess the ajax call and update of the pagetable removes any changes to the buttons? Do you know how to hook into the add item action and reset those icons after the ajax update is finished? EDIT2: Got it. I had to put the hook inside the init instead of ready function. Now it works!1 point
-
@MoritzLost cheers!! I did this and forgot to reverse like a sausage!! Thanks again ?1 point
-
Just wanted to say thank you for this highly needed plugin! Is there a way to donate for it?1 point
-
1 point
-
For /site/ready.php, but you can adapt for use in a module if needed: $wire->addHookBefore('InputfieldPageTable::render', function (HookEvent $event) { /** @var InputfieldPageTable $table */ $table = $event->object; $field = $table->hasField; // Get array of table template data in the form 'label' => 'icon' $table_template_ids = $field->template_id; $table_templates = $event->wire('templates')->find(['id' => $table_template_ids]); $table_template_data = []; foreach($table_templates as $table_template) { $table_template_data[$table_template->get('label|name')] = $table_template->icon; } $event->wire()->addHookBefore('InputfieldButton::render', function (HookEvent $event) use ($table_template_data) { /** @var InputfieldButton $button */ $button = $event->object; // Return early if this is not a button we want to modify if(!isset($table_template_data[$button->value])) return; // Set button icon $button->icon = $table_template_data[$button->value]; }); });1 point
-
Thanks @horst for fixing it and @gmclelland for letting me know. I must have copied/pasted it incorrectly.1 point
-
The multi-step form option is already in the module, so it can definitely be used for implementing surveys with relative ease.1 point
-
1 point
-
I got this too, and it seems to happen when passing fraction values to getBlurhashDataUri() - these were calculated for an image ratio (e.g. $height = $width * 0.35). If you're doing this, try passing whole numbers, or rounding the calculated dimension first (using floor, round, ceil functions): $image->getBlurhashDataUri(95, floor(95 * $ratio));1 point
-
Hello @Roych, Ryan was working on a multi-step/page enhancement to form builder here. I don't know what the status is since I haven't used form builder. Maybe this is a good starting point for your requirements.1 point
-
Today, I am glad to announce that the module support the native image field ??1 point