Leaderboard
Popular Content
Showing content with the highest reputation on 02/15/2023 in all areas
-
Replace Home An action for the Admin Actions module for ProcessWire CMS/CMF. The action replaces the template and content of the home page with that of a selected page. Sometimes there is a need to develop a new home page while keeping the existing home page in place until the new version is ready and approved. Then you want to apply the new home page, but this is not so easy to do in ProcessWire since home is a special page that cannot simply be replaced by another page. What the action does Removes all the fields from the home template, which simultaneously deletes all the content from the home page. Adds all the fields from the selected source page template and applies any template-specific overrides. Sets the home page field values to match the source page. Updates all file and image URLs in any textareas so they point to the home page files rather than the original source page. What the action doesn't do The action does not modify the home template file. You will probably want to update the home template file immediately after running the action (e.g. copy/paste the code of the source page template file). The action does not automatically delete the source page – that can be done manually after you have confirmed that the action was successfull. Warning This action is destructive! It deletes content/files/images from the existing home page. In addition to the automatic Admin Actions database backup you should create a backup of /site/assets/files/ before running this action, and consider also making a manual database backup for extra safety. Usage Install the Replace Home module. Visit the Admin Actions config screen and enable the "Replace Home" action for the roles who are allowed to use it. Create file system and database backups – see the warning section above. Navigate to Admin Actions > Replace Home, select the source page whose template and content will replace the home page, then execute the action. Update the home template file if needed. Screenshot https://github.com/Toutouwai/AdminActionsReplaceHome https://processwire.com/modules/admin-actions-replace-home/8 points
-
A new addon action module for Admin Actions created to meet this need:3 points
-
PW doesn't support that kind of sorting in $pages->find(), but you could use the FindMerge module and do something like this: $base_selector = "title=foo"; $selectors = [ "$base_selector, template=template1", "$base_selector, template=template2|template3", "$base_selector, template!=template1|template2|template3", ]; $pagination_limit = 20; $results = $pages->findMerge($selectors, $pagination_limit);3 points
-
That could be built into Tracy if you want it. Currently the email logging is just all error levels to all listed email addresses, but I am sure we could support different levels per email. Up to you of course but it just feels like a good fit to me. Excited to see what you do either way.2 points
-
@BrendonKoz, please create an issue on github if there is none yet. I will merge the mentioned pull request later this week. I know about it as I did my best to engage @ukyoto work on it. I am sure he did a great job!2 points
-
Hi @gebeer - the Tracy core handles this via PHP's set_error_handler (https://github.com/nette/tracy/blob/f9645299229878a61b46baa82ff61d8a739bccf8/src/Tracy/Debugger/Debugger.php#L226) Looking at what your trying to do here, can I suggest that you extend Tracy rather than creating a new module. Recently I added the ability for Tracy to log to Slack (https://github.com/adrianbj/TracyDebugger/blob/3185ec827c001c0c310cb9b13558ca3e53eabbc5/includes/SlackLogger.php) and use different icons based on the error level, eg: so you should certainly be able to do something similar for Rollbar. I feel like most PW users make use of Tracy and this would just help to make it better without needing a separate module. You might find some further inspiration in the panels that add support for monolog that you can find here: https://componette.org/search/tracy You might find this useful: https://tracy.nette.org/en/recipes#toc-custom-logger although keep in mind that I had issues with that approach in that I couldn't get it to also support emailing errors at the same time Let me know if you have any other questions.2 points
-
You'll want to sanitize search input before using it in a selector string. ? And here's an alternative way you could search across the FAQ items: $search = $sanitizer->selectorValue($input->get('search')); $faqs = new PageArray(); foreach($page->faqs_groups as $group) { $faqs->add($group->faqs); } $results = $faqs->find("title|body*=$search");2 points
-
Hi, With the introduction of GDPR regulations, many of our clients with "webuser" systems we've developed need a way to email users that haven't logged-in in a while (18 months seems to be the standard) to ask them if they still want their user account. For most of the systems we've developed, we've added a field to the user template which records the time when the user logs in, so we'll be able to develop this functionality. It got me thinking, would this be a welcome addition to the core, accessed in a similar way to created/modified dates e.g. $user->lastlogin? Were it to be implemented, it would be useful to be able to 'silently login' if using $session->login($username, $pass) or $session->forceLogin($username), in the same way you can bypass save hooks by passing in an option to $pages->save(). Cheers, Chris - NB Communication1 point
-
I originally developed and launched Real SF Properties in 2015 and did a complete design and programming refresh in 2022: https://realsfproperties.com/ The site was designed by BuzzCandy.Design: http://buzzcandy.design/ This was my first time using Tailwind CSS and it was a great fit for this project. I wish it existed back in 2015 because while UIkit has been my go-to CSS framework for several years now, there are some site designs (and designers) that I work with that simply need a higher level of precision to slice correctly and be maintainable. Sure, I could have used vanilla CSS and done it the classic way (separation of concerns), but Tailwind CSS and doing everything with utility classes (locality of behavior) does come with major benefits, even if the markup is not so easy on the eyes. This site does not use a matrix page builder or anything fancy. The sections are hardcoded but with the ability to add data using the various page data structures that feed in accordingly. It has also has an accessibility score that is extremely high. It's a quick loading site even though ProCache or CDN is not yet enabled. Other frontend libraries include Flickity and Headroom.js. More details on my personal website: https://jonathanlahijani.com/projects/real-sf-properties/1 point
-
1 point
-
You can edit your first/original post and change the title. Add [SOLVED] at the beginning and you are done. That's our "Mark as solution" button here.1 point
-
Don't think that many people will have a need for this. But would be nice for sure ? Reason why I need a separate module is also that it should be independent of other modules (aka TD). I am using Tracy on every install. But not all devs do that and the agency I am freelancing for would like to have it as a standalone tool.1 point
-
Thanks Robin, what a dope, I know that the query needs sanitizing it just escaped my brain for a moment.1 point
-
1 point
-
@adrian Thank you for all the info. That will help a lot. will look through your code where Tracy gets started up. That should give me good pointers. Rollbar also uses set_error_handler. Their docs say to init Rollbar at the entry point of the application. I'll find the right place to do this. Great pointer. I need this as a standalone module because we want to have different targets to report to based on error levels.. But once I have that, we can add an option to Tracy as well. Thanks again for all those useful links.1 point
-
v3.0.0 introduces a breaking change as of request from @gebeer Unfortunately I have chosen a bad order of parameters on the createPage() method that showed warnings for @gebeer (where did that warnings appear?) That's why I decided to change the order and the recommended way to use the createPage() method is now using named arguments. RockMigrations had PHP8.0 requirement anyhow so we can rely on them! $rm->createPage( template: 'foo', parent: 1, title: 'My foo page' ); That's a lot better to read so I think despite the breaking change it is a worthwhile addition. PS: I tried my best to make that breaking change as obvious as possible including the version bump to 3.0.0 and the note about the breaking change in the release log. If anybody has suggestions on improvements please let me know!1 point
-
@digitex@torf Just in case you (or anyone else) are still trying to work around this issue: I just had the NaN JavaScript error on one of my sites using LeafletMapMarker that didn't exist a few months ago. In trying to identify the error since there were no PHP errors discovered (though it wasn't in debug mode), I noticed I had, in that time, upgraded the version of PHP from 8.0 to 8.1. On a whim I reverted back to 8.0. This fixed the rendering of the map. Something is apparently not working on the PHP side which is interfering with it passing the parameters to the module's JS initialization constructor. This might not be a proper solution, but maybe a potential workaround (depending on your requirements) until or unless a more formal update to this module, or a successor can be offered. Thankfully (?) there are quite a few people who seem to have used this module, so the need to get it fixed somehow sooner or later will be increased. EDIT: There's a pull request in the module's GitHub repository that might fix this (untested).1 point
-
It's different; I posted it on the issues repository, so Ryan has it all in one place. Edit: already fixed, available in the (upcoming) latest dev 3.0.2121 point
-
@bernhard It wasn't really a website. It's a catalog of machine parts for the company. We were then looking for a CMS that could display the hierarchical structure of the catalog well. In addition, we needed the templates to have a different structure for different types of parts. One of our young programmers at the time said: there is a great American CMS - ProcessWire, it is perfect for our task. That was in 2012. In any case, we finished this project in 2012. I found a backup now. We used ryancramerdesign-ProcessWire v 2.2 In 2013, we moved our windsurfing store project from a self-described CMS to PW 2.4. By the way, the self-written CMS has been around since 2000. At that time @Soma cheatsheet helped us much. We still maintain that project, but have updated PW each time for new features from @ryan. Back then, there was no PW module for a full-fledged store. But in 2012, @apeisa published an example of such a module Shop-for-ProcessWire. We took it as a basis and now it is a working online shop. In fact, I made my first site in 1994, and it is now also converted to PW. It was such a long story with a happy ending.1 point
-
https://processwire.com/docs/selectors/#sort1 point
-
Hi @e0f! Skimming the latest replies in this thread it sounds like that should be possible with @thausmann’s prototype version: https://github.com/timohausmann/IcsGenerator/tree/multievents You can keep the .ics files around as static files that you only update when something changes (say, by hooking Pages::savedPageOrField) or you can just build them live for each request as you would any other page. Where do you want these files to live exactly? If these calendars are supposed to be private to each user, you’ll need to figure out how to authenticate requests originating from your users’ calendar apps. That may or may not be the biggest hurdle in this endeavour, since they’re probably not going to send the session cookies ProcessWire normally uses. Do you struggle with anything in particular?1 point
-
v2.15.1 ignores module migrate files if the corresponding module is not installed ? And it will trigger the migratefile right after the module has been installed! Thx for your input and feedback guys! Keep up bringing good suggestions ?1 point
-
I've run into this several times and it seems like a bug, or at least it's misleading. Steps to reproduce: Add a new template, eg 'news' Set its fieldgroup to another template, eg. 'basic-page' Edit a field that is in 'basic-page' template, and remove from all templates Now you you would assume that you can delete the field because it's not used in any templates, but you can't. Trying to delete from api reveals that it's used by the 'news' template, which obviously shouldn't be true because it uses the fieldgroup of 'basic-page'. Unfortunately I can't set the 'news' template's fieldgroup to another one because of data loss. I could remove it only via api using fieldgroup->softRemove(). Is there a better way of getting rid of such fields?1 point