Leaderboard
Popular Content
Showing content with the highest reputation on 12/07/2020 in all areas
-
Hi everyone, I have released a few PHP 8 fixes over the last week or so, but today's was the biggest with an update to the Adminer core. Unfortunately the automatic login feature of Adminer seems to have been broken for quite some time now, which is why I haven't upgraded it in a while, but now with the need to support PHP 8, I didn't really have much choice. I have managed to implement a hacky way to make the automatic login still work but I'd appreciate feedback on whether you are having any problems with this please. I have of course contacted the Adminer developer about the issue (via the forum because there is no Github issues option ? ) but it's been mentioned by others as well, so not sure what's going on. Anyway, hopefully my hacky way will be seamless enough. PS - not sure what others think, but the context aware Adminer panel is one of the features I use most in Tracy.4 points
-
This week we’ll take a brief look at a powerful new ProFields module for ProcessWire that’s just around the corner—the Combo field: https://processwire.com/blog/posts/about-the-new-processwire-profields-combo-field/3 points
-
ServerPilot is a cool service and deserve a word here. I know this service because of @Macrura and I never get out. Thanks dude ! You buy a dedicated server, attach it to ServerPilot and you get your server up in minutes, he will get updated without any intervention. You will get the right stuff, updated with every last software and dependencies version, patched, without "any" security hole. I even some at the start tried to hack the server with no luck, I had to make a vulnerability myself to get into ? no really you get all needed architecture, like app isolation and more with security in mind. And if you know what your are doing, you can install any software you want, do any ninja command or add any config through SSH. You will also like their support lol, full of experienced geeks veterans. That's all, this was my 10$ spam for today ?3 points
-
Hi everyone! This services have popped around in conversations around the forum and wanted to give it its own topic to share some experiences with these services. I have personally used Runcloud and I am happy with it, specially with their support which is most of the time really fast. But feature wise Ploi seems to be really far ahead features wise and I really wish for a lot of their stuff like load balancer, the backup system, db servers, etc.2 points
-
@matjazp @adrian Looks like we've got a glitch there. Not sure what's up yet, but it seems to be in the old modules directory data and may have been there awhile. Matjazp had 2 accounts somehow and tpr/rolandtoth had none. I added rolandtoth as an author and updated the modules pointing to his GitHub account. I deleted the 2nd matjazp account (matjaz-potocnik) and reassigned those modules to the matjazp account. Let me know if I didn't get any of this right. So far it looks like there is the only case of the glitch, I couldn't find any others like it, though please let me know if you do. By the way, module author names were pulled from the info entered when the module is submitted or edited (on the old modules directory site). They are not pulled from the module info on GitHub. On the new site, module author names are created with the account, and assigned to existing modules sharing the same confirmed email address. That's how it knows which modules are yours after you create your account. Some people might have used multiple emails over time, as I think both Teppo and I did, so in those cases I've been assigning some modules manually. Currently for new modules it just supports one "author", since it is now tied to a dedicated account. (Just like with a GitHub account). So when there are multiple authors on a new submitted module then the README is where you'd want to highlight that. It would also be fine to have an organization or company as the author of course, but it would still just be 1 account.2 points
-
Sounds like a plan! I'd start asking if you have enough understanding on how "routing" in processwire works as well as template/fields concept and how they relate to pages. With that said, I'll try to quickly illustrate an example: This is definitely a way you can add content using the API. Let's assume you have a template named "new-product", and a page "New Product" with said template under Home page. You end up with a page tree like this: Home -- New product -- Products --- Product 1 --- Product 2 This page doesn't need to have fields, it's just a place (a route) to handle code with /site/templates/new-product.php template file, which is automagically assigned to every page with the template "new-product". Here is some sample code that would live on that template. if($input->post->submit){ //Do stuff like sanitizing and validation, very important // Some basic page creation saving would look like this $newPage = new Page(); $page->template = "product"; $page->parent = $pages->get('template=products'); $page->title = $sanitizedTitle // This comes from the imaginary code above $page->save(); } else{ //Do the form rendering however you want. } This way user arrive to /new-product/, submits a form, and you handle the page creation right there. As you can see, products get a parent page, which is the page called Products, where I'm also assuming it has a template named "products", it is another tempalte without any required fields in the current context, it just handles the organization of the products. You would end with each product under: /products/product-1 /products/product-2 Last but not least, FormBuilder pro module handles the form-to-page process basically out of the box.2 points
-
@kongondo thanks for your reply, I did as you mentioned but it didn't help. Although after some fresh air I went back and check the moduleInfo's requires parameters and it turned out that was what created the error, works smoothly now! ?2 points
-
Hey everyone, I did a lot of refactoring of PrivacyWire this weekend - both for the backend and frontend. The Javascript core of PrivacyWire is nearly completely rewritten in ES6. This results in much better readability and of course extensibility. For examle, as asked by @Torsten Baldes, one can now manually trigger to refresh the element detection of PrivacyWire by simple running the following function afterwards: window.PrivacyWire.refresh(); You'll find a brief overview of the updates here: https://github.com/blaueQuelle/privacywire/blob/es6/CHANGELOG.md#101b-beta Right now this update is in an separate branch at github: https://github.com/blaueQuelle/privacywire/tree/es6 I would be happy if some of you could test this version in your dev environment. If you haven't used any hooks or modifications, it should just run without any changes. I'm looking forward to your feedback! ? Best, Joshua2 points
-
Hi everyone, Here's a new module that I have been meaning to build for a long time. http://modules.processwire.com/modules/process-admin-actions/ https://github.com/adrianbj/ProcessAdminActions What does it do? Do you have a bunch of admin snippets laying around, or do you recreate from them from scratch every time you need them, or do you try to find where you saw them in the forums, or on the ProcessWire Recipes site? Admin Actions lets you quickly create actions in the admin that you can use over and over and even make available to your site editors (permissions for each action are assigned to roles separately so you have full control over who has access to which actions). Included Actions It comes bundled with several actions and I will be adding more over time (and hopefully I'll get some PRs from you guys too). You can browse and sort and if you have @tpr's Admin on Steroid's datatables filter feature, you can even filter based on the content of all columns. The headliner action included with the module is: PageTable To RepeaterMatrix which fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. This is a huge timesaver if you have an existing site that makes heavy use of PageTable fields and you would like to give the clients the improved interface of RepeaterMatrix. Copy Content To Other Field This action copies the content from one field to another field on all pages that use the selected template. Copy Field Content To Other Page Copies the content from a field on one page to the same field on another page. Copy Repeater Items To Other Page Add the items from a Repeater field on one page to the same field on another page. Copy Table Field Rows To Other Page Add the rows from a Table field on one page to the same field on another page. Create Users Batcher Allows you to batch create users. This module requires the Email New User module and it should be configured to generate a password automatically. Delete Unused Fields Deletes fields that are not used by any templates. Delete Unused Templates Deletes templates that are not used by any pages. Email Batcher Lets you email multiple addresses at once. Field Set Or Search And Replace Set field values, or search and replace text in field values from a filtered selection of pages and fields. FTP Files to Page Add files/images from a folder to a selected page. Page Active Languages Batcher Lets you enable or disable active status of multiple languages on multiple pages at once. Page Manipulator Uses an InputfieldSelector to query pages and then allows batch actions on the matched pages. Page Table To Repeater Matrix Fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. Template Fields Batcher Lets you add or remove multiple fields from multiple templates at once. Template Roles Batcher Lets you add or remove access permissions, for multiple roles and multiple templates at once. User Roles Permissions Batcher Lets you add or remove permissions for multiple roles, or roles for multiple users at once. Creating a New Action If you create a new action that you think others would find useful, please add it to the actions subfolder of this module and submit a PR. If you think it is only useful for you, place it in /site/templates/AdminActions/ so that it doesn't get lost on module updates. A new action file can be as simple as this: <?php namespace ProcessWire; class UnpublishAboutPage extends ProcessAdminActions { protected function executeAction() { $p = $this->pages->get('/about/'); $p->addStatus(Page::statusUnpublished); $p->save(); return true; } } Each action: class must extend "ProcessAdminActions" and the filename must match the class name and end in ".action.php" like: UnpublishAboutPage.action.php the action method must be: executeAction() As you can see there are only a few lines needed to wrap the actual API call, so it's really worth the small extra effort to make an action. Obviously that example action is not very useful. Here is another more useful one that is included with the module. It includes $description, $notes, and $author variables which are used in the module table selector interface. It also makes use of the defineOptions() method which builds the input fields used to gather the required options before running the action. <?php namespace ProcessWire; class DeleteUnusedFields extends ProcessAdminActions { protected $description = 'Deletes fields that are not used by any templates.'; protected $notes = 'Shows a list of unused fields with checkboxes to select those to delete.'; protected $author = 'Adrian Jones'; protected $authorLinks = array( 'pwforum' => '985-adrian', 'pwdirectory' => 'adrian-jones', 'github' => 'adrianbj', ); protected function defineOptions() { $fieldOptions = array(); foreach($this->fields as $field) { if ($field->flags & Field::flagSystem || $field->flags & Field::flagPermanent) continue; if(count($field->getFieldgroups()) === 0) $fieldOptions[$field->id] = $field->label ? $field->label . ' (' . $field->name . ')' : $field->name; } return array( array( 'name' => 'fields', 'label' => 'Fields', 'description' => 'Select the fields you want to delete', 'notes' => 'Note that all fields listed are not used by any templates and should therefore be safe to delete', 'type' => 'checkboxes', 'options' => $fieldOptions, 'required' => true ) ); } protected function executeAction($options) { $count = 0; foreach($options['fields'] as $field) { $f = $this->fields->get($field); $this->fields->delete($f); $count++; } $this->successMessage = $count . ' field' . _n('', 's', $count) . ' ' . _n('was', 'were', $count) . ' successfully deleted'; return true; } } This defineOptions() method builds input fields that look like this: Finally we use $options array in the executeAction() method to get the values entered into those options fields to run the API script to remove the checked fields. There is one additional method that I didn't outline called: checkRequirements() - you can see it in action in the PageTableToRepeaterMatrix action. You can use this to prevent the action from running if certain requirements are not met. At the end of the executeAction() method you can populate $this->successMessage, or $this->failureMessage which will be returned after the action has finished. Populating options via URL parameters You can also populate the option parameters via URL parameters. You should split multiple values with a “|” character. You can either just pre-populate options: http://mysite.dev/processwire/setup/admin-actions/options?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add or you can execute immediately: http://mysite.dev/processwire/setup/admin-actions/execute?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add Note the “options” vs “execute” as the last path before the parameters. Automatic Backup / Restore Before any action is executed, a full database backup is automatically made. You have a few options to run a restore if needed: Follow the Restore link that is presented after an action completes Use the "Restore" submenu: Setup > Admin Actions > Restore Move the restoredb.php file from the /site/assets/cache/AdminActions/ folder to the root of your site and load in the browser Manually restore using the AdminActionsBackup.sql file in the /site/assets/cache/AdminActions/ folder I think all these features make it very easy to create custom admin data manipulation methods that can be shared with others and executed using a simple interface without needing to build a full Process Module custom interface from scratch. I also hope it will reduce the barriers for new ProcessWire users to create custom admin functionality. Please let me know what you think, especially if you have ideas for improving the interface, or the way actions are defined.1 point
-
Admin Theme Canvas A minimal admin theme with optimised page editor UI, based on Uikit 3. Currently this is close to stable, but users are advised to be cautious and test thoroughly. This theme is tested in all major Browsers including IE 11, Edge (>85), Chrome (>85), Firefox (>81), Safari (>11). If you find any bugs or have ideas for improvements, feel free to post your feedback. Download from Github Download from Modules Page Features Minimal black and white admin theme Fixed masthead navigation Direct access to page tree navigation inside page dropdown Less distraction for editors (when editing a page, the tabs are displayed as a dropdown menu inside the main navigation) Options to customise the ui Less distraction for editors Direct access to page tree navigation inside dropdown Page tree Options to customise the ui Login (inspired by AdminThemeBoss) Requirements Process Wire 3.0.100 or greater Installation Go to “Modules > Site > Add New“ Paste the Module Class Name “AdminThemeCanvas“ into the field “Add Module From Directory“ Click “Download And Install“ On the overview, click “Download And Install“ again… On the following screen, click “Install Now“ Go to your user profile page and change the theme to Admin Theme Canvas1 point
-
Announcing the current status, planned release, roadmap and preview of Padloper 2. Status Feature freeze. Full multilingual support. Only PHP 7.2+ supported. Support for ProcessWire 3.0 only. Backend support for modern browsers only (that support JavaScript ES6 modules). Current Work Finish work on admin/backend. Work on installer and uninstaller (including configurable availability of some features). Work on UI/UX improvements. Start work on documentation with special focus on technical documentation. Continue work on Padloper API and data/model component. Roadmap Please note that these ARE NOT hard and fast targets. The roadmap may have to be adjusted to accommodate technical and non-technical constraints. Q1 2021 Inbuilt support for (latest) PayPal (full rewrite, no external modules required). Additional work on Padloper API. Invite a limited number of early alpha testers (fully-priced product). Soft and closed release of Padloper 2. Q2 2021 Start work on relaunch of Padloper website. Inbuilt support for Stripe (no external modules required). Future Plans Support for more Payment Gateways. Support for order, customers, etc imports and exports. Support for AdminThemeReno and AdminThemeDefault. Separate fully-featured frontend shop module. Consider support for multiple currencies. FAQ 1. Have you abandoned this project? No. 2. When will Padloper 2 be released? First early alpha release is scheduled for Q1 2021. This target may change depending on circumstances! Access will be by invite only for this first release. 3. What is the pricing model of Padloper 2? Three licences: Single Site, Developer and Agency licences (12 months’ updates and VIP support). 4. How much will Padloper 2 Cost? No price has been set yet. It will cost more than Padloper 1. 5. Can we upgrade from Padloper 1? No. 6. Will existing users of Padloper 1 get a discount for Padloper 2? No, this will not be possible. Apologies for the earlier announcement. It was unrealistic and unworkable. 7. Can we pay for Padloper 2 in advance? No. 8. Does Padloper 2 render markup/templates in the frontend? No. Access to all data you need to build your shop’s frontend is via the Padloper API. 9. Can we keep sending you ‘Are we there yet’ messages? No, please. Preview Here is a video preview of the current state of the backend/admin of Padloper 2. Please note the following: This is early alpha. There are bugs! It even includes WIP/notes!! FOUC, misaligned things, etc. The video shows the near-raw implementation of Vuetify UI. The UI/UX improvements work is yet to start. What you see here is the development version. Some of the incomplete features may not be available in the early releases. Most of the features you see will be optional to install.1 point
-
There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new. While last week's post introduced the modules directory, this post (part 2) focuses on newly added features for module authors (just pushed live today)— https://processwire.com/blog/posts/new-processwire-modules-directory/1 point
-
This is really nice to know! I actually have a ServerPilot account from when they had their free tier, quite a few years ago and it's still running my first pet project with ProcessWire, getting 100k-200k sessions a month on a 5USD Vultr VPS.1 point
-
@adrian Thanks, I have fixed it so it'll update the "updated" date when either the version number, or anything in the module info changes.1 point
-
@Max Allan Niklasson, Welcome to the forums. I just had a quick look but you are basically caught in an infinite loop with all those includes. You have this: In MarkupBodyBuilder.module <?php public function init() { include_once __DIR__ . "/vendor/autoload.php"; include_once __DIR__ . "/BodyBuilder.module";// <==== THIS $this->addHookAfter("Fields::save", $this, 'hookWhenFieldSaved'); $this->addHookAfter("Field::getInputfield", $this, 'hookHideTitle'); $this->addHookAfter('Page::renderField', $this, 'hookRenderField'); $this->twig = new Environment(new ArrayLoader(), [ 'autoescape' => false, 'debug' => $this->config->debug ]); $this->twig->addExtension(new DebugExtension()); return parent::init(); } In ProcessBodyBuilder.module <?php public function init() { include_once __DIR__ . "/BodyBuilder.module";// <==== THIS $process = $this->wire('process'); if ("$process" === "$this") { $this->headline($this->moduleInfo['page']['title']); } return parent::init(); } In BodyBuilder.module <?php namespace ProcessWire; use Exception; include_once "MarkupBodyBuilder.module";// <== THIS include_once "ProcessBodyBuilder.module";// <== THIS That is not how you reference other installed modules in ProcessWire; Call them like this where you need them: <?php // inside a class $bodyBuilder = $this->wire('modules')->get('BodyBuilder'); // outside a class // $bodyBuilder = $modules->get('BodyBuilder'); // outside a class but inside a function // $bodyBuilder = wire('modules')->get('BodyBuilder'); More info https://processwire.com/api/ref/module/1 point
-
Lighthouse results for home page. Best practices & speed pulled down by annoying chat applet (forgot to mention that js - not my code or choice). Not sure of server spec. Shared hosting account. So, not under 100ms in this scenario but I'm happy when Google is happy ? Thanks for the tip. Will get image from client ?1 point
-
Thanks for the new module @ryan, it sounds great! Could you say something about any potential downsides to this way of storing field data? E.g. situations where it wouldn't be optimal to use it. Or to put the question another way: why isn't all field data for every template stored this way by default in PW?1 point
-
ProcessWire 3.0.169 contains 19 commits relative to 3.0.168, and most are focused on improvements and minor fixes throughout the core. For more details see the dev branch commit log. This week I’ve also been working quite a bit on a new ProFields module that at the moment is called Combo. It contains both Fieldtype and Inputfield modules within it, and I’ll have more to tell you about it soon. But I can say that it fits right in with the purpose of ProFields, which is: greatly reduce the number of fields needed to accomplish a particular need. And it does so in a way that isn’t easily achieved with any other module at present, so I think it’ll be a nice addition. The Inputfield part of it can also be used independently of the Fieldtype, meaning you could use it in FormBuilder forms, etc. I’ve got to keep it short today because of the Thanksgiving holidays here in the US (my wife is off work and kids have no classes today). Thanks for reading and have a great weekend!1 point
-
Hi Chris, just want to thank you for the module - saved me some time - works very well. Thumbs up! ? cheers Simon1 point
-
I'm not sure exactly what you're trying to do, so I'm guessing here, but it sounds as if you might need to set output formatting to false before doing it. Useful posts: There are many textformatters available at https://processwire.com/modules/category/textformatter/, and it's quite easy to write your own if necessary.1 point
-
Apologies guys, I seem to have skipped 0.6.0, which was sitting on develop for quite some time. That's fine though, because if there are no issues, I'd like to bump it to v1.0. Given that it's not there yet, I've marked the module as Beta. If anyone does bump into funny stuff, let me know and I'll get it sorted as soon as I can.1 point
-
1 point
-
Thanks for your input, i changed my code and this should be working fine now: if(!$session->get('setLang')) { if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2) != 'de') { $session->set('setLang','1'); $url = $page->localUrl('en'); $session->redirect($url); } $session->set('setLang','1'); } if i'm correct, the problem was, that when my user clicks the link to /de/team/member-name and has an english browser, the domain wouldnt change, but all the contents were in the right language. now i'm using a _real_ redirect, causing even a crawler, calling upon /de/team/member-name to get to /en/team/member-name i really need the automatic redirection for non-germans, is this a proper way? Thanks1 point
-
So with all the love I have for ProcessWire page labels have always been a little less awesome than I hoped. Say like in the Skyscrapers profile you want to show the height of the tower along side the tower name, the output will end up something like: Cool Tower Name, 780 To me this just isn't good enough and doesn't always offer a lot of value to the end-user/client, so I made "PageListBetterLabels". Which gives you the power to output something like this: That there is done with this (as the setting for "List of fields to display in the admin page list" setting under advanced): images title height --ft -tall floors -floors Opened- In- the- year- year How it works anything that starts or ends with a dash does not get processed as a page field anything with the dash(s) at the beginning gets appended to the field before it anything with the dash(s) at the end gets prepended to the field after it (I hope this makes sense) one dash means leave a space, two means don't I used Soma's PageListImageLabel module as a starting point for supporting Image labels in this module, so a big thanks goes out to him and his wonderful work (I simplified the options in my implementation, to get things up and running). I mostly added this feature as I assumed the two would not work together, I may be wrong though. I will add this to the modules directory, right now I need to pick up my Wife from work. DOWNLOAD1 point
-
I found Janko's FormToWizard code to be one of the simplest ways to implement a multi-page/multi-slide form. Now with the Processwire this just got easier. I tweaked his script a wee bit to work with the API forms described in this thread. PWformToWizard.js bunching your fields into fieldsets just as Ryan described above, each fieldset will become a page/slide. Instead using the <legend> tag that Janko uses, the script now generates a legend based on the label, specifically anything that comes before a colon ':' first add the script: <script type="text/javascript" src="PWformToWizard.js"></script> then use this javascript to initiallize formToWizard: $("#SignupForm").formToWizard(); the default styles are: <style type="text/css"> body { font-family:Lucida Sans, Arial, Helvetica, Sans-Serif; font-size:13px; margin:20px;} #main { width:960px; margin: 0px auto; border:solid 1px #b2b3b5; -moz-border-radius:10px; padding:20px; background-color:#f6f6f6;} #header { text-align:center; border-bottom:solid 1px #b2b3b5; margin: 0 0 20px 0; } fieldset { border:none; width:320px;} legend { font-size:18px; margin:0px; padding:10px 0px; color:#b0232a; font-weight:bold;} label { display:block; margin:15px 0 5px;} input[type=text], input[type=password] { width:300px; padding:5px; border:solid 1px #000;} .prev, .next { background-color:#b0232a; padding:5px 10px; color:#fff; text-decoration:none;} .prev:hover, .next:hover { background-color:#000; text-decoration:none;} .prev { float:left;} .next { float:right;} #steps { list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;} #steps li {font-size:24px; float:left; padding:10px; color:#b0b1b3;} #steps li span {font-size:11px; display:block;} #steps li.current { color:#000;} #makeWizard { background-color:#b0232a; color:#fff; padding:5px 10px; text-decoration:none; font-size:18px;} #makeWizard:hover { background-color:#000;} </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script type="text/javascript" src="formToWizard.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#SignupForm").formToWizard({ submitButton: 'SaveAccount' }) }); </script> see janko's page for more info~ Now, just to add some responsive jquery validation to each 'next' button...1 point