Leaderboard
Popular Content
Showing content with the highest reputation on 11/28/2017 in all areas
-
Hi guys, I published a new article "Why ProcessWire is the best choice for your website (not always, but in most cases)" on my website It is also available in German "Warum ProcessWire die beste Wahl für Ihre Website ist (nicht immer, aber in den meisten Fällen)". Feel free to comment or give me advice on missing things. Cheers Jens10 points
-
I'm writing on a processwire.com guest blogpost arriving on friday. any ideas what i should cover? Building a basic custom admin page Hello World Explanations The manual way Building a module with multiple pages and buttons Hello Page2! Add some HTML (eg buttons) Using internal components (modules) Add external styles and scripts (eg charts) Handling user-input (forms & inputfields) adding your first field: inputfieldmarkup creating a custom form to add pages benefits: structure, render only one field in panel, ajax load Organizing your code and your files module info views any ideas?10 points
-
Hi guys! I've been a bit away from the forums lately but I didn't forget you all (well, I'm not writing much, but visit all the time) Here is our latest site http://www.plateau.studio The design is by Plateau themselves. Some of you will probably recognize "The Weekender" magazine from their portfolio, since we also did their site some time ago https://www.the-weekender.com6 points
-
Forms are an essential part of most websites, and it's no surprise that there's an excellent premium module Form Builder but what if you're on a zero budget for whatever reason? It is possible to build forms quickly and easily by making use of a couple of free modules and the admin UI to give you a great deal of flexibility and speed of development, particularly if you need multiple forms on a website with different fields. 1. First you're going to need to install a couple of modules: Form Template Processor Fieldtype Select External Option 2. For each form that you want to display, create a template without a template file and add fields to it as you normally would. (eg I have formContact, formRegister etc) Tip: under the Advanced tab in the setup for each template, I add a tag Forms so that all my forms templates are nicely grouped together in admin. 3. Create a new field of type Select External Option and call it formTemplate In the section Create options from any database table select templates as the source table id as the Option Value name as the Option Label 4. Create a new template file and call it renderForm.php (or whatever else you like) Add an email field to this form - This will be the email address that forms get submitted to. Add the formTemplate field you previously created to this form. This will allow you to select which of the templates you previously created such as formContact, formRegister etc you want to render. Add any other fields as usual that you want to render on the page. Add the following PHP code to the template file. $recipient = $page->email; $form = $modules->get('FormTemplateProcessor'); $form->template = $templates->get($page->formTemplate->label); // required $form->requiredFields = array('contactName', 'contactEmail', 'contactMesssage'); //Optional: This can be improved by having a field in the page template with a CSV list of required fields eg $form->requiredFields = explode(',', $page->requiredFields) $form->email = $recipient; // optional, sends form as email. FormTemplateProcessor can also save forms to the database. $content .= $form->render(); //generate the form to display. Note: this doesn't actually render the form at this point, but you have it in the $content variable ready to output wherever you want in your template. Add any template HTML or other PHP code and echo $content; wherever you want to render the form. 5. Create a page using the renderForm template, and provide an email address, and select a form that you want to display. 6. Use CSS to style the form as required. 7. View your new page, and check that the form renders correctly. 8. You can modify the templates you created at step 2 or create new ones as required if your requirements for what fields forms display changes. Note: The Form Template Processor module can also save form input as pages, and the FieldType Select External Option can be set up with filtering, so this solution can probably be refined further.6 points
-
I really like the idea and the direction this article takes but there is one thing that ... has some kind of aftertaste. You are writing ProcessWire ist sicher (ProcessWire is safe) and telling people that there are no documented security issues but linking out to a page that tells something different - at first people will only see: Github ... ProcessWire... Issues... Security... security... security... I know about PWs high level of security but even I had to take a much closer look at those issues. Your audience could get this horribly wrong without further explanations as they will not dive deeper into those issues.5 points
-
I am working on an article right now, that covers this topic, it´s called "Why ProcessWire is the best choice for your website (not always, but in most cases)". I hope I can publish it in the next few days. But first it is only available in german and will be translated afterwards (via DeepL and some manual corrections). I will post a link here in the forums, when the article is up.5 points
-
@dragan, you can add the inputfield like this: $wire->addHookAfter('ProcessPageAdd::buildForm', function(HookEvent $event) { $form = $event->return; // If adding page under particular parent if($this->input->parent_id === '1234') { // Add inputfield to form after existing title field // If you name the inputfield the same as the field you want to populate // then the entered value will be saved automatically $f = $this->modules->InputfieldText; $f->name = 'vertec_code'; $f->label = 'Vertec-Code'; $f->required = true; $f->attr('required', 1); // use HTML required attribute too $title_field = $form->getChildByName('title'); $form->insertAfter($f, $title_field); $event->return = $form; } }); Because of this section in ProcessPageAdd::processInput, if you name the inputfield the same as the corresponding field in the template of the new page then the entered value will automatically be saved to the page.4 points
-
v0.0.7 released: Adds support for FieldtypeFieldset, FieldtypeFieldsetGroup and FieldtypeFieldsetTab. @Federico, hopefully this update works for your use case.4 points
-
This case convinced lots of clients over here, but it seems they moved to WordPress unfortunately. Another case of a well known brand is Burger King (at least Poland and Italy) are using ProcessWire.3 points
-
http://eizocolour.com/ https://processwire.com/about/sites/list/eizo-coloredge-living-breathing-colour/ https://www.kairosfuture.com/3 points
-
I'm using it on a few production site (well, everywhere almost :)) and one of my friend too tried it and kinda liked it. Even though I don't feel it's production-ready, I've made many changes during its lifetime so a code cleanup would be necessary. It's currently more admin-oriented, mainly to support multi-language in emails and messages, but everything can be overwritten by code. Adding fields are strictly available via code though. I can add it to github and write some docs to it (currently there's none).3 points
-
Small new feature that some of you may find useful. It is disabled by default so you will need to turn it on in the ProcessWire Info panel config settings section. Goto Page By ID which is available in the PW Info panel: It allows you to enter a page ID and click "View" or "Edit to be taken to the appropriate place. This was requested by a friend who is getting into PW development and I can see it being quite useful on sites where you reference key pages by ID in your template files and want quick access to view/edit them without browsing or typing a full URL, especially when you can't actually remember what pages they actually are3 points
-
That should work fine. I just tested via the Tracy console (injecting into ready.php). There is certainly no need to save the page because you are populating at render(). I don't think it should have anything to do with the name of your function being renderField, but you could try something that doesn't match a core public function. The other thing I would suggest (which I didn't do in the example below, but will work) is to use InputfieldInteger::render just to improve the efficiency a little. Also, try like I have in your ready.php file. The other problem might be that your module isn't installed or isn't being loaded - did you do a Modules > Refresh? Does it show up under the "Modules Loaded" section of the Debug Mode panel in Tracy?3 points
-
Hi guys, I am working on a blogpost to convince customers in doubt that ProcessWire is right for them. The article is almost ready, but first only in german and will be published on my website soon. It will be translated after publishing. One question that would be answered is "You have heard that ProcessWire is relatively unknown or not widely used" and I want to bring up some well-known brands as examples, that are using PW. Right now I have this list, but they are not so well-known: BMW Test Drive BMW Dealersites Die Höhle der Löwen Produkte Maxim Markenprodukte Jentschura´s Regenata KF Interactive Werbeagentur Dojo Werbeagentur FriendChip Verband österreichischer Banken und Bankiers Metasystems Informatiktage Captiva Writer Relocations So, do you know any big names, that use ProcessWire as their CMS?2 points
-
There you can download the module : https://github.com/flydev-fr/Duplicator The documentation is incomplete, you have for now to explore the settings on your own. The install instructions are written but the SDKs are not uploaded yet, which mean that AmazonS3, Dropbox and GoogleDrive are only available by installing them through composer. I will upload them tomorrow but they are not recently tested. Anyway, there is no requirements to run Duplicator as is. Just install Duplicator and Duplicator - Packages Manager then go to Setup > Duplicator and build your package by clicking the button. If everything run smooth, you will see the package listed and you will be able to download it directly and also the installer. To restore a website, just upload the package and the installer then go to yourwebsite.com/installer.php then follow the instructions. PLEASE, do not forget - after the end of the process - to delete the installer.php file and your package (this will be fixed in the v0.0.45). It should work with default theme and the UIkit theme. A dedicated thread will be created in the modules forum soon. Do not hesitate to share here your results by providing your hosting type / provider / config, etc.2 points
-
2 points
-
@netcarver - what about taking this approach instead of those replacements? https://stackoverflow.com/a/22490902/15245762 points
-
Just basic test fields.. sometimes just some basic fields do break something. If I know that you use an email field with the checked option verify email address, it's pretty easy for me to submit a hotfix and exclude it from the counter. Thanks @maxf5 for pointing it out. You don't have to use the prefix at all. All fields which are added by the module will be prefixed – just to make sure the name has not been chosen yet. Please do not rename scf_website and scf_date because they are used for spam tests. The rest is up to you!2 points
-
Awesome! I've just read it (translated by the browser) and you make solid points. Most of these benefits I've experienced first-hand.2 points
-
My boss is pretty well know in the Project Management sector in many countries, and I built his website in PW: https://ricardo-vargas.com/biography/2 points
-
This is an interesting point that could fit very well, thank you. I'll try to include that in my post btw, the first two points are already finished.2 points
-
Hi @bernhard, I like the first two options; Building a custom admin page (your post here, and @abdus tutorial), and Building a module with multiple pages and buttons. They sort of go together from an application point of view. You could incorporate real world examples, such as a help desk ticket system, or polling multiple email providers. I'm thinking more along the lines of how a user would go about creating the components, rather than the actual application itself. For example, let's use a help desk project. Some components would be: a toolbar with options to filter the content listed in an admindatatable by department, assigned person, severity, etc. Currently ProcessWire likes a vertical orientation rather than using the horizontal screen real estate. selecting from the resulting list an item to view greater detail - multiple pages. Abdus touched on this in his tutorial. selecting one or more checkboxes to perform some group action, such as changing the status, or even deleting those entries. periodically polling an endpoint to update the entries in the admindatatable (ajax retrieving new tickets, change of status, etc.) I don't want to make this overly complicated for your article, nor take too much of your time. I just notice that more people are posting about individual parts of similar scenarios and think it would be a great reference for everyone. I certainly appreciate the time you, and others here, are giving to the community. I look forward to whatever article you write on Friday!2 points
-
hey @tpr, any news on your nette forms module (https://processwire.com/talk/topic/2089-create-simple-forms-using-api/?do=findComment&comment=97399) ? i've also worked with nette forms and liked it a lot. a little pw module with some helpers would be great (like setting it to uikit markup, adding a honeypot https://github.com/wodCZ/NetteHoneypot ) i'm happy to collaborate2 points
-
2 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
-
How to install a customized ProcessWire instance in less than a minute All you need is to copy one file to your server, then upload a kickstartfile like this: <?php return [ 'pwurl' => 'https://github.com/processwire/processwire/archive/dev.zip', 'dbName' => 'kick', 'dbUser' => 'kick', 'dbPass' => 'Kix8s08$', ]; and if you want to customize your instance after installation you can create recipe files like this: <?php $this->installModule('TracyDebugger', 'https://github.com/adrianbj/TracyDebugger/archive/master.zip'); $this->installModule('AdminOnSteroids', 'https://github.com/rolandtoth/AdminOnSteroids/archive/master.zip'); $this->installModule('Repeater'); it needs a lot more cleanup and testing but any thoughts and ideas are welcome until i can finish it... BTW: it's not only about saving time - this could also be very helpful to share whole instances for debugging.1 point
-
Most likely the problem is that you already have an image variation at that size that was created with different quality, sharpening, gamma, etc. Settings like that do not form part of the variation file name so you receive the existing variation rather than a new variation being created. I made a wishlist item long ago requesting better handling of this. So you have to clear the image variations, or use the forceNew option in the $options array (just once, then remove it so you are not creating the new variation over and over again).1 point
-
$config->urls->root should usually return "/" Maybe you are looking for $config->urls->httpRoot Or maybe you need to deal with htaccess redirects - in which case, uncomment the lines under section 13 of the .htaccess file.1 point
-
1 point
-
Thanks for the suggestions @Pixrael - I wasn't planning on swapping editors, but I must admit that I do actually like AceEditor (use in Tracy's Console and Template Editor panels). The documentation and API are not great/consistent, but it seems to have the best PHP linting and code completion, at least compared with code mirror. Monaco might be another good option though.1 point
-
..but in case you fork the module, you might want to consider this code editor: https://microsoft.github.io/monaco-editor/index.html https://zengenti.com/en-gb/blog/authors/richard-saunders/from-code-mirror-to-monaco.aspx is the code editor that powers VS Code1 point
-
1 point
-
your math is correct @adrian a simple text field type does the job. Thank you all1 point
-
for that situations I have used https://icecoder.net/ it installs very easily on the website and works perfect.1 point
-
1 point
-
Just updated to fix a side-effect of using the PHP Dom manipulation library - which was wrapping the content with an unwanted DOCTYPE and HTML start and end tags. This is a breaking change - so the version has been updated to 1.0.0.1 point
-
If I understand my math correctly, if it has a leading zero, then it's not an integer anymore. You could just use a text field though1 point
-
Nice article! I shared it on my facebook page. Thanks a lot for linking to my CRM/office tool Sekundenaktuell but admittedly with some performance issues of my datatables module that i have to fix this year...1 point
-
I'm totally fine with using it only via IDE - that's the way I've used it myself too. It's easy, fast and the most flexible solution we can get. Imho the important thing is that it makes forms secure by default and validates on front- and backend. Looking forward to trying the module. I have no specific need right now but I'm sure it will rise up soon. Some kind of quickstart guide would be great! Thanks1 point
-
Looking at the hookable methods in ProcessPageAdd it looks like this would be possible. But what are the circumstances where you would want to do this? Remember that no template for the page has been selected at this point (unless the page is being added under a parent that allows only a single child template) so in general you don't know if a given field is going to be present in the newly saved page. If you can explain a bit more about what you are wanting to do I'll post some example code.1 point
-
Hi @Robin S - it's late here, so need to sleep, but quick questions - is this only a problem for custom "Site" actions? Is it fixed if you save the module config settings page? Let me know and I'll sort it out in the morning.1 point
-
1 point
-
Hi @Martijn Geerts This module does not upgrade cleanly from earlier versions. For instance, in earlier versions the Dependencies field was a textarea with each dependency separated by newline. In more recent versions, JSON data is expected for this field value. So after upgrading the module config page doesn't render properly due to a JS error when attempting to decode the field data. To fix this I have to edit the module config data directly in phpMyAdmin. Could you please add an upgrade() method to the module to translate module config values from earlier versions to the current format?1 point
-
Interesting. @Federico, if you are wanting an integer field that auto-increments across the whole site then there is a module for that: https://modules.processwire.com/modules/integer-auto-increment/ I haven't used it myself.1 point
-
It would be a good idea to fix the typo in the method name... $this->addHooKBefore("Inputfield::render", $this, "renderField"); // should be a lowercase k in addHookBefore ...but surprisingly it seems to work regardless, so probably not the cause of the problem.1 point
-
Yeah, you have the page id correct. Did you try echoing: $settingsPage->id like I suggested? If that works, check other fields on that page and see if somehow it's just the store_hours field.1 point
-
don't forget to sell yourself (and not the system that you are using) find out what your client is looking for and then tell them what you can offer. if they are looking for a quick & cheap wordpress website (they can have good reasons for that), maybe you are not the right person for the job... (and maybe its also better for you to create one great PW site with a great client than 2 cheap websites with 2 not-so-great clients) think of the following 2 approaches and how the client may feel or what the client may hear: or this one: how would you feel? what would you think? maybe in situation one you would feel bad and confused because there is somebody telling you that something that most of the others are using is a bad choice? in situation two you can see instantly how the client reacts: does he want that quick&dirty way? does he want to be like everybody else? same situation but maybe totally different feelings for your client if he asks you for your reasons you know that he is interested (or at least curious). he knows that you are not the quick&dirty guy and he should not feel offended or over-instructed (telling him if he decides like 80% of all others he will regret - actually, when i read that, that sounds really strange and i totally understand my clients ). thanks for all the other input. i'll try to remember some points for future talks. especially yours @Jonathan Lahijani @DaveP thanks for that example. totally valid points too. especially for us as developers. but think of that in context of my first quote. that may create the total opposite message in your clients head: ah, this guy is a nerd. he speaks a language i don't understand and talks about things most other website owners obviously don't care about...1 point
-
thanks again for this awesome field! if anybody needs excel-like tables this is easily possible like this (startingpoint): create a folder like /site/modules/HandsonTable copy https://github.com/handsontable/handsontable to this folder create a runtime field with this content: return wireRenderFile('../modules/HandsonTable/HandsonTable.php'); create your php-file /site/modules/HandsonTable/HandsonTable.php <?php $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/moment/moment.js"); $config->scripts->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.js"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/handsontable.full.css"); $config->styles->append($config->urls->siteModules . "HandsonTable/handsontable/dist/pikaday/pikaday.css"); ?> <div id="example"></div> <script> var data = [ ["", "Ford", "Volvo", "Toyota", "Honda"], ["2016", 10, 11, 12, 13], ["2017", 20, 11, 14, 13], ["2018", 30, 15, 12, 13] ]; var container = document.getElementById('example'); var hot = new Handsontable(container, { data: data, rowHeaders: true, colHeaders: true }); </script> moment and pickaday are not needed in this example and just as a showcase and reminder... It get's a little more complicated if you need storing/editing features but i need it only to show some data and my client can copy/paste data to excel/google drive sheets.1 point
-
I can only support @tpr. nette/forms is a really nice package if you don't need a UI. With some upfront time you can really cater the markup to your needs and it'll still be easy/fast to configure new forms. But probably the best part of it is the one-time config for server and client side validation, which is even extendible even though I never needed to add anything. It doesn't come with so many prebuild sets of fields as alpaca forms (I've even seen table editing ), but I've added a few custom Inputfields to my nette/forms installation and it's not to hard to do.1 point
-
Nette Forms: I have a very beta module of it. It doesn't have a UI to build forms and I don't plan to add such so it may not suit for everyone. I can send a copy to check, though as I wrote it's not quite ready for production.1 point