Leaderboard
Popular Content
Showing content with the highest reputation on 03/27/2017 in all areas
-
Just added a new "Clear Session & Cookies" button in the ProcessWire Info panel: It's the new reset/reload looking icon. This will log you out and back in again, clear all cookies for the domain, and return you to the same URL you were on (along with the full query string). I have been finding this very handy with module development when it is manipulating parts of the admin that are cached (like menus etc), but it can also be handy for example when you change an Images field's "Default image grid mode" setting because you need to clear cookies to see these changes. I am sure you'll find other uses as well.4 points
-
$user = $users->get("email=".$input->post->email('email')); this will email sanitize the email input field value combining WireInput and WireSanitizer ;-)3 points
-
You can hook before ProcessLogin::executeLogout and set the desired url. <?php wire()->addHookBefore("ProcessLogin::executeLogout", null, "setRedirect"); function setRedirect(HookEvent $event) { $event->object->setLogoutURL($pages->get('/')->httpUrl); }3 points
-
Just so you don't miss them; there are sorting functions in the dev version of 3.0: https://github.com/processwire/processwire/blob/4ca684df83db90aa6cfe5a76ef7a830b399af721/wire/core/Pages.php#L841-L9163 points
-
You mean the web service tinyjpg.com? Never heard of it before. Compressed with TinyJPG (87 kb) But I think this web service is using lossy compression. At least I couldn't find a clear statement on their website. So this web service is out of question for me, because I am only looking for loseless ways to compress images. But I might be wrong. I don't think so. Looking into the developer tools, I see no difference to my original images. Here an interesting post about tests with Guetzli: https://www.34sp.com/blog/speed-testing-googles-guetzli-jpeg-encoder/2 points
-
@szabesz @pwired : Sorry for the late response. Been very busy with a deadline that inevitably dragged on and on ... For those who are interested, I've got the following for automating my deployment. By all means, it's not perfect nor is it complete but it does the job with a minimal investment of my time. I have structured my DB scripts into 2 categories. The dump_<xxx> scripts and the restore_<yyy2zzz> scripts. The dump scripts are to dump the DB contents as a whole where <xxx> signifies an identifier to the DB you're dumping (e.g. Dev, UAT, Live etc). So my dump_local.sh script looks like #!/bin/bash _now=$(date +"%Y%m%d") _file="../dumps/Dump$_now-LOCAL.sql" echo "Starting Dump to $_file..." /Applications/MAMP/Library/bin/mysqldump -h localhost -P 8889 -u root -p'PasswordHereWithTheQuotes' --single-transaction [DBNAME] "$_file" echo "Dump to $_file finished" Key things to note here is : 1) 1st line of code generates a datestamp 2) It then creates a path of the dump file in the dump folder 3) Then it calls MySQLDump using the predefined parameters. Obviously this is for my local installation, so for a server dump file you'll want to change the dump suffix (from LOCAL to DEV,UAT,LIVE or whatever), the hostname, user, password, port (which will be different to 8889 most likely. Mine is 3306 on our service provider) and DBName. If you;re wondering what the single transaction flag is ... The restore files are similar except for my scripts, I've chosen to do a specific one for each XXX2YYY variation. Not the most efficient, but I'm not a bash script ninja either. XXX being Source, YYY being destination in case your'e wondering. So my restore_local2dev.sh looks like : #!/bin/bash _now=$(date +"%Y%m%d") _file="../Dumps/Dump$_now-LOCAL.sql" echo "Starting restoring from $_file to dev ..." /Applications/MAMP/Library/bin/mysql -h [HostDBServerAddress] -P [HostDBServerPort] -u [HostDBUserLogin] -p'[HostDBUserPwdInSingleQuotes]' [HostDBName] < "$_file" echo "Restoring from $_file to dev finished" Notes : 1) I'm using mysql instead of mysqldump here 2) I'm assuming you already created a dump today of the DB file you're uploading (line 2 & 3) 3) There's a bit more involved here with the parameters but I hope the long descriptive labels are self explanatory. Feel free to contact me on this forum if you're unsure. By all means these should cover the basics that you need. Things to improve upon are obviously in the security side of things. There's -ssl options and SSL certificate options that I haven't looked in at detail. If anyone is using them and willing to give us a quick primer ....2 points
-
@k07n Thanks for the examples, i just pushed a commit to the master branch implementing this (version 1.0.2). Cheers2 points
-
Database errors are always logged. You will find entry in your /site/assets/logs/errors.txt file 2017-03-18 16:05:27 ? http://example.org/?/ Error: Exception: SQLSTATE[HY000] [1049] Unknown database 'example' (in .../wire/core/ProcessWire.php line 375) Depending on your config.php settings an Email will be sent /** * Admin email address * * Optional email address to send fatal error notifications to. * * #input email * @var string * */ $config->adminEmail = ''; In case of fatal errors the following html file will be send <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>{message}</p> </body> </html> You can modify it. You'll find the file (default installation) in /site/templates/errors/500.html2 points
-
I have had this module sitting in a 95% complete state for a while now and have finally made the push to get it out there. Thanks to @teppo for his Hanna Code Helper module which I referred to and borrowed from during development. http://modules.processwire.com/modules/hanna-code-dialog/ https://github.com/Toutouwai/HannaCodeDialog HannaCodeDialog Provides a number of enhancements for working with Hanna Code tags in CKEditor. The main enhancement is that Hanna tags in a CKEditor field may be double-clicked to edit their attributes using core ProcessWire inputfields in a modal dialog. Requires the Hanna Code module and >= ProcessWire v3.0.0. Installation Install the HannaCodeDialog module using any of the normal methods. For any CKEditor field where you want the "Insert Hanna tag" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "HannaDropdown" to the "CKEditor Toolbar" settings field. Module configuration Visit the module configuration screen to set any of the following: Exclude prefix: Hanna tags named with this prefix will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Exclude Hanna tags: Hanna tags selected here will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Background colour of tag widgets: you can customise the background colour used for Hanna tags in CKEditor if you like. Dialog width: in pixels Dialog height: in pixels Features Insert tag from toolbar dropdown menu Place the cursor in the CKEditor window where you want to insert your Hanna tag, then select the tag from the "Insert Hanna tag" dropdown. Advanced: if you want to control which tags appear in the dropdown on particular pages or templates you can hook HannaCodeDialog::getDropdownTags. See the forum support thread for examples . Edit tag attributes in modal dialog Insert a tag using the dropdown or double-click an existing tag in the CKEditor window to edit the tag attributes in a modal dialog. Tags are widgets Hanna tags that have been inserted in a CKEditor window are "widgets" - they have a background colour for easy identification, are protected from accidental editing, and can be moved within the text by drag-and-drop. Options for tag attributes may be defined You can define options for a tag attribute so that editors must choose an option rather than type text. This is useful for when only certain strings are valid for an attribute and also has the benefit of avoiding typos. Add a new attribute for the Hanna tag, named the same as the existing attribute you want to add options for, followed by "__options". The options themselves are defined as a string, using a pipe character as a delimiter between options. Example for an existing attribute named "vegetables": vegetables__options=Spinach|Pumpkin|Celery|Tomato|Brussels Sprout|Potato You can define a default for an attribute as normal. Use a pipe delimiter if defining multiple options as the default, for example: vegetables=Tomato|Potato Dynamic options Besides defining static options as above, you can use one Hanna tag to dynamically generate options for another. For instance, you could create a Hanna tag that generates options based on images that have been uploaded to the page, or the titles of children of the page. Your Hanna tag that generates the options should echo a string of options delimited by pipe characters (i.e. the same format as a static options string). You will probably want to name the Hanna tag that generates the options so that it starts with an underscore (or whatever prefix you have configured as the "exclude" prefix in the module config), to avoid it appearing as an insertable tag in the HannaCodeDialog dropdown menu. Example for an existing attribute named "image": image__options=[[_images_on_page]] And the code for the _images_on_page tag: <?php $image_names = array(); $image_fields = $page->fields->find('type=FieldtypeImage')->explode('name'); foreach($image_fields as $image_field) { $image_names = array_unique( array_merge($image_names, $page->$image_field->explode('name') ) ); } echo implode('|', $image_names); Choice of inputfield for attribute You can choose the inputfield that is used for an attribute in the dialog. For text attributes the supported inputfields are text (this is the default inputfield for text attributes so it isn't necessary to specify it if you want it) and textarea. Note: any manual line breaks inside a textarea are removed because these will break the CKEditor tag widget. Inputfields that support the selection of a single option are select (this is the default inputfield for attributes with options so it isn't necessary to specify it if you want it) and radios. Inputfields that support the selection of multiple options are selectmultiple, asmselect and checkboxes. You can also specify a checkbox inputfield - this is not for attributes with defined options but will limit an attribute to an integer value of 1 or 0. The names of the inputfield types are case-insensitive. Example for an existing attribute named "vegetables": vegetables__type=asmselect Descriptions and notes for inputfields You can add a description or notes to an attribute and these will be displayed in the dialog. Example for an existing attribute named "vegetables": vegetables__description=Please select vegetables for your soup. vegetables__notes=Pumpkin and celery is a delicious combination. Notes When creating or editing a Hanna tag you can view a basic cheatsheet outlining the HannaCodeDialog features relating to attributes below the "Attributes" config inputfield. Advanced Define or manipulate options in a hook You can hook HannaCodeDialog::prepareOptions to define or manipulate options for a Hanna tag attribute. Your Hanna tag must include a someattribute__options attribute in order for the hook to fire. The prepareOptions method receives the following arguments that can be used in your hook: options_string Any existing string of options you have set for the attribute attribute_name The name of the attribute the options are for tag_name The name of the Hanna tag page The page being edited If you hook after HannaCodeDialog::prepareOptions then your hook should set $event->return to an array of option values, or an associative array in the form of $value => $label. Build entire dialog form in a hook You can hook after HannaCodeDialog::buildForm to add inputfields to the dialog form. You can define options for the inputfields when you add them. Using a hook like this can be useful if you prefer to configure inputfield type/options/descriptions/notes in your IDE rather than as extra attributes in the Hanna tag settings. It's also useful if you want to use inputfield settings such as showIf. When you add the inputfields you must set both the name and the id of the inputfield to match the attribute name. You only need to set an inputfield value in the hook if you want to force the value - otherwise the current values from the tag are automatically applied. To use this hook you only have to define the essential attributes (the "fields" for the tag) in the Hanna Code settings and then all the other inputfield settings can be set in the hook. Example buildForm() hook The Hanna Code attributes defined for tag "meal" (a default value is defined for "vegetables"): vegetables=Carrot meat cooking_style comments The hook code in /site/ready.php: $wire->addHookAfter('HannaCodeDialog::buildForm', function(HookEvent $event) { // The Hanna tag that is being opened in the dialog $tag_name = $event->arguments(0); // Other arguments if you need them /* @var Page $edited_page */ $edited_page = $event->arguments(1); // The page open in Page Edit $current_attributes = $event->arguments(2); // The current attribute values $default_attributes = $event->arguments(3); // The default attribute values // The form rendered in the dialog /* @var InputfieldForm $form */ $form = $event->return; if($tag_name === 'meal') { $modules = $event->wire('modules'); /* @var InputfieldCheckboxes $f */ $f = $modules->InputfieldCheckboxes; $f->name = 'vegetables'; // Set name to match attribute $f->id = 'vegetables'; // Set id to match attribute $f->label = 'Vegetables'; $f->description = 'Please select some vegetables.'; $f->notes = "If you don't eat your vegetables you can't have any pudding."; $f->addOptions(['Carrot', 'Cabbage', 'Celery'], false); $form->add($f); /* @var InputfieldRadios $f */ $f = $modules->InputfieldRadios; $f->name = 'meat'; $f->id = 'meat'; $f->label = 'Meat'; $f->addOptions(['Pork', 'Beef', 'Chicken', 'Lamb'], false); $form->add($f); /* @var InputfieldSelect $f */ $f = $modules->InputfieldSelect; $f->name = 'cooking_style'; $f->id = 'cooking_style'; $f->label = 'How would you like it cooked?'; $f->addOptions(['Fried', 'Boiled', 'Baked'], false); $form->add($f); /* @var InputfieldText $f */ $f = $modules->InputfieldText; $f->name = 'comments'; $f->id = 'comments'; $f->label = 'Comments for the chef'; $f->showIf = 'cooking_style=Fried'; $form->add($f); } }); Troubleshooting HannaCodeDialog includes and automatically loads the third-party CKEditor plugins Line Utilities and Widget. If you have added these plugins to your CKEditor field already for some purpose and experience problems with HannaCodeDialog try deactivating those plugins from the CKEditor field settings.1 point
-
Hi, I have created a site profile that shows how to integrate ProcessWire 3.0 with Vue 2.0. See repository here. How this site profile works This ProcessWire site profile is loosely based on the REST API tutorial by @gebeer. Here are the most important steps to reproduce it: Admin settings Create an api template with default settings and just the title field assigned to it. Refer to @gebeer tutorial for further details Create a pages and nav templates with just the title field, for both template tick “Allow URL Segments” in the “URLs” tab (see attachment) Create a home template, this is going to be the single php file that will load your Vue SPA. Assign this template to the root of your website Any other template you create should have the “Alternate Template Filename” field in the “Files” tab set as home (see attachment), in this way if a user enter the website from any url that is not the root, ProcessWire will always redirect to the home template, Vue router will handle the url and call the right data through the REST API Under the root, create an api page and assign the api template to it (you can set “hidden” to this page so doesn't show up in the menu) Under the api page, create the pages nav and pages (see attachment), and assign the templates nav and pages to them. Now you have the www.sitename.com/api/pages and www.sitename.com/api/nav urls that you can use to fetch the JSON data PHP template setup In the templates folder, create home.php file and leave it empty, the HTML will be generated by webpack Now create pages.php and nav.php files. On these files is where we return the JSON data, based on the right url segment. Again, refer to @gebeer tutorial for further details on this matter. Note that I wrote a PageFields class that I use on these templates to fetch ProcessWire fields. The fields that are supported are text, textarea, repeater, img. Other fields may work but I haven't tested them. See the REST API setup for further details about how to use the PageFields class REST API setup You can decide what fields are included and what fields are excluded by passing a configuration array to the PageFields class. You can find here a list of the available configuration settings. See examples below. Show only selected core fields: $pageFields = new PageFields($p, [ 'fld_core_included' => ['url', 'httpUrl', 'template'] ]); Show no global fields, and only selected custom fields: $pageFields = new PageFields($p, [ 'fld_core_included' => [], 'fld_include_all' => false, 'fld_included' => ['title', 'gallery'], ]); On a gallery image field, hide breakpoint listing and show only httpUrl field: $pageFields = new PageFields($p, [ 'img_fld_overrides' => [ 'gallery' => [ 'fields' => ['httpUrl'], 'bp_list' => false ] ], ]); Webpack setup The most important file of all Webpack setup is config/index.js. On line 33 you need to provide your domain name so that Webpack can proxy the ProcessWire REST API to the Webpack dev server. Without this you wouldn't be able to take advandage of the Webpack hot module replacement feature which allows you to reload a vue module without refreshing the page, it also allows you to keep the state of the app. Notes My REST API may have bugs, this is just an example of an integration with ProcessWire, I suggest you either build your own REST API or use the awesome GraphQL module by @Nurguly Ashyrov. Todo Replace REST API with the GraphQL module. This requires vue-apollo, the Apollo/GraphQL integration with Vue, and vue-supply for integration with Vuex.1 point
-
This may be of interest for anybody seeking for ways to compress images. Google open sourced a new JPEG encoder „Guetzli“ (catchy name): Announcement GitHub repository I am not quite sure, how this new JPEG encoder could be used except with the command line. Maybe some apps (f. e. ImageOptim) will implement it in their interfaces or maybe it could be used with an module? Haven't even tried it out yet and it sounds performance intensive, but I am glad that they sticked with JPEG and didn't introduced another exotic format. Regards, Andreas1 point
-
This morning I pushed a module to github which extends the page api with moving and sorting capability. https://github.com/kixe/PageMove * CALLABLE (static & instance) * PageMove::execute($page, $parent = null, $newIndex = 0, $selector = 'all'); * $modules->get('PageMove')->execute($page, $parent = null, $newIndex = 0, $selector = 'all'); * * EXTENDED PAGE API * @method $page->move($parent, $newIndex = null, $selector = 'all') * @method $page->setIndex($newIndex, $selector = 'all') // set absolute index include=all * @method $page->getIndex($selector = '') // same as $page->index without argument @see getSelector() * * @method $page->moveFirst($parent = null) * @method $page->moveLast($parent = null) * @method $page->moveForward($steps = 1, $selector = 'all') * @method $page->moveBackwards($steps = 1, $selector = 'all') * * @property $page->moveFirst // same parent * @property $page->moveLast * @property $page->moveForward * @property $page->moveBackwards * * EXTENDED PAGES API * @method $pages->move($page, $parent = null, $newIndex = 0, $selector = 'all') * @method $pages->resortChildren($page, $selectorValue) * // same like core function $pages->sort($page, true); with capibility to change the sort condition Have a nice weekend.1 point
-
I need to retrieve some data from an external API that uses Oauth 1.0 authentication. This is the first time I've needed to use Oauth so I'm looking for advice. Does PW have any built-in tools that help with retrieving data from an external API and using Oauth? WireHttp maybe? For doing the Oauth stuff is it sensible to use a dedicated library (like OAuth 1.0 Client from thephpleague) or is it easy enough with just the functions built into PHP and/or PW?1 point
-
1 point
-
Good tip @Can For those interested, here is the blog post about sanitizing directly with $input: https://processwire.com/blog/posts/processwire-2.6.14-brings-major-enhancements-to-sanitizer-and-input-api-variables/#sanitizer-and-input-are-now-a-couple1 point
-
Just do: $user = $users->get("email=".$input->post-email);1 point
-
And here goes some code. Place this on site/ready.php (or create a module from it) and edit the first lines to your liking: /*************************/ /******* EDIT HERE *******/ /*************************/ // ID of the page where the custom content is $this->pageID = 1; // name of the field where the custom content is $this->fieldName = 'body'; // name of html tag and id from the parent of the custom content on the 505 file $this->elementTag = 'div'; $this->elementID = 'message'; /*************************/ /******* END EDIT ********/ /*************************/ // regex to get the contents of parent element $this->regex = '/(<'.$this->elementTag.'\sid=("|\')?'.$this->elementID.'("|\')?>)([^<]|<.+>.*<\/.+>)+(<\/'.$this->elementTag.'>)/i'; // On save the content of the field on the 505.html file $this->addHookAfter('Pages::saved', function(HookEvent $event) { $page = $event->arguments[0]; if($page->id !== $this->pageID) return; $file = wire('config')->paths->templates . '/errors/500.html'; $content = file_get_contents($file); $field = $this->fieldName; $content = preg_replace($this->regex, '$1'.$page->$field.'$3', $content); file_put_contents($file, $content); }); // On render the edit page, save the content of 505.html file on the field to show it $this->addHookBefore("ProcessPageEdit::buildFormContent", function(HookEvent $event) { $page = $event->object->getPage(); if($page->id !== $this->pageID) return; $file = wire('config')->paths->templates . '/errors/500.html'; $content = file_get_contents($file); preg_match($this->regex, $content, $matches); if($matches) { $page->of(false); $field = $this->fieldName; $page->$field = $matches[0]; $page->save($this->fieldName); } }); The above code assumes that your "505.html" file has a <div> with the id "message" in it, you just have to adapt it to yours.1 point
-
Wow quick reply! If only Guetzil was as speedy and compact like your response, @AndZyk That post was ace. Thanks.1 point
-
Of course the selector 'mh_bautraeger.id=mh_bautraeger.id' will give you no result since the value page id cannot be a string. It is always an integer. If I get you right you want to create a page select field providing all pages using template lstg_mainTmpl having a mh_bautraeger selected which is also selected in any (or only one?) other page using mh_mainTmpl. This is not possible via selector but you can do this via custom php code. You find a quick instruction under Input tab in your field setting. The hook should be placed in your /site/ready.php It could be helpful if you describe what the final target of your setting is. Maybe there exist a completely different approach.1 point
-
Hi @godmok - thanks for the report. Unfortunately I am having a trouble understanding exactly what the steps are to reproduce this. Is there any chance you could share a screencast of the problem in action? Also, might I have access to the server (if it's online) so I can test - although I think the screencast first still might be important. I don't think I have ever come across anything like this. Anyone else ? Hopefully we can get to the bottom of it though and get it fixed.1 point
-
Thanks for input. I have been searching for something really short. I am also not sure about the modules name. Any recommendation welcome. I changed the method/ property names to moveFirst and moveLast.1 point
-
(sorry for my English) I believe that PW can handle a product project with a very large number of items. As @horst said I think that the most important part is to try to reduce the number of product fields (less tables to deal with). If this can help, I read and did a few tests with Elastic Search and the PW module elastic-search. This is what I learn: Elastic Search should only be used as a search engine solution and not as a project database. Do not use Elastic Search if the product information is changed regularly to avoid the headache data management between PW, Elastic Search and some third-party system. Elastic Search gives a lot of tools to improve the reverence of search results. I never had the chance to try the FieldtypeCache module but I think is not that simple to control which items should be founded on a search. A Queue system and the elastic-search module hooks (create, update and delete) can help a lot with the synchronization of data coming from an external DB. This is a really interesting topic thanks for sharing your experiences.1 point
-
I completely agree with you and that's why we are choosing PW for its UI. Structuring the data is also crucial as we will have to deal with a synchronization of data coming from another external DB.1 point
-
Thank you all for your input. We will certainly continue our work with Elastic Search which is quite impressive (and RESTFUL). My programmer colleague found already that querying PW has its limit. I have asked him to look at your comments and maybe he will tell us about his appreciation of the topic.1 point
-
I had some time now to try out Guetzli and have to say, that it is really memory hungry. But the results on the other hand are impressive too. I made some tests with good old Lenna: Uncompressed (312.31 kb) Compressed with JPEGOptim and Jpegtran (ImageOptim default) (291.87 kb) Compressed with Guetzli (127.8 kb) From 312 kb to 127 kb is indeed impressive. For anyone who doesn't like the command line. The newest alpha of ImageOptim 1.7.1a4 also includes Guetzli, but there it is disabled by default and you will be warned, if you activate it.1 point
-
@Wanze I'm using $storageLocation = realpath(wire('config')->paths->root . $field->get('storageLocation')) . DIRECTORY_SEPARATOR; and ./../secure_files/ in Storage Location prefs. And I get "D:\osp\domains\secure_files\" on dev env and "/var/www/sitename/secure_files/" on live.1 point
-
it's a really amazing module, and will be indispensable for any site using hanna codes, i can already see this solving major problems with users entering incorrect stuff into their hanna codes. the options and description stuff is also amazing work!1 point
-
Hi ! Please welcome https://www.docpaddock.com/en/ It's a brand new rebuild of an old project called Trajectons.com (not online any more). It's a competition of predictions. You have to guess some podiums in MotoGP/Moto2/Moto3 categories or F1 (I'm a MotoGP fan). You have a free plan, another one where you can buy an avatar generator, and a Pro one to unlock some cool features. I knew nothing about PW a few months ago and its community helped me a *lot*. I wouldn't have be able to do this without your help. So thank you and have a look if you're into that kind of sports competition You can still sign up before the first Grands Prix seasons : it starts this sunday (26/03).1 point
-
This week, some more layout options have been added to it that I think many may find useful. This post highlights them with a screencast: https://processwire.com/blog/posts/processwire-3.0.57-and-admin-theme-framework-updates/1 point
-
We started using mustache template engine with PW. Since mustache is implemented in various languages. Currently I can render anything either server side or client side with js or php and both share the same code base. Data can be either objects arrays or json whatever you like. We also use patternlabs node mustache version for prototyping and so all patterns can be used 1:1 in PW later using some simple controller system based on Classes that extend PW WireData so all API can be used. We also use terrificjs for easy modular js components. So no vue or react but just to mention that there's everything possible in PW.1 point
-
The world is a vampire. (and an earworm for all you smashing pumpkins lovers/haters. You are welcome).1 point
-
For ages I used an admin helper module to do this. I finally decided to try this module, and whaddya know — works like a charm. Thanks Adrian!1 point
-
1 point
-
The person who marked this as CON did not understand Processwire... And they left out the same in the case of WordPress: "Everything has to be a 'custom post' even if you don't use it as a post". Same for Drupal: "Everything has to be a 'node' even if you don't use it as a node" This is just the chosen terminology, so the person who made it up does not understand too much1 point
-
1 point
-
If you are using cloudflare.com you might also want to create a page rule like: *mydomain.com/processwire/* Security Level = High Cache Level = Bypass Disable Apps Disable Performance This should prevent any of the Processwire admin from being proxied by cloudflare.1 point
-
A little humorous PW vs Drupal comparison https://www.slant.co/versus/14277/4267/~drupal_vs_processwire When comparing Drupal vs ProcessWire, the Slant community recommends Drupal for most people. In the question“What are the best web content management systems?” Drupal is ranked 2nd while ProcessWire is ranked 13th.The most important reason people chose Drupal is: A more complex Drupal installation can easily exhaust 256 MB of RAM with only one or two visitors.1 point
-
if anyone wants to allow e-mail and name in admin login with PW 3.x (and i guess 2.8) the module from @mindplay.dk wasn't working for me, i guess because ProcessLogin::execute is not pageName sanitizing the name.. this one works for me (PW 3.0.51) and allows either name or e-mail (you could change the name label to reflect this too of course) // change login name input label to e-mail-address $wire->addHookAfter('ProcessLogin::buildLoginForm', function(HookEvent $event) { // on liner as we don't change anything else $event->return->get('login_name')->set('label', $event->_('E-Mail-Address')); }); // hook into session::login to get user by mail $wire->addHookBefore('Session::login', function(HookEvent $event) { // need to get email from $input as processLogin::execute is pageName sanitizing $email = $event->input->post->email('login_name'); // stop here if login_name not a valid email if (!$email) return; // new selector arrays don't seem to work on $user so using $pages here $user = $event->pages->get([['email', $email]]); // if valid user set login name argument if ($user->id) $event->setArgument('name', $user->name); }); i've got those in a _hooks.php included in my site/init.php but you could of course outsource it into a separate module etc..1 point
-
If you have a SSL certificate for your domain (https) the wire cookie is set with the secure flag by default. Have a look in wire/config.php /** * Use secure cookies when on HTTPS? * * When enabled, separate sessions will be maintained for * HTTP vs. HTTPS. This ensures the session is secure on HTTPS. * The tradeoff is that switching between HTTP and HTTPS means * that you may be logged in on one and not the other. * * 0 or false: secure cookies off * 1 or true: secure cookies on (default) * * @var int * */ $config->sessionCookieSecure = 1; In the .htaccess file you can force using https: # ----------------------------------------------------------------------------------------------- # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below. # ----------------------------------------------------------------------------------------------- # RewriteCond %{HTTPS} off # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # If the flag is enabled, the browser (should) send the cookie only via https.1 point
-
MySQL 5.6 is still far far away from broad adoption especially on shared hostings and fulltext search is essential to processwire's selector engine (e.g every search related to text in any form). Under this circumstances will InnoDB not become the default anytime soon. On the other hand is InnoDB already fully supported, but without using the fancyness of it in core functionality. You need to keep in mind that not everybody is using processwire as cmf (I do so as well), but it's still a simple cms like drumlapress to many people.1 point
-
PW has to support a broad range of MySQL versions. One of PW's distinctions is making all of the data highly accessible, behaving as if it was all in memory ready to be used, while still being able to scale to millions of pages. One of the important keys to this is fulltext indexes. InnoDB did not support fulltext indexes for a long time, not until recently, in the overall MySQL timeline. While InnoDB now supports fulltext indexes, that's only if your server has a newer MySQL version that supports it, and a great many out there do not support it. Whereas it is universally supported on MyISAM, and has been forever. PW also performs reliably and particularly well with MyISAM (though does with InnoDB too). Like SiNNuT mentioned above, there are no foreign keys in MyISAM, so it's not even a consideration to be debated. While having foreign keys would have certainly saved time on the development side of PW, and are a nice-to-have feature at the DB level, the lack of them is not going to "lead to data inconsistency" either. We manage our table relations very carefully and thoroughly, as we know we don't have foreign keys managing that for us. To the end user of PW it makes no difference. I'm quite certain that whatever issue you are running into has nothing to do with the lack or presence of foreign keys. You can take advantage of InnoDB in PW now if you want to, and we've confirmed it working quite well across several installations. In fact, it's now an installation option available to you. If you click on the gear icon during install (MySQL settings screen) you'll see an experimental option to use InnoDB. While PW won't use features that aren't in both MyISAM and InnoDB (in order to be compatible with both), there are still some benefits to using InnoDB. Specifically, if the power goes out on your server, you won't have a potentially crashed table (needing a repair command). In addition, tables aren't locked during writes, making it work better in high traffic environments that are having to do a lot of INSERT or UPDATE operations in PW (i.e. constant updating or importing pages).1 point