Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/2014 in all areas

  1. CONGRATULATIONS TO 2.4 ! An opportunity to thank Ryan and all contributors again for this wonderful software!
    6 points
  2. Firstly wanted to say amazing job Ryan - PW just keeps getting more capable and powerful and it's a real pleasure being part of this community. I have never experienced anything else like it - so incredibly friendly and supportive. A far cry from so many others. Obviously a result of the tone and standards you set here. Just a quick request - I am sure it is on your list, but it would be helpful to have 2.4 checkbox option in the modules directory sooner than later. Thanks again for everything!
    5 points
  3. Some major additions today! Added the ability to specify the dimensions of the rasterized version that is added to the admin images field. See the tiger screenshot in the first post in this thread to see how the SVG which was scaled to 25 x 25px before uploading, resizes up to a 500 x 500px fully transparent PNG. You can go as large as you want with no loss in quality. More importantly, I added a new method: rasterize() for the front-end which can be called from your templates with or without dimensions for resizing. $image->rasterize(200,0)->url This method optionally resizes the vector version of the image before it rasterizes it, so you can scale it infinitely and there will be no loss of quality. Make sure you point it to the svg version in your images field. These versions are stored using the filename.200x0.png format, so they will be automatically removed by PW if you delete the original image from the admin. I think this will be really useful - you can now upload one SVG and use the rasterize method to generate whatever sizes you need throughout your site - I can see this being especially useful for icons/logos. Also for scaling drawings/illustrations/charts/maps for different screen dimensions (RWD techniques) without the usual artifacts that result from scaling these style of images. New version available from the modules directory. Please let me know how it works out for you!
    5 points
  4. Good point Adrian. I've added 2.4, and also updated all the modules that are compatible with 2.3 to also indicate compatibility with 2.4. I think this is reasonably safe to assume (I haven't yet found any modules that aren't compatible with 2.4). I made a little bootstrapped script to do it for me… these are always fun ways to feel like you got some work done in 5 mins. include('./index.php'); $v24 = wire('pages')->get('/versions/2.4/'); foreach(wire('pages')->find("pw_versions=/versions/2.3/") as $item) { $item->pw_versions->add($v24); $item->save('pw_versions', array('quiet' => true)); echo $item->title . "<br>"; } If anyone comes across any modules that they find not to be compatible with 2.4, please let me know so that I can update the directory.
    4 points
  5. Thanks ceberlin! This is just a soft launch of 2.4, as I've still got some items to cover before telling everyone about it. However, I was feeling that 2.4 is already a lot better and more stable than 2.3, and that there's just no reason to have people download 2.3 anymore. So 2.4 is now the stable version, but it will still be getting some minor incremental updates for a little while. For those upgrading, be sure to read the upgrade instructions and additional upgrade notes.
    4 points
  6. Writing this quickly, have to run...there could be errors... I don't know what you mean by an included image but here goes: If talking about RTE (e.g. TinyMCE), yes you can include images from other pages... If you are talking about images inserted in pages via image fields, yes, you can grab this and output them in other template files. Just remember: $page will give you access to everything about the current page. If you want to get this page's images, oh well, see link below...;-) $pages will give you access to everything about other pages.. So, if you want images inserted in other pages, you will use $pages to get to them. How you get to other pages using $pages vary - you can get there by path, ID, name, etc...choose the selector that suits you. In some cases, people prefer getting there by ID in case they need to be very sure (since ID does not change). In other cases, people prefer getting other pages by their title since it makes for better human-readable code. http://processwire.com/api/variables/pages/ Also to remember. Sometimes people grab images from a multiple image field and try to echo them out and nothing happens. Point is? multiple image fields will return an array so you would need to loop through them using foreach or similar. Otherwise, for a single image field, you can just echo the image out. Now this may be misleading, you can specifically grab only one image from a multiple image field. In that case, there is no array, so just echo out what you want. I am not sure about best practice. I can't recall anyone here grabbing an image by its id. Pages, yes, but images can be tricky remembering ids. It is more common to grab images (all), or by their index in the array, eq(0), etc. A good practice though is to check if there are images before trying to output them (i.e. using "if"). This saves outputting blank HTML tags, getting PHP errors and sometimes is a good cure for headaches - why isn't my image showing?!? OK, enough theory. For some code, have a read in the docs about images; no need for me to reinvent the wheel: http://processwire.com/api/fieldtypes/images/. It also include image properties e.g. $image->filename. One more thing, at times, something some people forget; as with other fields, grab the images on a page using the name of the image field! People have been known to copy paste code and wonder why $pages->get("selector")->images doesn't work. For the "images", you need to use the image field's name . See also the cheatsheet: http://cheatsheet.processwire.com/ For more complicated scenarios, Google this forum. Some wonderful examples come up
    4 points
  7. Hi One of our last PW projects. The client: a little café in our beautiful little town of Freising near Munich. Site ist not finished yet... Feedback and suggestions welcome! http://www.parkcafe-freising.de
    3 points
  8. It's lookin great. If the silder is sliding some other element on the page move a little. ( Thats an artefact from BX Slider. ) This little annoyance can be solved by: .bx-viewport { -webkit-transform: translatez(0); -moz-transform: translatez(0); -ms-transform: translatez(0); -o-transform: translatez(0); transform: translatez(0); }
    2 points
  9. Hi opalepatrick When you align it adds a style to the element that floats left or right. In the original download for PW in the styles css you have the following: .align_left { float: left; margin: 0 1em 0.25em 0; } .align_right { float: right; margin: 0 0 0.25em 1em; } .align_center { display: block; margin-left: auto; margin-right: auto; } Those are the styles used in the editor which you can customise as you wish. If you want to add more style information you can use JQuery to addClass to your element as part of your template. I normally make sure that when I do a template, where I am using a RTE field I wrap that in a div with a unique class or ID so I can identify things like the <a> element that is wrapped round the image and add various bits to it. So, for instance, if I were using fancybox and needed to add the class and the group attribute, I would wrap the output in a div called blog then use the jquery $('.blog img').closest("a").addClass("fancybox ").attr('rel', 'group');
    2 points
  10. Pagetree Add New Child Reverse New Pages in Descending Sortorder (newest first) while sortmode can be "Manual Drag-n-Drop" When a site display an overview of the latest posts, news, image-albums, etc. the newest entries should be on top of the list. We can achieve that by using an automated setting for the sortfield e.g. when the page was created = "-created". But this way we are not able to manually move a single page in the tree. This module enables us to do exactly that. It works with manually created pages, with pages created via the API, also when bootstrapped by importer scripts. Pagetree "Newsitems" with 3 newsitems sorted in descending order. New created item 4 is added to the top. To change the order click item 3 and drag it to the top and drop it. How to use it Download the module into your site/modules/ directory and install it. In the config page you find a single textarea field. Here you can enter the templatename or page-ID of the page which children should get reverse added, - optionally followed by a comma and the child-templatename if you need a more precise selector. You can add as many parents as you like, but only one on each line and in this format: TEMPLATE-NAME or PAGE-ID[,CHILDTEMPLATE-NAME]. A few examples: newsitems posts,post 1042 1033,album You want set your template(s) sortfield(s) to 'Manual drag-n-drop' if not have done already. ATTENTION You need to setup the TreeParent and the module config when there are no children in it! Otherwise it will not work! Also disabling the module once you have added children and then add one new page to it will mess up all! (You may think about to install the module as permanent in critical situations.?! see below ->) If you need to install it in a site for an already existing branch, you can do it this way: move / rename your existing branch create a new (empty) branch with the original name move your childpages into the new branch remove the renamed (and now empty) old branch DOWNLOAD - Version 1.0.2 get it from the Modules Directory Want to make it bulletproof? If you are concerned that the module settings could be dropped by other users or that the module itself could be uninstalled by accident, you may edit the module file directly: add the settings to the class constant permanentValue uncomment setting for permanent in the ModuleInfo This way the permanent settings couldn't be dropped by accident. To change it you first need to edit the modules file again. Example: You have two settings in the inputfield of the modules config, without permanent setting: parenttemplate1,childtemplate1 parenttemplate2,childtemplate2 Now you want to have the the first setting become bulletproof permanent: a) you enable the setting in the getModuleInfo, (uncomment setting for permanent) b) you write your permanent settings under the constant permanentValue const permanentValue = "parenttemplate1,childtemplate1"; After both steps, the module cannot get uninstalled anymore (Step a), and the first setting cannot get deleted anymore (Step b), as it is recreated with every call of the configscreen. (See first code line of method getModuleConfigInputfields) If you want to keep both definitions permanent, write them separated with a newline character "\n" : const permanentValue = "parenttemplate1,childtemplate1\nparenttemplate2,childtemplate2"; History of origins create pages via API, how add to the top of tree? Create new child as top sibling rather than bottom? New page on top? Pin Page to Top of Page Tree? move and sort pages with the API
    1 point
  11. Nienburg Mittelweser is a Region in Lower Saxony/Germany. Our Job was to create an official campaign that engages young familys and skilled workers to settle down in Nienburg. The campaign tries to communicate the benefits of deceleration and living in an rural region in a sympathetic way. Apart from developing the whole Logo/CD/Imagery/Text our job was to create a Microsite that gives interested people a brief overview of the benefits of living in this region. The microsite is (of course/as usual) powered by processwire. http://einfach-lebenswert.net/ For those who don't speak german ( ) here are the 3 keyvisuals headlines translated in english: --> GROSSBAUSTELLE = Large construction site [in Nienburg-Mittelweser] --> KONSUMTERROR = pressures of a materialistic society [in Nienburg-Mittelweser] --> RUSH HOUR = Rush Hour
    1 point
  12. As you wait for other responses, have a look at the following examples from AdminSaveActions module. It looks really straightforward. Thanks for asking this question...I'll be needing this soon . Seems, you set the defaults in one function, then build the form/fields in another function using the defaults previously set...or something along those lines AdminSaveActions module static public function getDefaultConfig() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L51 public function __construct() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L105 public static function getModuleConfigInputfields(array $data) {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L390 MaintenanceMode module static public function getDefaultData() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L25 public function __construct() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L38 static public function getModuleConfigInputfields(array $data) {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L52 ProcessTrashman - Last one, static public function getDefaultData() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L42 public function __construct() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L54 static public function getModuleConfigInputfields(array $data) {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L255 MarkupRSS module - Sorry, the very last one (this one has more detailed defaults and some notes) protected static $defaultConfigData = array() https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L32 public function __construct() {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L67 static public function getModuleConfigInputfields(array $data) {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L219 Tutorial on forum - Create your first Module with configuration settings and a overview page: http://processwire.com/talk/topic/2318-create-your-first-module-with-configuration-settings-and-a-overview-page/ However, this Tut does not set defaults, which I think I have read somewhere is good practice to do? OK, sorry, am overdoing it but this will help me later too ;-) Edit: corrected wrong links + added a tutorial from the forums Edit 2: Something has been eating my links! Anyway, added methods/properties names...
    1 point
  13. Oh, WOW. In German: Alter Schwede, sehr sehr geil! Back in english: whoa, really impressive. Especially the little paralax effect (I hate site with TOO much of parallax). Nice color scheme, nice typo, nice organic forms - impressive, impressive! And a brillant showcase website for processwire! Good job!
    1 point
  14. . how abut class_exists("moduule") ?
    1 point
  15. Marty, I don't think there is a built-in method. Check here for a possible work-around, and Ryan's thoughts.
    1 point
  16. Why do you not ftp-upload the archive and bootstrap PW? You write a script (php-file) e.g. named "pw-archive-import.php" and put it in the root of your webpage (where you have pw index.php). I use this very often like that, (with some security in it): <?php // define userroles that are allowed to work with this script, like: superuser|editor|author $userRolesSelector = 'superuser'; // bootstrap PW require_once(dirname(__FILE__) . '/index.php'); // check user-account if( ! wire('user')->hasRole($userRolesSelector)) { header('HTTP/1.1 403 Forbidden'); exit(1); } WIth this example you first have to login into PW as a superuser and than call the URL to the importer-script with your browser to lets having fun. Than you can hardcode the path to your archive-data-file or pass it via a Getvar to the script, read / prepare the data and start to create and/or fill pages: // get your file, read it into an array $archiveData and start to import it: // here some (pseudo/example)code set_time_limit( intval(60 * 10) ); // give it 10 minutes, you may also increase this echo "<pre>\n"; foreach($archiveData as $data) { // check if a page with that id/title already exists $page = wire('pages')->get($data['your-page-uid']); if(0<$page->id) { // this page exist already, if we only want to import new pages, we skip echo "- page already exists: {$page->id}\n"; continue; } // we have to create a new page echo "+ create new page for {$data['your-page-uid']}\n"; $page = new Page(); $page->template = 'your-template-name-here'; $page->parent = wire('pages')->get(' ... your selector to match the parent-page of the new pages you create here ... '); // ->get only returns a single page, (->find returns a page-array) $page->title = $data['title']; // add all data to the fields you have to // don't forget to validate and/or sanitize the data if not have done already! .... // save the page $page->save(); // and optionally unload from memory wire('pages')->uncache($page); } Here are some links to bootstrap scripts / posts: http://processwire.com/talk/topic/4905-does-this-image-import-pseudocode-look-ok/ http://processwire.com/talk/topic/4437-delete-orphaned-filesimages-from-siteassetsfiles/#entry43687
    1 point
  17. Wow, adrian, this is just getting better and better. It makes it very easy now to use SVGs with automated PNG fallbacks for older browsers, which was my goal when I first encountered this module. It's also going to be useful with complex SVGs that tend to be heavy, which would make PNGs (or JPGs) more lightweight alternatives. My host is still installing the latest version of RSVG, which apparently requires updating quite a few dependencies. I'll let you know how it goes. Thanks again for you work and walking me through the debugging!
    1 point
  18. It seems a bit biased towards Foundation, this one... It's not that the author doesn't try to be objective, but the comparison seems at times to be between BS2 (and not BS3) and Foundation... For instance - BS3 is mobile-first. And it isn't just an add-on they glued to the 3rd installment, it is the main reason for v3 (and for how long it took). Also, the article implies that while BS3 has forceful fixed-width columns, Foundation doesn't, when it is the other way around - while BS3 gives you the choice between fluid and fixed rows (being that both respond to the same breaking points), with Foundation there is no fixed-width row option. It is relatively easily implementable but still.. --EDIT-- Only after writing this did I notice "Updated to Foundation 5 and Bootstrap 3" - Being that this was probably a comparison between older versions (and being that BS3 was a complete overhaul), it explains the biases I noticed...
    1 point
  19. @dragan: if you're literally using var_dump(), it should be noted that it doesn't return anything. In order to store it's value in a variable you'd need to use output buffering or some other trick. Another option is to use print_r() with return param set to true. Main difference between var_dump() and print_r() is that var_dump() provides more information about the data types involved, while print_r() only outputs content. Edit: you should also take a look at this comparison between var_dump(), print_r() and var_export().
    1 point
  20. More comparisons: http://responsive.vermilion.com/compare.php?framework=current http://usablica.github.io/front-end-frameworks/compare.html http://archetyped.com/know/redesigning-archetyped-comparing-css-frameworks/ The article linked by adrian has good points. When you design mobile-first, you avoid potentially having to retrofit your responsive design (painful).
    1 point
  21. note: I do use Font Awesome page label, but that one should be updated soon. Just After the release of that module, Ryan included Font Awesome int the core, next, it didn't took long before Font Awesome updated to the the new classNames. I really think that module deserve to be updated and it have to rewritten entirely. It has to adapt to how the how the things are now. I simply didn't had the time to do so.
    1 point
  22. @Joss, I have enjoyed myself today working with your Foundation 5 profile. I have learned some new things and now I have been exposed to better ways of creating my websites. Thanks. The link to ProcessWire in the footer.inc file has a slight error. "htp://www.processwire.com" should be "http://www.processwire.com".
    1 point
  23. Will "old" admin themes be supported also in future versions? I'm using a customized version of Soma's great teflon 2 admin theme for a project. After upgrading to the newest dev version, I could uninstall the new Admin theme and so far the Teflon seems to work without problems. I love Pw!
    1 point
  24. From someone who hasn't really used either yet but is contemplating it (need to see what all the fuss is about), this is a decent article: https://medium.com/frontend-and-beyond/8b3812c7007c
    1 point
  25. @nfil, if Ryan's Foundation 4 profile is working for a multisite setup, mine should be, too. Because it is based on Ryan's. Only changes I made is adding Foundation 5 scss files and change the structure so that only a single css file is output.
    1 point
  26. Hi Joss, Why not design it from scratch? I understand that BS and Foundation are fast starting points but don't they just complicate things by having to sift through all their code to work out what does what? Not to mentioning loading code you never use. BTW on your Stony site there's a typo in the footer: Site Design ©2012 Stony Webistes
    1 point
  27. Hi Pierre, Welcome to the forums. Actually, lots of us have been using 2.4 for a while now..But that is now history, 2.4 is now in RC status! A newsletter went out late last week to this effect. An official announcement is soon to follow. You are good to go! Edit I forgot to respond to the issue about upgrade. Nothing breaks upgrading 2.3 to 2.4, at least not in the core. And I haven't heard of any of the custom modules breaking either...
    1 point
  28. I've recently updated my website. This is the first site I've made in it – although I have one other that's in progress (which unfortunately may never be used) – and compared to the process of making a site in something like Wordpress it was far simpler and quicker, and is much cleaner, easier and streamlined for updating, etc. It's a fairly simple site made with Twitter Bootstrap, Masonry.js and making use of the Dribbble API, with the aim of letting the images do the talking.
    1 point
  29. Hi Gebeer The main scss is foundation.scss in the scss folder. That in turn imports all the various foundation.scss files. This is then output to foundation.css using whichever method you want. Other than that, there are four other css files: editor.css has some basic foundation typography styles that can be used by whichever RTE you wish foundation.min.css is just the normal foundation download and is not linked - it is just there for reference. normalize.css - this is the normalize script included with foundation site.css - this includes some PW styles and any oddments that you want to have at your fingertips - for instance I have used it for some header styles and row styles. The reason I have laid it out like this is so that the foundation framework is distinct from anything else. If a dev then wants to combine elements, that is up to them, but their starting point is the same as if they had imported foundation straight from the zurb repository. They should be able to replace my foundation.css file with the original from Zurb and the site will still work, other than some colours. After that, they can bend it as they wished, but in this particular version, I did not want to add too many surprises for people who have used Foundation elsewhere
    1 point
  30. Good to now! I was able to pull this off like this for now. Thanks a lot for your input! Maybe a config page will be better for a public module, off course. <?php class EmailNewUser 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( // The module's title, typically a little more descriptive than the class name 'title' => 'Email New Users', // version: major, minor, revision, i.e. 100 = 1.0.0 'version' => 101, // summary is brief description of what this module is 'summary' => 'Send New users a welcome email', // Optional URL to more information about the module 'href' => '', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => true, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => true, ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->pages->addHook('saveReady', $this, 'sendEmail'); } public function sendEmail(HookEvent $event) { $page = $event->arguments[0]; if ($page->template != "user") return; // stop here if this isn't a User // Only send an email if the User page is published (A new User goes live) if($page->isChanged('status') && !$page->is(Page::statusUnpublished)) { $body = "Welcome {$page->name}!"; $this->message("Welcome {$page->name}! A welcome email has been sent to {$page->email}."); @mail($page->email, "welcome, {$page->name}!", $body, "From:xxxxx@xxxxx.com"); } } }
    1 point
  31. 2.4 will be released once the dev branch source has sat for a week or so without any necessary fixes or major additions (meaning, it's reached a stable state). I think that's probably soon, but don't want to promise any dates since I'm actively working on the code almost every day.
    1 point
  32. 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#entry34110
    1 point
  33. I've never seen a panther fly... but if they would it would be more elegantly than a pig for sure
    1 point
×
×
  • Create New...