Leaderboard
Popular Content
Showing content with the highest reputation on 04/05/2015 in all areas
-
I'll make this quick since these are pretty boring given the fact that in both cases, the original design was not done by me but is based on print designs originally intended for flyers. Both sites actually belong to the same client, a local non-profit organization providing help and counceling for women (abuse, domestic violence, mobbing, stalking but also pregnancy, divorce etc.). Both sites used to be static pages (both technically and design-wise), they have now been upgraded to responsive designs powered by PW. frauennotruf-oh.de (the main site of the organization) maedchenberatung-in-oh.de (a one-pager tailored to girls and young women who prefer counceling via email) The most remarkable part was (once again, I might add) how easy it can be to convey using a CMS with PW. None of the client's editors had ever worked with a CMS before, yet we still managed to get the CMS training done in 90 minutes for both sites. Everyone was pretty surprised how easy it can be to manage your own website with PW.5 points
-
In your /site/config.php file on the testing2.mywebsite.com domain you should make sure you have changed $config->httpHosts = array('testing.mywebsite.com'); to $config->httpHosts = array('testing2.mywebsite.com');2 points
-
Latest update to my local testing branch... Moved totally from custom callbacks to PW hooks (core and module own hookable methods) Have a working minimal FrontendUserLogin and FrontendUserRegister module. Added FormHelper dependency again (instead of a extended wrapper FormHelper is changed to extend InputfieldForm object) FrontendUserLogin / FrontendUserRegister (simple use) // login echo $modules->get('FrontendUserLogin')->render($redirectAfterLogin); // register echo $modules->get('FrontendUserRegister')->render($redirectAfterRegister); The method render() is a shortcut. Long form with chance to modify parameters, form, ... $fu->form(); $fu->validate(); $fu->process($redirect); $fu->renderForm(); How to add plugins? After $fu->form() define the plugin field and needed processing validation code as a PW hook RememberMe plugin to integrate LoginPersist module // RememberMe field / persistLogin integration $remember = $modules->get('InputfieldCheckboxes'); $remember->name = 'persist'; $remember->attr('id+name', 'persist'); $remember->skipLabel = 4; $remember->addoption('persist', 'Remember me?'); $remember->addHookAfter('processInput', function($event) { $field = $event->object; if (isset($field->value[0]) && $field->value[0] === 'persist') { wire()->addHookAfter('Session::login', function($event) { wire('modules')->get('LoginPersist')->persist(); }); } }); $fu->attr('form')->add($remember); Or an integration of core module ProcessForgotPassword // ForgotPassword integration $forgot = $modules->get('InputfieldMarkup'); $forgot->value = "<a href='{$page->url}?forgot=1'>{$this->_('Forgot password?')}</a>"; $fu->attr('form')->add($forgot); if ($input->get->forgot) { function processForgot($event) { wire('config')->styles->add('/pw/wire/modules/AdminTheme/AdminThemeDefault/styles/main-classic.css'); $event->return = wire('modules')->get('ProcessForgotPassword')->execute(); $event->replace = true; } $fu->addHookBefore('FrontendUserLogin::login', null, 'processForgot'); } Login with email address instead of username? // Email login instead of username $fieldUser = $fu->attr('form')->get('username'); $fieldUser->addHookBefore('FrontendUserLogin::auth', function($event) { $fu = $event->object; $email = $fu->attr('form')->fhValue('username', 'email'); $loginUser = wire('users')->get("email={$email}"); if ($loginUser instanceof User && !$loginUser->isGuest()) { $event->arguments(0, $loginUser->name); } }); You have added a nickname field to user template? The plugin to use the nickname (sanitized text instead of username) to login // Nickname login instead of username $fieldUser = $fu->attr('form')->get('username'); $fieldUser->addHookBefore('FrontendUserLogin::auth', function($event) { $fu = $event->object; $nick = $fu->attr('form')->fhValue('username', 'text'); $loginUser = wire('users')->get("nickname={$nick}"); if ($loginUser instanceof User && !$loginUser->isGuest()) { $event->arguments(0, $loginUser->name); } }); The plugins are tested and working fine, but I don't know how to ship plugins. At the moment it's code inside the template login.php, but should be moved to a separate plugin file or the FrontendUserLogin module... Any suggestions? *Added nickname login plugin and fixed a nickname / email login bug*2 points
-
wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )1 point
-
A friend of mine asked me to build a website for the dog training business she just started. She already had a graphic designer create a logo and a small print brochure and wanted a clean, simple website. www.hundeschule-grosse-freiheit.de is the result. The website is neither big nor fancy. But it has some nice details: Responsive, lazy loading images Almost all images (except the SVGs and the badge image in the footer) are maintained via the ProcessWire backend. Each image is rendered in eight different sizes – using respimage and lazysizes for frontend display. All images are created using the great ImageFocusArea module – something I wanted to be able to use in ProcessWire since I first worked with Drupal’s “ImageField Focus” module. Of course all images are minified using minimize.pw. Central asset management for images Because most of the decorative images are used on more than one page, it made sense to build a central image management – using a specific “settings” part of the page tree with one page per image. Images in sidebars or on the gallery page are chosen using page fields in combination with the Page List Image Label module: So an editor’s experience regarding the visual representation of the “linked” images is not so much different from working with default image fields. Consequent usage of a cookieless subdomain for static content. The cookieless subdomain specified in the AIOM+ module’s setting is also used to deliver images. Multi-language content. Nothing big, but my first ProcessWire site with more than one language. Of course it uses the Autodetect Language module for the homepage – as well as “hreflang” links in each page’s head to give Google as much language information as possible. Feedback and ratings The feedback page, which features quotes and pictures of happy clients, is populated semi-automatically. Feedback is collected using a Form Builder form on a secret page. After a training has ended the site owner sends an email to clients, thanking them for taking part and asking them for their feedback with a link to the secret form page. Clients can enter a quote, a 5-star rating and optionally an image – as well as their permission to use the quote and the image (necessary to avoid legal problems). This information is saved as a new unpublished page. After a new feedback entry page is published by the site owner, the new entry is displayed on the main feedback page. The pages used to save feedback entries feature multi-language fields. So it’s possible to present all testimonial quotes in both languages. The footer of each page features an aggregated 5-star rating, calculated from all single ratings displayed on the feedback page. Each individual feedback entry on the feedback page as well as the aggregated rating are formated using Schema.org markup. So it can be read and understood by Google and thus has the potential to be displayed as rich snippet on Google result pages. Oh by the way: The decision to use email links rather than a contact form was made by the site owner.1 point
-
-------------------------------------------------------------------------------------------------------------------------------- for PW 3.0+ please follow this link! -------------------------------------------------------------------------------------------------------------------------------- Croppable Image Module for PW >= 2.5.11 and PW <= 2.7.3 Version 0.8.3 alpha Hey, today I can announce an early (alpha) release of CroppableImage, what was forked from Anttis Thumbnails module. Until now there was a lot of work done by owzim, Martijn Geerts and me. We have solved the issues regarding the list from here: The modules are bundled together so that you only can and have to use FieldtypeCroppableImage for install, uninstall & configure. It uses new naming scheme that was introduced with PW 2.5.0 that supports suffixes. The complete image rendering is delegated to the core ImageSizer, or to any optional hooked in rendering engine. Template-settings are now fully supported, including removing variations when settings have changed. It fully respects settings for upscaling. If upscaling is set to false, you cannot select rectangles smaller than the crop setting. We implemented these enhancements: The GridView now is very nice and compact, and also benefits from the lately introduced setting for $config->adminThumbOptions. Permanent storage of the crop coordinates, quality and sharpening settings are now implemented native. No need to use PiM for this anymore. The usage/display of the Quality and Sharpening DropDown-Selects can be globally disabled/allowed in the modules Configpage. (additionally to that a setting on a 'per field base' is planned.) And the most wanted feature by the community: It gives back a pageimage and not the URL-string. This way you can use it like this: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); You can further use every pageimage property like 'url', 'description', 'width' & 'height' with it: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); echo "<img src='{$image->url}' alt='{$image->description}' />"; And you can proceed further image rendering with it: // get the first image instance of crop setting 'portrait' and proceed a resize with imagesizer $image = $page->images->first()->getCrop('portrait'); $thumb = $image->width(200); // or like this: $thumb = $page->images->first()->getCrop('portrait')->width(200); // and if you have installed Pia, you can use it here too: $thumb = $page->images->first()->getCrop('portrait')->crop("square=120"); The only downside with this is that when you (as the site developer) have enabled the usage of DropDown-Selects in the images editor, you do not know the values the editors have chosen for the images. As a workaround for this you can use the getCrop() method with a second param. This is a PW selector string. It can contain as many of the known pageimage options like 'quality', 'sharpening', 'cropping', etc, as you need, but none of them is required. But required is at least one setting for 'width' or 'height': $image = $page->images->first()->getCrop('portrait', "width=200"); $image = $page->images->first()->getCrop('portrait', "width=200, height=200, quality=80"); $image = $page->images->first()->getCrop('portrait', "height=400, sharpening=medium, quality=75"); . . You can get the module from GitHub: https://github.com/horst-n/CroppableImage (Better Docs are coming soon) Screenshots Related Infos A good setting in site/config.php for the AdminThumbs are: (height=>200 and scale=>0.5 !) $config->adminThumbOptions = array( 'width' => 0, 'height' => 200, 'scale' => 0.5, 'imageSizer' => array( 'upscaling' => false, 'cropping' => true, 'autoRotation' => true, 'sharpening' => 'soft', 'quality' => 90, 'suffix' => array(), ) );1 point
-
Hi all, today I stumbled upon yeoman and went searching for a PW generator. Larry Botha mentioned in a side not in his thread about MVC template approach that he has put a yeoman generator for PW together. I test installed it and it is working great. Pretty fascinating how quick we can setup a PW project with yeoman. This definitely can be a great timesaver. Larry's generator sets up a pretty opinionated PW install with his MVC structured fixate template and KSS etc. It would be great if we could have an unopinionated version that gives us a clean PW install. We could add options to the generator for installing a choice of boilerplate templates like the blank template, Foundation, Bootstrap, Blog etc. Just wanted to get your opinion on this. If any of you are interested, we could pull something together. Cheers Gerhard1 point
-
Ivan, you should have a look into the sites/assets/cache folder. If you can find a file there called LazyCronLock.cache, it is a sign that LazyCron once has started, but get not finished. To see when it has started, you may have a look to file date lastmodified, or look into it, it only contains a unixtimestamp. The reason(s) why it doesn't get finished could be that a script gots crashed / interrupted badly, - that a script is running in an endless loop, - or something that like.1 point
-
I am not sure, but it seems like I am having a similar problem. I think I did get a autoload module to hook Lazy Cron, but then it stopped working. I did mess around the system time a bit while testing - changed dates. Maybe this caused it to stop functioning? Could you please suggest how I can properly test it out? I am still not quite sure if Lazy Cron is not working or I screwed up my module.1 point
-
1 point
-
wireRenderFile does return the output of the included file. So everything you echo in test.php will be returned to $temp as string. The passed variables are only made available as copies, but they do not automatically make the function return anything.1 point
-
I can also suggest you to use "regular" ProcessWire users. The advantages are that you have a fully role based access control system built in, login/logout functionality and all the security stuff you'd have to implement on your own. As Nico said, you can create custom roles and permissions. The only required permission is "page-view". To keep your users away from the admin area, you can write a hook that redirects them (e.g. based on a role/permission) to your frontend when they are trying to enter the backend.1 point
-
I would create them as user with no permissions (or only custom permissions). Advantage is that you can use user specific functions like $user->isLoggedin().1 point
-
Hi Christophe, Please double check your site/config.php for adminEmail configuration. If not you can add that to site/config.php like follows: /** * adminEmail: address to send optional fatal error notifications to. * */ $config->adminEmail = 'name@exampledomain.com'; Here is a little reference. Thanks1 point
-
1 point
-
1 point
-
That's why all of us suggest doing updates on dev environments. If there are problems just wait till they are sorted out. Just do not update live sites and expect it to work every time. Additionally it's still the development version that most of us use, so it's natural that problems can arise, but if so report them and sooner or later they will be sorted out. As said before there's currently no need to update for other reasons than access to new features. Regarding userinputs: Sanitizing them is what you need to do no matter which cms you use. As soon as you do implement functions where users can directly input data you need to make sure it's not harmful data. So if you're for example using the core comments systems that's already implemented, but with ProcessWire's nature of encouraging to build own systems you need to be aware of the potential of malicious input from users. For example anywhere you accept data from forms or from parts of the url you need to consider that a user could abuse those points of access to inject own logic.1 point
-
No problem. We all have to do this besides work. I'm curious, if the db dump will show any differences, as it seems to work for me with your siteprofile and therefore the same database (besides the user profile).1 point
-
While the current dev version allows for user templates to be distributed over multiple parents it's still a quite new feature and therefore can have some quirks. As every user of your site is already automatically represented as "guest" it's really not that safer to do anything. Users are users, what makes them a security issue is how much permissions you give them. What I can understand is, that mixing both types in a single list by default is maybe not the best, but with the new lister view it's easy to adapt this to only show registered members / only admins. With ListerPro it should even be possible to devide this in two different preselected lists.1 point
-
Bump... Added this as a github issue.1 point
-
1 point
-
1 point
-
1 point
-
Sorting by subfields is now supported (see https://github.com/ryancramerdesign/ProcessWire/pull/862). It was my first contribution, so I'm pretty proud1 point
-
I had busy times in Linux world, but i started with 2.5 localization before few days as i am making new PW project. So YES there will be support for Czech 2.5 version.1 point
-
Funny, just yesterday I startet looking into yeoman, because I wanted to automate initializations of my projects in a more stable manner. Sure I have some shell scripts, aliases and functions set up to help me with that but, shell scripting is hell (at least for me, althoug I use zsh). Especially when it comes stuff other than copying and renaming files. Working with strings, numbers or templating ... yuk. I have not yet looked at Larry's generator in detail, but sure we can lear from it. I have yet to create my first real generator but I'd love to participate. I suggest that we collect ideas, what and how things should be done by the generator, and you @gebeer collect them in your original post. Off the top of my head I think it would be cool if module installations/or at least module downloading could be integrated somehow. Either by asking for the module name, and the generator then searches through the modules repo, or via config file. Can we event put that info in the package.json? I do think so. module installations renaming of the example files like htaccess and so on modifiying the htaccess via questions, that would require the htacces file to be in template form, so that directives can be included or excluded downloading of pw, asking for dev or master1 point
-
This is easy. In the TinyMCE field input settings, you must add "tablecontrols" to your buttons and add "table" to the plugin field. More advanced: It would also be possible to copy InputfieldTinyMCE to your site modules folder and rename it to create a new Inputfield. From there you can modify everything to your needs without touching the core.1 point