Leaderboard
Popular Content
Showing content with the highest reputation on 12/14/2021 in all areas
-
Over the years, I've experimented with using RepeaterMatrix as the basis of a rich page builder. I've gone through at least a dozen concepts, most of which hit the chopping block due to either being too complex, not well thought out, too clever or too limiting. To my knowledge, the only other CMS that takes the "Builder" approach that I've demonstrated is DjangoCMS (meaning, it has a matrix-like field with depth support). While the "Builder" approach works well, it could be too advanced for some people. Therefore the other approach is the "Classic" approach where you don't deal with containers/rows/columns (which instead is handled by template code), and simply enter the content in the respective field. This is easy to understand, but has drawbacks in terms of flexibility. If it were made to be too flexible, it would become a "God" block which is bad. Then I finally thought of a third approach which is a mix between the Builder and Classic approach. It uses the basic builder blocks, combined with the layout from the matrix item template file. By using the basic builder blocks, you get the plethora of options. It requires an extra page to be created behind the scenes however, but live preview still works. I made a video comparing all the above (10m duration). I want to hear your feedback on this as I am ~75% done with my super module (doing a lot of code and concept cleaning at this point) and want to finish off this portion of it. (note: I'm posting this in the Dev Talk forum since this is a discussion / not support request)2 points
-
Is LazyCron being used in any way? Maybe you have it doing something intensive every 24 hours?2 points
-
A look in all logs could be helpful. Maybe there is a more detailed error somewhere. Besides that we could try to figure out if there are any hooks or modules involved that might cause those issues. Are there any actions like database backups or do you perform any checks while logging in or via hook? Do you use ready.php or _init.php somewhere? I guess at some point someone might say TracyDebugger can help in such cases but I rarely use it so I can't assist with it. TL;DR what's in ready.php? what's in _init.php? which modules are installed? what's written in all the logs?2 points
-
I've been using Tailwind for years, yet there are still both those days that I really enjoy using it, and others when I wonder if it really makes sense, so I get what you're saying. Also: even though we use it for just about all of our projects nowadays, we often combine it with "custom" CSS classes (mostly BEM style), simply because Tailwind isn't always the correct tool for the job ?♂️ Others have probably said it already, but for me/us the benefits of Tailwind boil down to... super fast development, particularly when mocking things up / designing in the browser, common set of tools and guidelines, which is very nice when working in a team (having to dig into an older project that doesn't use Tailwind is a bit of a pain), and superb efficiency — by which I mean that using Tailwind results in very small CSS files, in most cases much smaller than I would get by writing my own vanilla CSS. There are a couple of things I'd view as downsides: a) markup becomes entangled with styles, and b) sometimes it feels like I'm just learning alternative ways to do the stuff I would already know how to do with vanilla CSS. First one is something that, in my opinion, can't be completely avoided, but using components for shared sets of classes helps a lot. Second issue becomes less of an issue day by day. Other than that, I'm quite happy with Tailwind, and it suits my workflow very nicely. It's not the perfect fit for everyone (or for every project), and that's fine too ? "What about keeping the main layout styling in vanilla css and put only utility classes for final layout tweaking?" Well, we use a combination of custom CSS and Tailwind already, but the literal "layout" part is one that's actually so efficient to do with Tailwind that I wouldn't bother doing it in vanilla CSS anymore. In my experience changes to the layout are often easier to implement with Tailwind than with vanilla CSS, and the resulting markup is actually quite clean. "Having said that, how many percent of all the available tailwind utility classes are really going to be used?" It doesn't really matter how much of Tailwind I / we use. Thanks to the tree shaking logic the "compiled" result only includes what is necessary. There's zero overhead in having a large toolbox but not using each tool for every project. "That brings me to the idea to sort out only the most useful ideas and classes from Bulma, Spectre and Bootstrap and bring them in your own utility class framework. That would make things certainly more effective." Exactly how would this make things more effective? We're in the business of building custom sites and/or applications, so pre-built components offered by a front-end framework won't help much (if at all), at which point — from my point of view — all Bootstrap and likes can offer is a very limited set of utility-first tools. Sure, we use prebuilt tools elsewhere (Vuetify for PWA apps etc.) but for custom-built sites Tailwind is (IMHO) a better fit.2 points
-
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!1 point
-
Good evening (at least here where I'm at))! Wireframe has a lot of files named the same way (default.php). When working with multiple files in an IDE (read "all the time") it is hard to distinguish between tabs as they are all named the same. At least it is in VS Code due to this issue. I am used to give files meaningful (bul long) names. I used to have templates/views/home/home.view.php instead of templates/views/home/default.php. Files are better searcheable this way too. Do you know any workarounds? Could it be worth it to have default filenames in Wireframe have configurable patterns, so that something like templates/views/home/home.view.php was possible?1 point
-
I always watch carefully your videos. You've put so much thought into it, it really shows how you've found the advantages and drawbacks of each solution. I also started experimenting with the first option where you basically need to set up the container, rows and columns first before working on your content. Template-wise, I figured that tracking depth could get complicated quickly, and I abandoned the idea, but it sure looks like the most flexible, less "hacky" way compared the new, third option you're proposing. Sure, it requires thinking about design first before inputting your content, and I'm not sure I would offer that option to most of my clients as it requires some learning and a designer/developer frame of mind ("what's the deal about those rows and container anyway?" is what I'd imagine they'd say), but if I'm the sole editor, I'll love to have that option! The classic option is of course always a good, although obviously more limited option, that is intuitive and supported out of the box without some clever hack and double modals such as the new, hybrid approach. I can't shake the feeling that the third option is going to be brittle and need an ever-growing set of workarounds for all the use cases out there. Personally, I've gone a different route. That's probably going to sound half-baked to you, but it might be of interest to some. Instead of trying to cram all the blocks on the same page, I'm using subpages as containers for those blocks. In other words, from the parent page, I loop through all the children to build my page out of this series of containers / sections. So each child page is basically a section of the parent page, where I only need to apply columns, then place my blocks inside. If I need to change the order of those sections, it's just a drag and drop away: I simply move the child page up or down below the parent page. I've not fully explored the possibility, and I'm still experimenting with this on a couple of sites, but I've found it flexible enough for most of my uses, and easy to code. On each child page, first there's a combo (pro) field that holds the basic design settings for the current section, such as margin, padding, background color, width, etc. Then I set up my columns with a simple text field that holds predefined tags for responsive widths and optionally offsets and additional classes, and inside my blocks. Here's a screenshot (in Spanish, sorry) of something very similar to what you've shown in your video: a text on the left, and image on the right.1 point
-
Not sure how common this sort of practice is, but we always define custom colours for each project — usually with generic names such as brand-1, brand-2, etc. (unless the client has named colours or a lot of colours, in which case more specific naming helps). In fact in most cases I only use two colours from the default palette: black and white. Everything else (including shades of gray) are either custom colours, or just black/white with specific opacity applied ? Same thing goes with paddings: while we use the default spacing scale, there are always a few "project specific" values; half, single, double, triple, etc. Usually these are pretty straightforward (single = 1rem, etc.) but sticking to predefined, named values does make it a tad easier to make changes later. I don't think there's a built-in way for this. Depending on the specific use case I'd probably pick one of two options: If it's just a few colours etc. that need to change, add those to the shared theme config file for the site and handle the "colour theme" in code. If there are a lot of changes and/or for some other reason you want to clearly separate styles for different parts of the site, create a separate Tailwind config file and adjust your build process accordingly. How that would work depends on what kind of build process is in use, but generally speaking it shouldn't be too difficult ? If you google something like "tailwind multiple themes", you'll probably find other solutions as well. I've never needed this type of functionality, so haven't given it much thought.1 point
-
I've seen some hacks / config settings for VSCode to display at least the parent folder of a file. Never tried or used them... but maybe still worth trying to look into this. Just an example: https://stackoverflow.com/questions/39598007/showing-path-in-file-tabs-in-visual-studio-code1 point
-
@Abe Cube please use the code input to post code: Example: <?php namespace ProcessWire; class TabExtension extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'Foo test module', 'summary' => 'An example of creating a module', 'version' => 1, 'summary' => 'Display message when pages are saved', 'autoload' => true, ]; } public function ready() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); } public function addButtons($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $tab = new InputfieldWrapper(); $tab->attr('title', 'Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Settings'; $markup->value = '<p>Just a placeholder for some inputfields.</p>'; $tab->add($markup); $inputfields->add($tab); $form->add($inputfields); } } }1 point
-
You can keep on using UIKit but it is not a silver bullet solution for any situation. Find any mobile menu/accordion navigation on jqueryscript dot net for free with code examples, and demos ready for you to use with processwire. Have a look here: https://www.jqueryscript.net/1 point
-
That can be easily done changing colour variables inside tailwind.config.js as suggested on my previous post. In addition to that it might be useful, for theming purpose, to create a single preset for every theme you want to have, and switch between them per project-basis. More here https://tailwindcss.com/docs/presets Not something possible out of the box as far as I am aware of. Utility variables are top level and not tied directly to custom sections.1 point
-
@bernhard I've stumbled upon a problem when I want to specify more pages with the same name but different parents declaratively. More info in PR: https://github.com/BernhardBaumrock/RockMigrations/pull/231 point
-
Hi @Abe Cube I you are talking about ProcessPageEdit screen, that you can add runtime fields via hook. You can find some info there1 point
-
@benbyf, moderator note A near identical topic was created yesterday. I have combined your threads. @Simi I have modified the thread title slightly to better reflect the issue you are facing.1 point
-
Running PW 3.0.165 and have added to config.php: $config->moduleInstall('directory', true); $config->moduleInstall('download', true); $config->moduleInstall('upload', true); but with no change in the admin... stil unable to update modules, or grab them via urls ? whats the deal here?1 point
-
I need to create a membership site where someone can buy a product and later activate a yearly membership in their account. How all of you approach building a membership site? Is custom development the only way around? I've been searching these forums a lot but couldn't really find much guidance. So this is what I want to achieve: User can register an account (LoginRegisterPro can handle that) User can buy a membership for 1, 2 or 5 years in their accounts and pay by Stripe They can also redeem a code for a membership They can renew their membership later (doesn't need to be recurring payment) They can have multiple memberships in their accounts plus reminder emails on expiry I can do that using the API of course but I was hoping there's an easier way. Do you use an integration for that, can Padloper be helpful here, or everyone are just developing their own solution?1 point
-
Just reporting back that for my case this turned out to be very easy using just WireHttp alone and no Oauth client library needed. $http = new WireHttp(); $consumer_key = 'my_key'; $consumer_secret = 'my_secret'; $auth_token = 'my_auth_token'; $auth_token_secret = 'my_auth_token_secret'; $time = time(); $nonce = md5(uniqid(microtime())); // OAuth authorization header $http->setHeader('Authorization', "OAuth oauth_consumer_key=$consumer_key, oauth_token=$auth_token, oauth_version=1.0, oauth_timestamp=$time, oauth_nonce=$nonce, oauth_signature_method=PLAINTEXT, oauth_signature={$consumer_secret}%26{$auth_token_secret}"); // Parameters $params = [ 'member_listing' => '123456', 'rows' => '20', 'photo_size' => 'FullSize', 'return_metadata' => 'false', ]; $params_str = http_build_query($params); // Get JSON response from Trade Me $json = $http->getJSON("https://api.tmsandbox.co.nz/v1/Search/Property/Rental.json?$params_str"); Because of the circumstances of my case I can hardcode $auth_token and $auth_token_secret. But more often with OAuth you would need to get these values in a separate query and store them.1 point
-
Do you mean something like "Fieldset in Tab (Open)" (Class: FieldtypeFieldsetTabOpen)? This is included in the Processwire core ?0 points