Leaderboard
Popular Content
Showing content with the highest reputation on 03/16/2020 in all areas
-
Inspired by a recent question. Image Crop Ratios Allows preset aspect ratios to be defined per image field for the ProcessWire image crop tool. The module adds a select dropdown to the crop tool. Choose an aspect ratio and the crop area will be fixed to that ratio. Screencast Installation Install the Image Crop Ratios module. Configuration Default aspect ratios for all image fields can be defined in the module config. Aspect ratios for specific image fields can be defined on the Input tab of the field settings. You can override the ratio settings in template context if needed. Insert a hyphen as the first item in the ratio settings unless you want to force a ratio to be applied to the crop tool. The hyphen represents a blank option that allows a free crop area to be drawn. Usage Click the "Crop" link on the details view of an image thumbnail. Click the "Crop" icon at the top of the editor window. Choose an option from the "Ratio" select dropdown. https://github.com/Toutouwai/ImageCropRatios https://modules.processwire.com/modules/image-crop-ratios/12 points
-
@kunago, I think Croppable Image 3 is probably the best option for a lot of cases (e.g. you don't want the user to create a cropped image smaller than the given pixel dimensions), but inspired by your question I created this module:4 points
-
Everybody please take this pandemic really seriously!! Panic does not help for sure, but ignorance or underestimating this situation will cost the life of thousands of people all over the world! As the following chart shows, the mortality highly depends on the amount of people that are in need of medical care at one time! Taken from link 2, see below. I have underestimated it myself just like almost anybody in europe has, as nobody of us here has ever experienced a situation like this before (in contrast to asia). Here are two links that I encourage everybody to read, even if you live in an area that has not (yet) been affected: 1) https://www.washingtonpost.com/graphics/2020/world/corona-simulator/?fbclid=IwAR0ABgvQGxm005seLywxDkZScKImi53Du9lzAlMwrDH6qsaaefW-Oux-Gao They have great simulations of how such an exponential growth can/will happen and what every single person can do against it! 2) https://medium.com/@holger.heinze_81247/coronacodex-my-commitment-during-the-covid-19-pandemic-76613656dac0 I hope that was not offending the forum rules that don't want political discussion... I work 100% remote now and I encourage everybody to do the same if at all possible. Not because I'm afraid (luckily I'm not at high risk as I'm young and healthy), but to take responsibility for all the people around me and keep the number of people needing medical care as low as possible so that the staff in the hospitals does not have to decide which patient (with severe symptoms) is treated and which is not (and will likely die).2 points
-
You could add the datalist to a normal text field using a hook in /site/ready.php: $wire->addHookBefore('InputfieldText::render', function(HookEvent $event) { /* @var InputfieldText $inputfield */ $inputfield = $event->object; $field = $inputfield->hasField; if($field && $field->name === 'my_field') { $inputfield->attr('list', 'my-list'); $inputfield->appendMarkup = <<<EOT <datalist id="my-list"> <option value="One"> <option value="Two"> <option value="Three"> </datalist> EOT; } });2 points
-
This is the topic for the new module, TextInputAwesomeplete. Github: https://github.com/outflux3/TextInputAwesomplete Modules Directory: https://modules.processwire.com/modules/text-input-awesomplete/ Text Input Awesomplete Key Points: Uses Awesomplete JS library for instantiating autocomplete suggestions on text input fields in Processwire CMS. Supports any text field, including Page Title (FieldtypePageTitle). Allows admins to configure a list of suggestions (textarea input), or pull suggestions from Processwire pages, by configuring which pages to pull from and which field's value to use. About Awesomplete https://leaverou.github.io/awesomplete/ https://github.com/LeaVerou/awesomplete Benefits & Uses Can be helpful for fields where users may need to enter the same text in the same field on multiple pages, and you can't or don't want to use a Page Reference field. One example could be a site where you send emails using various boilerplate subjects; Another place to use this would be if you had an existing site with a text field that has some inconsistency when same values are added. The autocomplete would help editors to always use the same format as the other pages with the same value. Installation Upload or install from Modules directory. Usage & Configuration Once installed, on any text input field (including Page Title), you will see an option to enable autocomplete. Once enabled you will have the option to type a list of items for autocomplete suggestions, or enable the module to search pages for suggestions. Note that if you enter any items in the Items List field, those will always be part of the autocomplete suggestions, in addition to pages if configured. If you elect to use pages for the suggestions, you have these options: Choose a template to limit by (adds a template=sometemplate to the pages find selector). Override which field to pull suggestions from (by default it will use the field you are configuring). Sets the $field!= in the selector. Setup a Selector for finding the pages for the autocomplete suggestions. This overrides the template selected. Note that the selector needs to return pages that use the field being configured, or the field selected for override. Screenshots: (1) Examples of in-use: Module Configuration Screen1 point
-
You are right, I was wrong, sorry again ? Well, so I'd try changing the dynamic method call to a static one and see if the hook get's triggered. If yes, you know where the problem lies...1 point
-
Thanks a lot! This is a super easy solution. I don't want to let the user change the aspect ratio and this does it just well. Excellent job. Thank you again.1 point
-
ok thanks - i think it can be done no problem, but i think the api should be cleaner where you don't need to deal with setting array values; i'll have to post back once i have a working prototype.1 point
-
@Sevarf2 - I was able to successfully do that by adding a custom setConfigDataCustom method to the module, but this would be a beta feature until it is tested further. I'm not totally sure if i'm doing it the best/right way, so this was just a quick test, but it did work. However the api is not so intuitive for this currently as you first need to get the settings array for the key, then alter the value of one of the items, or add a new item (not tested) and then write the whole array back to the module $factory = $modules->get("SettingsFactory"); $mySettings = $factory->getSettings('wiretabs-testing1',false); // return array not wiredata $mySettings['settings_client'] = 'Jimmy James 4th'; $factory->setConfigDataCustom('wiretabs-testing1',$mySettings); I think it might also be possible to write settings to the module that don't have process pages, using this, but not sure how useful that is, i assume that it will be possible since the settings are just module config, so you'd be able to store anything you'd want in those arrays... If you can elaborate on the use case for this that might help to determine the best way to implement it.1 point
-
@horst Thanks for the info! We'll go ahead and sign up and get the phones ringing.1 point
-
@Robin S I voted for that in 2016... Why did that take so long? ? Just kidding ? Thank you for creating this and sharing it with us! ?1 point
-
Just some links I follow each and every day: https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6 https://www.zeit.de/wissen/gesundheit/2020-03/corona-pandemie-virus-covid-19-ausbreitung-live-blog1 point
-
Ah - after describing the problem I found the solution quick I'll check if there is a template with "field-" and current image field name. $customImageFieldTemplate = wire('templates')->get("field-$fieldName"); After this I can iterate over $customImageFieldTemplate->fields1 point
-
To make the renderField function to work for fieldset fields you must specify a $value to render that is not null. For example, using the /site/templates/fields/fieldName/$file.php (using $file argument): $page->renderField('fieldsetName', $file, $value) $page->renderField('fieldsetName', $file, '')1 point
-
Hi Jim Bailie of @Davis Harrison Dion, if you not already have noticed, Pete lately has worked on the developer directory and everything seems to be working fine now. Even (later) changes of the content and the approval processes are working well again.1 point
-
A few more points to watch out for. You need to copy the Authentication Salt in config.php to be able to use your login from the old database: /** * Installer: User Authentication Salt * * Must be retained if you migrate your site from one server to another * */ Installed modules and customizations can also mess up things. After simply uploading my backed-up /site folder into the new installation, I got a scary fatal server error. To step back I restored the /site folder of the fresh installation. I had replaced the fresh install database with my original backed-up database. That worked fine. I see all my old content and templates etc. in the admin area. Next I have uploaded all modules from the backed-up /site/modules to the new installation /site/modules. In the back-end I have clicked Refresh in Modules. It finds the modules and installs them. You may have to repeat Refresh a few times. I still keep getting this error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_headshot.filedata' in 'field list' After uploading the rest of the backed-up /site folder, everything else seems to work fine.1 point
-
@dotnetic sorry that was my mistake - made an error when I changed something last night and it didn't show the error to me as a superuser, only to other users (my logic was back to front). So you should now get redirected properly and you can change your forum name back again if you like (it's only used for login - the directory links your profile via the user ID).1 point
-
Not that much has changed since my inital post but still I want to give a short update. One thing has changed and made my life easier. I re-installed Manjaro and used it's XFCE edition and installed i3 afterwards. So I had everything in place I may need in the future - as in graphical interfaces for changes or settings. But to be honest... I never needed it by now. Still... happy to have it around. Another thing I changed was the keyboard layout. I used to use a QWERTZ (DE) keyboard but for a few weeks now I'm using a QWERTY (ANSI) mechanical keyboard and layout. Im still struggling to hit each and every key in the right moment but... well... it works quite well so far. Most of the time it's even easier than before as < >, [ ] and { } are way easier to type as before. At least while writing code. (Dear german/austrian/swiss DEVs... try an ANSI QWERTY keyboard... brackets, braces and however they are called... are way easier to type.) Don't know how I got here but by now my full boot time is down to 11 seconds, which is nice, but overall... using lots of terminal programs my CPU load and memory usage went way down. CPU on average 10%, and RAM at about 1GB. Quite impressive on a 2015 Thinkpad with i7 with 8GB of RAM. Due to a dedicated swapfile I can almost double my RAM to 16GB in order to run Chromium, Firefox, Opera, Brave and Vivaldi, while Thunderbird, ScreamingFrog, VS Code and lots of other apps running. Git, Yarn, NPM and all the tools I almost never used running almost each and every day - in terminal but still. Still struggling to prepare my MS Surface to love Linux but... yeah... everyone needs I hobby I guess. Details can be seen in the screenshot below... otherwise... ask here or in the DMs.1 point
-
It's Linux for me anyday anytime, there are so much work I get down easily, also the terminal, I can pipe and do crazy stuff, I just installed awesomeWM and looking to play with that, I like i3 but learning C++ to customize my UI is too big of a task to take, with awesomeWM I can pick up Lua and customize my os. Been running Linux since Ubuntu 6 I think and always loved it as my programming environment.1 point
-
If you work on a project with a team of coders then for reasons of conformity BS and UIKit come into play. As a freelancer you have the luxury to code your own css or use a framework without limiting rules and keeps page loads fast and free from bloat such as: 1) Pocketgrid https://arnaudleray.github.io/pocketgrid/ 2) Gridy https://microcipcip.github.io/gridy/#!/1 point
-
I used Canvas HTML theme which overlaid Bootstrap then added my own customisations which often overrode the Canvas theme CSS which overrode Bootstrap. The code bloat was stupid. Going back to pure SCSS/CSS with smarter use of CSS Grid, Flex & media queries. Can now place things where I want depending on screen size/device without unnecessary HTML for purely structural purposes, eg floated divs etc and much less CSS download. The page file size difference is incredible. Also trying to wean self off jQuery. That may take a little longer especially as PW is so dependent on it.1 point
-
Reminds me of a particular CMS ? This is equally true when using BEM-like methods. Even if you are using content-agnostic components (hint) it is very hard to maintain CSS in large projects. Especially in teams where more devs are involved. With the rise and rise of Vue and React this becomes somewhat more manageable if you scope your css to your component, but still... That being said: I'm currently working on a large project for myself and I am speeding up my development flow faster than I could imagine using Tailwind. And I used to be anti concering utility classes ?.1 point
-
I recommend the modern CodyFrame framework, and the main reason is that it has separate elements, i.e. you add to the page what you need as Components, so there is no mess in the code, and the page should load faster, the size of the files will not be huge, yes as in most major CSS frameworks. There are also other reasons, such as the Global Editor ( GLOBALS ), thanks to which your website will not look like hundreds of others based on the same CSS frameworks (you can customize many elements such as colors, typography, buttons, forms ). Plus many basic Tutorials that you can start with. You can also see this Site Profile, which can be a good start to familiarize yourself with this framework.1 point
-
I use BS all the time and my websites never look the same. I change everything I need, it's very easy to use SASS, and its grid and utilities classes are great. Maybe the sites look the same because you/they leave it with the "out of the box" style and layouts. You simply adjust colors, borders, sizes, spaces, fonts, icons, shadows, pictures, backgrounds, etc. and create designs/layouts in a creative/useful way and that's it. But never ever copy and paste the examples and start throwing code on it... and this will happen with any framework you use. You should always start with a good (useful) design of the page, without thinking about its implementation and then use BS or any other tool to do it as it was designed, as simple as that. PS: Ah.. I forgot.. I'm a graphic designer LOL1 point
-
I like UIKit because it just has all the js thingies bloat that 90% of clients/agencies always want on their sites: slider, slideshow, cover images with <img>, vieport height utilities, etc. What I don't like in the most recent version is that I can't apparently leave out the Js of components I am not using. I've also become very keen on using it with the Less PHP compiler to quickly make edits to the core components (and actually cherry pick the css I want to include, unlike the js) I've recently used bootstrap on some projects and REALLY like their utilities for padding margins and them being also responsive which is where they have a big upper hand to UIkit I feel.1 point
-
Since modern browsers support flex and grid and most CSS3 specs, I also moved from using frameworks like BS to setting up things manually with my own, reusable scss partials and the JS libs that I need for a project. Also trying to move more and more to vanilla JS and kick jQuery. This way I get more streamlined assets. If I need to support old browsers (mainly IE11), I write some specific extra CSS to cater for them if need be.1 point
-
I'm still mostly on Foundation, but use it more like Sass mixins library with custom classes based on BEM naming methodology and js plugins. There are several 'Cons' - jQuery dependency and uncertainty in further development as the project is maintained and developed by volunteers, there are not so many people from ZURB involved anymore, though there was first community-based release in December.1 point
-
I was a fan of Uikit (the same framework used in the PW backend) but nowadays I write all my css by myself, for the same reason you've mentioned above (using a framework is a tempting way to use default styles an call it a day). Even though I've not used the the new kid on the block (Tailwind, which claims to be "unopinionated", but I do not agree with that statement) I just prefer to be organized upfront with my scss partials and be consistent with styles during the prototype/design phase.1 point
-
That should be enough. You just need to make sure that the server setup works, so I'd install a fresh copy of PW manually to see if that works. Then you create the db user on the new server, restore the db, copy your files and you should be up and running. I'm not saying anything against the other 2 recommendations. Just answering your question ?1 point
-
Yeah!! Long time Linux user. From Fedora Core 1 (2003) to Fedora 30 (2019). Very happy. Gideon1 point
-
1 point
-
This works as expected: /** * mystyles.js */ CKEDITOR.stylesSet.add( 'customstyles', [ { name: 'Generic List', element: 'ul', attributes: { 'class': 'generic-list'} }, { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Right Aligned Photo', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Deleted Text', element: 'del' }, { name: 'Cited Work', element: 'cite' } ] ); Just didn't use 'mystyles'... Still don't know why the 'mystyles' didn't work, but I can live with this https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-js-styles-set "The term mystyles is just something we made up, and you may use whatever keyword you like (as long as it's not mystyles!), but note you will have to use that same keyword in the file itself. In our example below, you will see where we used the term mystyles again. If you want to keep things simple, then just stick with using mystyles."1 point
-
Below 1% with a functional health system. In italy the health system collapsed and the death rate there is about 3-5%0 points
-
Starting tomorrow everybody in austria should be in self isolation: This is good but TESTING is still TO LESS. In Austria you get only testet if you have symptoms and had contact to someone how as testet covid-19. Really, my daughter and her mother had fever and has very strong cough. But no contact - no test. It's really stupid.0 points