Leaderboard
Popular Content
Showing content with the highest reputation on 07/19/2013 in all areas
-
ImageMinSize Module Already there since a couple months, I figured I'd finally add it to the repository. What it does ImageMinSize module allows you to define a minimum width and or height an image needs to have when uploading. This is same as the already existing maximum image size setting, just on the other end. You can set the max and min width and height setting to the same to restrict uploaded images to a specific size. If the requirements aren't met it will delete the image and show an error. After installing the module you'll be presented with the additional minimum width and height setting in the fields input configuration. Currently on github https://github.com/somatonic/ImageMinSize On modules repository (in approval state) http://modules.processwire.com/modules/image-min-size/ This module was getting started because of this thread: http://processwire.com/talk/topic/3476-fixed-image-size/?hl=imageminsize#entry341108 points
-
Ryan was kind enough to agree to answer some questions about himself and about ProcessWire for an interview which I've posted over on my blog at http://codingpad.maryspad.com/2013/07/19/interview-with-ryan-cramer-processwire-cms-founder-and-lead-developer/ I think it's a pretty good read and quite informative and hope it brings lots more exposure to PW and how awesome it is! Many thanks Ryan, you rock!!4 points
-
Greetings, Excellent interview! Ryan comes across as brilliant and extremely likeable -- which we all know is a true portrait. Thanks, Matthew4 points
-
I have been using dlvr.it - I found it was more reliable handling at ensuring the images made it through to FB. I had some troubles with RSS Grafitti. There are lots of other services out there for RSS to FB/Twitter, which seems like the easiest approach.3 points
-
In fact it was the main goal of my module. But if i only had knew the existence of fieldtypecache maybe i clould save some lines of code2 points
-
Sorry to be picky, but just in case newbies get confused, page name (found under Settings Tab when editing a page) and page title (May or may not be found under Content Tab when editing a page - it is a custom field ) are different things in PW2 points
-
I haven't tried your module, but if I remember correctly it had some support for files (pdf, doc) too? If that's really the case, that alone would make it very useful.. and that's definitely what I'd recommend focusing on, as it's pretty damn important for certain sites2 points
-
Dimension Fieldtype A new fieldtype to enter 3 integer values for width, height and depth. Output You can output the values from a page like this: echo $page->fieldname->width; echo $page->fieldname->height; echo $page->fieldname->depth; Volume There's also support for a "computed" value of the volume. W*H*D. This will get stored additionally to the database and updated every time a dimension value changed, so it can also be used in selectors for querying. echo $page->fieldname->volume; Selectors for searching The dimension can be used in selectors like this: $pages->find("dimension.width=120"); $pages->find("dimension.height>=100, dimension.depth<120"); $pages->find("dimension.volume>=1000"); Integers and Formatting The values are entered and stored using integer and not float, as this makes for easier headache free usage. Treat them as integer and format them on the output if you need to. echo (number_format(($p->dimension->width/100),2)); // 538 will be 5.38 Field Settings There's field settings for the width of the inputs in pixels. There's a input setting to add a suffix string to each input like "mm" or whatever you like. The module is already on the repository ready to use http://modules.processwire.com/modules/fieldtype-dimension/1 point
-
By default, the "Forgot Password" module is not turned on in v2.1. My thought was that lack of such a function is technically more secure (on any site or CMS). Why? Because having such a function active means your password is only as secure as your email (*though see note at end of this message). So I thought we'd start things out as secure as possible and let people adjust it according to their own need. But I'm rethinking that decision, and may change it to be 'on' by default. If you don't already have that "Forgot Password" module installed, it is relatively easy to reset your password with the API. Lets say that you lost the password for your account named 'admin' and you wanted to reset it. Paste this code into any one of your templates (like /site/templates/home.php in the default profile, for example): <?php $admin = $users->get('admin'); $admin->setOutputFormatting(false); $admin->pass = 'yo12345'; // put in your new password $admin->save(); …or if it's easier for you to copy/paste everything on one line, here's the same thing as above on one line: <?php $users->get("admin")->setOutputFormatting(false)->set('pass', 'yo12345')->save(); Replace "yo12345" with the new password you want and save the template. Then view a page using that template (like the homepage, in our example). The password for that account has now been reset, and now you are ready to login. Don't forgot to now remove that snippet of code from the template! Otherwise your password will get reset every time the page is viewed. Once logged in, here's how to install the Forgot Password capability: 1. Click to the "Modules" tab. 2. Scroll down to the "Process" modules. 3. Click "Install" for the "Forgot Password" module. That's all there is to it. You will now see a "Forgot Password" link on your login page. *ProcessWire's "Forgot Password" function is actually a little more secure than what you see in most other CMSs. Not only do you have to have the confidential link in the email, but the link expires in a matter of minutes, and PW will only accept password changes from the browser session that initiated the request. So an attacker would have to initiate the password change request and have access to your email at the same time, making it a lot harder for a man-in-the-middle snooping on your email.1 point
-
TextformatterImageInterceptor ( Textformatter module ) Let editors use WYSIWYG images, but let you control the image size, aspect ratio & behaviour. How to install Copy the TextformatterImageInterceptor.module file to your /site/modules/ directory (or place it in /site/modules/TextformatterImageInterceptor/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Image Interceptor". Go to the module config screen and set the settings you wish. How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing controlled images in). On the details tab, find the Text Formatters field and select "Image Interceptor". Save.About the settings Render Inline styles If checked, some inline styles are added to the image.High Density Double the pixel width of an image if the percentage is not set. (fixed image size)Default there are settings for landscape & portrait images. Squared images will inherit all settings belonging to portrait settings and there's a way to escape the default settings. But before we dive deeper in tagged sets I want to spread some light on the landscape/portrait settings. All images portrait/landscape wil get the class name .default. ps, All images including tagged set images get the image orientation as class (.landscape / .portrtait) Percentage The width of the image in percentage. This setting makes the image responsive or if left blank the image wil be fixed size. Images receive a .responsive and a .p-50 class (where 50 is the width in percentage) Width The width of the image in pixels. So the width of the image in percentage and the pixel width combined wil be the key to pixel desity. Alignment There are 5 different ways to align an image. left, center, right, inherit (inherits from the WYSIWYG editor) and not aligned. If render inline styles is checked the aligment wil be set directly in the inline style of the image. Alignment classes wil be added to the image. Aspect Ratio (cropping) if an aspect ratio is given, the image will be cropped to the given ratio. If you type 2:1 in the landscape settings. Images 800 pixels wide, will be croped to a 800x400 image. The image gets the following classes: .cropped and .crop-2x1 Image Captions Type here your class name(s) for the caption. When a class name is provided and an image has a description, the image is wrapped (if not already) and *has-* is set in front of the class name(s). For the caption a div is created with the class name(s) and the image description as text. Next to these settings. You can give custom classes to images. This way you can give it framework specific classes for example. And you're allowed to wrap the images with custom HTML. (Some frameworks needs additional HTML to make images more fancy) Then additional styles could be added to images if render inline styles is checked. Tagged sets Tagged sets are an image tag followed by settings specific for images with that tag. To enable tagged sets, the image field need "Use Tags?" to be checked. Go to setup, then fields go to your image field and under the details tab check "Use Tags?". Taged sets are a good way to escape the default image behaviour. Say you have a bunch of nicely ordered images on the page, but you want to show a company logo on 150px floated left. With tagged sets it's no problem. type: (logo 150px left) on one line and you've created your first tagged set. (don't forget to tag the image to) If you want captions for a tagged set, keep in mind that captions need at least 1 class. The format to enter: caption.class-name. For an image wrapper we use the same rules. The only difference is we start typing wrapper followed by class names starting with a dot. example: wrapper.logo.stand-out. You can have a multitude of sets, every set on it's own line. Every set needs at least a tag-name and a pixel width. Note: If you use a wrapper or captions (wrapper will be created if none is set), the inline styles and specific width & alignment classes will be set to the wrapper and removed from the image. This way no duplication of styles wil take place. github modules directory1 point
-
Currently I have a multi-language site. If I want to have an image with a different alt tag for each language I need to use a repeater. I think it would be sweet to have a fieldtype of ImageLanguage that would allow an image to have a separate Description field for each langugae. I think this could make PW more multi-language friendly.1 point
-
Very impressive - http://sarasoueidan.com/blog/s-gallery-responsive-jquery-gallery-plugin-with-css3-animations/1 point
-
Does this help? http://processwire.com/talk/topic/3719-other-permissions-like-page-publish/1 point
-
At this point I haven't really thought about the workflow, but I think there might be some room for improvement there. Initially, I am just wondering if it makes sense that a user who has editing rights should be blocked from editing a page, just because it is already published - maybe it is more of a terminology issue for me at the moment.1 point
-
Hey apeisa - thanks for helping me. It turned out to be in the DB but I grepped a backup file to find it! Phew - mystery over1 point
-
Hi! Checkout RSS Grafitti for FB. http://www.rssgraffiti.com/1 point
-
that reminds me of a game on the good old amiga 500: F/A-18 Interceptor...i started from a aircraft carrier and i flew with maximum speed through the golden gate bridge...1 point
-
You can't use PHP in CSS files by default. I'm sure you could find some discussions about that from the forums, but for now I'd suggest slightly different approach. Do something like this for the element you want to have a background-image for: <div<?php if ($pages->get("/site-settings/")->background_image) echo " style='background-image: url(" . $pages->get("/site-settings/")->background_image->url . ");'"; ?>> Rest of the settings (background-position, background-repeat, background-color etc.) you can define in your CSS file. This is probably the easiest way to get past this -- it adds a bit of inline style to your markup, but that's a very minor issue here.1 point
-
1 point
-
It must come from your template files. Try grepping your /site/ folder for "smart-devices".1 point
-
Oh God, Oh God, so 70% of my module is useless. I saw now that fieldtypecache is in the core but not listed on this site, also the name of the module was for me misleading because i always think that "cache" was for templates (html,css,js and so on).1 point
-
Hi Alevine, One way to accomplish this would be to use Ryan's Hanna code module. Set up a Hanna code, let's say "output_pages" to accept a selector parameter and output what you need. Create a text field that contains the Hanna code and the parameter like [[output_pages match=template=basic_page]]. Hope that helps, -Brent1 point
-
Yup, great interview as always Mary. That's how I remember you when I was once digging your articles, tuto's and posts about modx evo. Only this time it's about a never seen before cms that truly adapts to a user / client / designer and coder. Also liked it to read about how pw came to be together with the history of the man behind of it. Besides another good summary of the open potential of pw, the whole interview also inspires a newbie to try to make more out of projects with the help of pw.1 point
-
Thanks Ryan! Haven't really thought about that, so thanks for the heads up! I changed the keys and also added support for a volume property that will get calculated everytime a dimension changes and stored to DB. So it can be used for convenience if needed to get the volume, and also use it in selectors. I updated the module and readme to reflect that change, along with some cleanup and coments. If you happen to already have the module installed, I recommend to reinstall the module for the updated index in db tables.1 point
-
1 point
-
I'm not sure why it wasn't working in my case, but will try again. Good to know how the capability is provided (collagePlus), I like it so much you have me thinking this should be the default output.1 point
-
Either mysqli or PDO is equally stable so long as you use PHP's version rather than ProcessWire's version. ProcessWire has the WireDatabase class for mysqli and WireDatabasePDO class for PDO. They are primarily just wrapper classes used for tracking queries, so you shouldn't feel like you have to use them. Yes, it's generally pretty stable, and it's what I use for any site I'm working on. The only thing I'd advise is just keeping more of an eye out for issues and reporting them if you see any. You also want to test thoroughly every time you update to a new commit in the dev branch. Whereas on the master branch, you can assume that what's there has already made it through dev branch testing (i.e. had more people using it before you did).1 point
-
I'm not so sure I just tested out the module to confirm what I thought. Here's what the module does. 1. It only does it's thing if the user has the role *editor*. 2. It allows users with the role *editor* to edit only their own pages - pages that they created. 3. To reiterate #1, module doesn't do anything if the user doesn't have the editor role. Now, before I continue I'd just like to say that I've already found a use for this module - restricting certain users to edit only their own pages. and it kind of solves part of a problem I had with my PageEditPerRole module.. So, thanks Soma Continuing, I believe what Peter was asking for was: 1. Users can only edit their own pages. (pages they created) 2. If the user has an *editor* role, then they can edit other people's pages. I think #1 can be improved to say that "users with role *author* can edit only their own pages". Then, there would be another role check for the *editor* role (or something similar) who can edit everything. As below: <?php /** * Page edit per user created id * */ class PagesCreatedEdit extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Pages created edit', 'version' => 1, 'summary' => 'Page edit only for created pages by user', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { // add edit permission hook for admin pages $this->addHookAfter('Page::editable', $this, 'editable'); } public function editable($event){ $page = $event->object; //I don't think we should stop users if they already have permission to edit //Permissions should be additive IMHO - other modules could grant edit permission. if($event->return) return; //I'm not too good with this kind of conditionals. basically, stop if user doesn't have either of these roles //The idea is, the presence of these roles trigger when this module *runs* - does it's permission check //(obviously the module is already running) if(!$this->user->hasRole("author") && !$this->user->hasRole('editor')) return; /** TODO: author and editor roles may be another name or could be multiple roles **/ //get highest "role type" $roles = $this->user->roles; $is_editor = false; //probably don't need this foreach($roles as $r){ if($r->name == 'editor'){ $is_editor = true; $role = $r; break; } elseif( $r->name == 'author' ){ $is_editor = false; $role = $r; } } //make sure role has page-edit permission. I know user may have page-edit permission from another role. //but let's not consider that for now. if(!$role->hasPermission('page-edit')) return; if($is_editor){ $event->return = true; }elseif( $page->created_users_id == $this->user->id ){ $event->return = true; } /** * Caveats: (for now) * * If user has both author and editor roles, then this module will use the editor role for permission check. * This means if editor role doesn't have page-edit permission, user won't get permission even if author * has page-edit permission. */ /* if($event->return) { // only if edit rights are true if($page->created_users_id == $this->user->id){ $event->return = true; } else { //don't think we need to set to false //$event->return = false; } } //*/ } }1 point
-
<?php /** * Page edit per user created id * */ class PagesCreatedEdit extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Pages created edit', 'version' => 1, 'summary' => 'Page edit only for created pages by user', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { // add edit permission hook for admin pages $this->addHookAfter('Page::editable', $this, 'editable'); } public function editable($event){ $page = $event->object; if(!$this->user->hasRole("editor")) return; if($event->return) { // only if edit rights are true if($page->created_users_id == $this->user->id){ $event->return = true; } else { $event->return = false; } } } } THis will get you there, not many different from frontend coding.1 point
-
Finally had a chance to test this new functionality and have been really impressed. For those wanting to try, here are the steps that I went though using the default site profile. In the following examples I am adding two languages English and German where the pages will be viewable with the language code preceding the url like /en/ and /de/ 1.Install the latest development version - here is the zip download - https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip 2. Install these 3 modules - Languages Support - Languages Support - Fields - Languages Support - Page Names 3. Add a new language via the Languages setup page - I think naming here is only relevant for your code and does not affect the URL of the page 4. Open up the home page and look at Settings tab - the name (url) field should now have a field for each language you have added. Add an indicator for each language like /en and /de English /en/ Deutsch /de/ This acts as a language gateway for changing the language. Now when ever you visit the site via /de it will set the users language to German and all the pages in the site will display the correct German language url. note: I have not worked out how to redirect the default language (which is English) to /en - it always goes to the site root / 4. Add a simple language navigation switcher. This will allow users to switch the current page into the other language. Edit : Refer to WillyC and Ryans language switcher further down - http://processwire.com/talk/topic/2979-multi-language-page-names-urls/page-3#entry33537 echo '<ul>'; $lang = $user->language; $langname = $lang->name == 'default' ? 'en' : $lang->name; $user->language = $languages->get('default'); $cssClass = $langname == 'en' ? 'class="active"' : ''; echo '<li '.$cssClass.'><a href="'.$page->url.'">EN</a></li>'; $user->language = $languages->get('de'); $cssClass = $langname == 'de' ? 'class="active"' : ''; echo '<li '.$cssClass.'><a href="'.$page->url.'">DE</a></li>'; $user->language = $lang; echo '</ul>'; I think that is pretty much it. All other PW development procedes as normal. I also just switched over from the LanguageLocalizedURL module on one site - it was actually pretty easy to do - just uninstalled the module and went through the steps above - thanks soma and mcmorry for the original module - it was very useful at the time, but will be moving over this mainly so I can start using the ProCache module. I have tested the new language fields with ProCache and it also works great! Super fast, one tree multilingual sites, with the same ease as developing a regular processwire site - this is so cool!1 point
-
Try this, at least you will be able to login immediately <?php $users->get("admin")->setOutputFormatting(false)->set('pass', 'yo123')->save(); taken from here http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/1 point
-
Thanks. That seems sensible I suppose, but it just threw me because there is still a page for editing permissions for a superuser role. Perhaps it would be a good idea to change the interface to indicate the fact that individual permission control doesn't apply in that case.1 point