Leaderboard
Popular Content
Showing content with the highest reputation on 10/09/2023 in all areas
-
Limited Module Edit Allows non-superusers to edit a limited selection of modules. Of course, there are good reasons why non-superusers are normally not allowed to access the configuration screen of modules so use this module with caution. Usage 1. Install Limited Module Edit. 2. In the module configuration select one or more modules in the "Modules enabled for limited editing" field. When you enable a module here a corresponding "lme" permission is installed. For example, if WireMailSmtp is enabled here then a permissioned named "lme-wire-mail-smtp" will be installed. 3. For any role that you want to allow to configure the previously selected modules, enable the "module-admin" permission and the "lme" permissions for any module they may configure. 4. Users with these permissions will now see a special Modules section in the main menu that provides links to configure only the modules they have been given permission for. These users are not allowed to install modules nor are they allowed to uninstall the modules they have permission to configure. https://github.com/Toutouwai/LimitedModuleEdit https://processwire.com/modules/limited-module-edit/4 points
-
@Jim Bailie Your _init.php is called for every $page->render(); so if you've got more than one page rendering in the request, _init.php will be called for both of them. One example of that would be if your template file does a wire404(); then _init.php would be called for the page that started rendering, and also for the 404 page. The reason for this is that _init.php usually establishes variables and such that you might want to populate or use in your template file or in your _main.php, so it has to be called on every page render. If you have a need for it to only be called once, such as if you are defining functions in it, then just move the contents of your _init.php to another file, like _init-once.php (or whatever you want to name it), and then do this from your _init.php: include_once('./_init-once.php');3 points
-
You can find here the release of wire-cli, successor to wire shell, a powerful command-line interface (CLI) tool designed specifically for ProcessWire developers. Optimize your workflow, automate repetitive tasks, and manage your ProcessWire projects with ease. Wire-cli leverages the Symfony Console Component to provide a robust CLI experience, offering a wide range of features and commands to enhance your development process. From creating new projects and managing fields, templates, roles, and users, to performing database backups and serving your ProcessWire projects with a built-in web-server. Still in development, there might be some glitch, I will continuously improve and expand its functionality based on the feedback and needs of the ProcessWire community. Also mentioning that we will be probably working towards merging the features of wire-cli and rockshell to provide a unified CLI solution for ProcessWire. To get started with wire-cli, check out the GitHub repository or simply install it now from your terminal using Composer: composer global require wirecli/wire-cli Contributions are welcome. If you encounter any issues or have suggestions for improvements, please submit an issue, a pull request or post it here.1 point
-
Module help you to create and use set of components to utilize in your ProcessWire. You can find more info and an examples on Github repo : https://github.com/trk/Component/tree/main1 point
-
Megastar! My module was going to be a process module a la SettingsFactory, but that does the job perfectly and saved me a task. Ta muchly!1 point
-
@MarkE, I've released a module that allows non-superusers to configure selected modules, which might be helpful for your current project:1 point
-
Version 2.1.47 is out!! Now FrontendForms supports Ajax form submission! Ajax form submission prevents a page reload after the form has been submitted. This could be useful in scenarios, where you do not want a reload (fe if your form is inside a modal box or inside a tab) after the form has been submitted. You can disable/enable Ajax submission by checking a checkbox inside the module configuration, or you can overwrite the global value by using the setSubmitWithAjax() method on per form base. If you are enabling this feature, a progress bar will be displayed after you have pressed the submit button to inform the user, that the form will be validated now. Otherwise, the user will not see any action until the validated form will be loaded back into the page. If you do not want to show the progress bar, you can disable it inside the module configuration too. With the showProgressbar() method, you can overwrite this global setting on per form base. In the case, you want to redirect the visitor to another page, after the form has been submitted successfully, you cannot do this via a PHP session redirect, because the form has been submitted via Ajax. In this case a JavaScript redirect has to be done. To force a JS redirect after the submission, you need to use the setRedirectUrlAfterAjax() method. Put the new URL inside the parenthesis, and the user will be redirected to this URL after the form has been validated successful. You will find a more detailed information about these 3 new methods here: https://github.com/juergenweb/FrontendForms/blob/main/README.md#setsubmitwithajax---use-ajax-for-form-submission Screenshot of the new Ajax configuration settings: As always, please test your forms if you are changing to Ajax support and report any bugs directly on Github. A lot of changes have been done, so keep an eye on unwanted side effects. I have tested it with my other module FrontendContact too and it works without problems if you are using Ajax support. Best regards!1 point
-
Exactly, I was going to suggest something like that. But be aware of any side effects this might have because this will act on ANY page added and renders the checkmarks on the "Add New Page" screen useless. You might want the hook to be a bit more specific e.g. $wire->addHookAfter('Pages::added(0:template=_YOUR_TAGS_TEMPLATE_NAME_)', ... or also $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); if ($page->template->name !== '_YOUR_TAGS_TEMPLATE_NAME_') return; foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); }); Still, the better solution would be to eliminate this inconsistency in core / core modules. EDIT: You should only do this for non-default languages, e.g. with $languages->findNonDefault(): $wire->addHookAfter('Pages::added(...)', function($event) { ... foreach ($languages->findNonDefault() as $lang) $page->set("status$lang", 1); ... });1 point
-
Finally got some time and it looks good to me. File names looking good as well. See here. I couldn't find anything about transparency in logos (besides that all colors will be stripped out at some point) so processwire-original-wordmark.svg seems to be a good fit.1 point
-
Since this is the second time I see this "issue" arise, I have posted a new issue in the PW-issues repo: https://github.com/processwire/processwire-issues/issues/18261 point
-
You are referring to an echo in a template code that you see twice? That's expected. The code is not ran twice, I don't remember exactly how it works but your echo is like catched by render buffer, in addition to be displayed one time immediately.1 point
-
If you expand the page tree in the parent select, you should be able to click "unselect" next to the "works" page.1 point
-
Yes I know. You should see the Ekonomi and Finans pages somewhere in the page tree. Depends on how you configured your field. Go to find Ekonomi and edit it via the tree. There you will find the Settings tab and checkbox as described. Is it checked?1 point
-
Do you have the regions configuration set to true?? In site/config.php $config->useMarkupRegions = true;1 point
-
I've been working nonstop in ProcessWire all week, but for client work. So this week there are just a few updates on the dev branch, mostly attending to minor issue reports from the last week or so. I have another week of client work left, so next week may be similar, though we may be able to bump the version number next week (on dev but maybe also master/main). Following that, I'm looking forward to working on and collaborating on some more substantial core development and upgrades. I hope that you have a great weekend!1 point
-
Don't forget that you can define/allow overrides for templates based on inputfield settings in the "Overrides" tab of the field. Then the template(s) can allow the override of those particular settings of the field. Alternatively, you don't have to think only about the template settings - you can edit the rendering of the PHP template and check what the current template is, and then render the image's size differently depending on the template. You have the control! ? Image Inputfield Overrides:1 point
-
Just sent out the October Newsletter and at the moment we're holding at 49 subscribers, one being myself ? and basically stagnating since last month (+1). Not sure if the newsletter is helpful for anybody, but I try my best to provide interesting content. Here are some numbers from the first two issues: If anybody has some ideas, feedback or other input feel free ? The first two issues were basically written by ChatGPT with some minor manual tweaks. The input came from a RockShell script that scans all my repos and then creates a log and lists all commits. ChatGPT did a quite good job in converting these into some nice sentences. This months version I decided to put more manual work into it. There have been less commits and so it was possible to give it a more personal touch. Have a great month! PS: It's not too late ? https://www.baumrock.com/rock-monthly/ ?1 point
-
Well.. that might be something, yes! In the end, Repeater Matrix is just an extended form of a Repeater (RepeaterMatrix literally extends Repeater in PHP) and thus might inherit such behaviours too.1 point
-
Hi, @BrendonKoz thanks a lot for your answer ? you know, using templates as i describe in this thread it works and insert divs or tags of all sorts without wrapping them with empty p's before and after hence my wondering ? actually i can do all i want with this template thing but imagine, you write a long post and suddenly realize somme p's would be nice highlited in a box with a background and some nice styles, hop, with this little plugin you can just select them, click and job done i know, i know, just a lazy option ? as you could insert a template and then cut and paste the content you want into it but i like to make my customers' life as easy and obvious as possible, something the createDiv in CKeditor allowed and i tried to reproduce ? not really important but i'm wondering and won't stop searching (probably studying other plugins code, templates for example...) until i find out the right way to do this ? even if, like i said, with the remove empty p option, not really a problem + it's easy to delete those p's even before saving have a nice day Edited to say: funny enough, if i use insertContent instead of setContent it only adds one empty p after the div, curiouser and curiouser ? Edited again to say: i think i understand why the empty p after the inserted div as in tinymce if it's the last thing you insert and want to add a p after it, hitting enter, it will insert a new div, a bit more confusing for people not used to notice it and convert it into a p, just don't know why it doesn't happen with the template plugin but well, mine is ready, i'll probably post it on github ? Edited once more but for good this time ? it's on github in case anyone may need it https://github.com/virtualgadjo/pw-tinymce-div-plugin1 point
-
took me some time today to find out why my page was not showing up... i ended up creating a hook that does what apeisa had in his mind some years ago // set all languages active automatically $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); }); does anybody see any danger in that? i'm not so experienced with multilang yet... edit: somehow it seems that ->setAndSave(...) does NOT work in this situation. @Can or @dragan can you confirm that?1 point