Leaderboard
Popular Content
Showing content with the highest reputation on 12/19/2021 in all areas
-
How many processwire users find this NOT useful ? Some user base polling or voting would be on its place. For so many years having these profiles out of the box added to beginners friendly and jump start with processwire.4 points
-
This week ProcessWire has gone on a diet. I've been working on reducing the size of the core by moving all (except site-blank) installation profiles out of the core and into their own repositories. This cuts the size of the core in half, going from 15.5 MB down to 7.5 MB, which is quite a slim down! This means the site-regular, site-default, site-beginner, site-languages, and site-classic now live in their own dedicated repos on ProcessWire’s GitHub. The site-blank one remains, but I've updated it a bit to make the template files more useful for beginners while still keeping it a blank profile. I may do a little more with it and rename it to be site-basic or something, and then have an even more trimmed down site-blank in its own repo as well. I'm not yet sure about that, so will do a little more with it next week also. I also went through each of these site profiles and cleaned up a few things, corrected old and outdated links, and updated a lot of text in readme files and such. I think a lot of the more experienced users would also prefer not having extra profiles included in the core as well. This update came at the request of the community a few months back (I think it was Robin S. that requested it, but not positive). It's not like any of the current site profiles have a lot of bling or marketing value, as they really are more just technical examples and starting points. So I think it's kind of a win/win to trim down the core in this way. Though maybe one day we'll have a site profile that looks good and has good marketing value. But until then I think we gain more by keeping the core size nice and trim. The downside is that there's a little more for new users to figure out (downloading a profile), so in the next week or so I'm planning to update the installer to hopefully lessen that issue and maybe even build in the ability for the installer to download and install site profiles from the modules directory. That comes with its own security considerations, so I'm not yet sure we'll go that far just yet, but it's one of a few options I'm looking at. Thanks for reading and have a great weekend!2 points
-
Found a solution based on @Fokke's solution from 2015. Adding the following in admin.php, before the line `require($config->paths->adminTemplates . 'controller.php');` gets me the behavior I needed; Settings only shows up for the SuperUser: function hideSettingsTab(HookEvent $event) { // Get the page being edited $page = $event->object->getPage(); if ( !wire('user')->isSuperuser() ) { $page->template->set('noSettings', 1); } } $wire->addHookBefore('ProcessPageEdit::buildForm', null, 'hideSettingsTab'); This solution is easy to adapt for whatever your needs are.1 point
-
Where exactly do you need help? What did you already achieve on your own? What works? What does not?1 point
-
Hi @stanoliver in this case, i remember an old post that may help you adapt the code to your own need it does, at least visually, exactly what you are looking for bernhard added a more recent solution that may worth a look (like everything this guy writes here ?) have a nice day1 point
-
@szabeszReally "wow" these beautiful impressions from Hungary!! These impressions enriched my Sunday morning!1 point
-
Whether it's via RM or some other method, having proper support for handling migrations in the core would be huge ? One thing I miss from WordPress is the ability to define data structures programmatically. It's nice to be able to store such definitions in Git, share them among developers, modify or roll them back with ease, and then deploy to any number of environments automatically. The contexts are of course different: custom fields and custom post types have no real table structure(s) per se, so certain things are very easy, while others are very hard (or inefficient). Pros and cons ? From my point of view RM and Composer both have their use cases, and neither can replace the other. Where RM and Composer overlap is mostly just installing modules and perhaps managing core updates. While one can run all sorts of stuff with scripts or installer modules in Composer, it's not really intended as a tool for creating, implementing, or rolling back migrations.1 point
-
Hi guys! I'm a bit anxious because this is the first module I present! (beta modulo) But I will finally be able to share something with the community too! :) This is a BETA version of the PayPal payment system called: PayPal Commerce Platform. It is an advanced system (Business Pro account is needed) that brings various benefits in terms of fees and above all integrates direct payment with credit/debit cards. The module integrates with Padloper 0.0.2, which is the current installation I'm using. This system integrates the classic PayPal buy button, the alternative or local payment method and the new payment system: credit/debit cards that doesn't go through the PayPal account. It is a Stripe-style payment, it connects directly with the bank and integrates 3D security validation. I say that it is a BETA because this module currently only works with Sandbox account, to put it live you need to change API url manually (manually for the moment). Because this module is not ready for live: I would like to have your opinion on how I built the module (is the first one I do). I don't want to share something that is not fish but I need a comparison with someone more experienced than me, for be sure that this is the best way to code the module. If you want to try this I created a git, you will find all the instructions for installation and correct operation. (Git has a MIT licensed) https://github.com/MarcooRo/processwire-PayPal-Commerce-Platform I hope I did something that you guys can like :) UPDATE I have been testing the form for several days and everything is working fine. Each order enters correctly, so I have updated the repo with the latest changes and I can confirm that this version is ready for live! I have updated the repo: Added error message + popup Fixed some bugs related to multilingual Updated the switch for checking the responses of the 3D security system1 point
-
This module works wonderfully and it really helped me a lot, so I just want to say thank you1 point
-
Thanks Abdus, I checked all the permissions but could not identify any changes. However, when I said I had checked all the page 'family' settings I had omitted to check the 'home' page. When I did I found a list of 'allowed' templates which excluded the one I was trying to add. I have added it and all is OK - at least to that stage! With your advice I now have a better understanding of how this template process works - much appreciated. Many thanks, Michael (79 years young)1 point
-
Hi Spica! Create a new permission called "page-edit-show-settings-tab" and adjust the roles to fit your needs. In /site/templates/admin.php add the following before the line: require($config->paths->adminTemplates . 'controller.php'); function hideSettingsTab(HookEvent $event) { // Get the page being edited $page = $event->object->getPage(); if (!wire('user')->hasPermission('page-edit-show-settings-tab', $page)) { $page->template->set('noSettings', 1); } } $wire->addHookBefore('ProcessPageEdit::buildForm', null, 'hideSettingsTab'); After a quick test, this seems to work fine on my setup.1 point
-
Joss actually emailed me a similar question and I'll duplicate my reply here since it seems relevant: Performance as it relates to database is really not an issue that one needs to consider much (or at all) when it comes to creating their fields. Most field data in ProcessWire is loaded on-demand. It loads data selectively and only when it needs it. This enables it to be highly memory efficient with large quantities of pages in memory at once. When you have a $page, behind the scenes, none of the page data is actually loaded until you access it. For instance, if you access $page->body, then it goes and retrieves it at that moment (if it hasn't already retrieved it before). MySQL is extremely fast with simple primary key, non-joined selects, and we take advantage of that. What I'm trying to get across is that quantity of fields does not translate to an increase in joins or other factors that would slow the system down. Where ProcessWire does join data automatically is at page load time is when you check the "autojoin" box on a Field's "advanced" tab. Some fields you know will always be needed with every $page instance, and that's what autojoin is for. Typically, I make my "title" field autojoin, as it is already by default. I've hidden that autojoin option under the Advanced tab simply because most people never need to consider it. The original intentions behind autojoin have become less applicable than I originally thought [with regards to performance], so it's not something that comes up that often. ProcessWire also uses joins when it performs queries for $pages->find("selector"), and related DB-querying selector functions. It joins all the tables for fields that you query. So if you perform a find for "date>2012-12-19, body*=holidays" then it's going to join the field_date and field_body tables when a value matches. Though it doesn't do this for the purpose of loading the data, only for matching the data. Technically this type of query could be potentially faster if all those fields were in one table. But that doesn't translate to results that matter for us, and doesn't affect the way that you should use ProcessWire. The benefits of our one-table-per-field architecture far outweigh any drawbacks. I put a lot of time into finding the right architecture and balance here when coding ProcessWire 2. Incidentally, ProcessWire 1 did use the one-table approach (all the field data was stored with the page rather than in separate tables) and it was far less efficient with memory, and about the same in terms of performance. It's better to re-use something like "body" (when possible) rather than create "article_maintext" or other template-coupled variations like that. The reasons for that are for your own benefit. It is less to keep track of, and tends to foster better consistency. It also results in more reusable code and broadens the potential of where the data can be used. Take the example of an on-site search engine, like you see in the upper right corner of processwire.com. If we know that the main text field(s) of most templates has some consistency in their field names (like title and body), then we can write code that doesn't need to know whether something is an article, a press release or a product. We can find all pages that match "holidays" in the text just by doing this: $pages->find("title|body*=holidays"); But if created a separate textarea field for every template, then any code that queries those fields needs to know a lot more about them: $pages->find("title|article_maintext|pr_maintext|product_maintext*=holidays"); While that still works, it doesn't scale nearly as well. This also translates to the code you use to output the results. If you want to show a snippet of the matching text with the search results, you are going to have a lot more fields to consider than just "body". Now if each of your templates genuinely needs very different settings for each of their main text fields, then of course it's fine to create them as you need them. But in the real world, I think you draw more benefit by planning for reusability when possible. The benefits are for you (the developer), as it doesn't matter much to ProcessWire. Reuse fields where it's obvious that the name of the field makes sense in the context of multiple templates. If template "employee" needs a date_of_birth field and template "press_release" needs a date_publish field then just create one field called date and use it on both templates. On the other hand, if you need multiple date fields on the same template (like date_unpublish) then more specific field names start to make sense. In that case, I would usually use my date field for publish date, and create a separate date_unpublish field for my unpublished date field. Though some may prefer to actually have separate date_publish and date_unpublish fields because they are obviously related by name. Ultimately, use what works best for you, but always keep an eye out for obvious reusability potential with fields. I think that most people naturally arrive at the right balance for their needs after some experimentation. What is a best practice for one need might not necessarily be for another. So these are mostly general purpose guidelines and people should find what makes the most sense in their context. For the majority of cases, I think avoiding tightly coupled template and field names is a better strategy. TL;DR: It doesn't matter to ProcessWire what you do. Aim to reuse fields when you can and when it makes sense, for your benefit.1 point