Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/25/2014 in all areas

  1. I've just pushed to GitHub new version of this module. This update includes some minor improvements, such as storing version data for pages starting from the moment they're added, and as a bigger addition $page->snapshot() feature exactly as described by @SteveB earlier: echo "Page title now: {$page->title}<br />"; $page->snapshot("-1 week"); echo "Page title last week: {$page->title}<br />"; I've been working on and off this for a while now and actually had to write a bunch of PHPUnit tests just to make sure that everything works as expected (too many moving parts to keep track of manually.) There's still some work to do here and especially performance-wise more tests to be made, but at least this shouldn't disrupt how other parts of the module work
    9 points
  2. Update 09.05.2014: new version of minimize.pw released. I've updated this post and you can read more here. ProcessImageMinimize A service and module to make images lightweight: minimize.pw Our new commercial service for ProcessWire: minimize.pw With minimize.pw, you can shrink your images (JPG and PNG) without noticeable visible differences up to 80%. This makes pages load faster and helps you to work with people not familiar with command line image compression. You can try it for free. Learn more Download the module Github Page Module features Hooks into any Pageimage with ->minimize() (short ->mz() ) Automatic compression with a 1-click-setup (new) Overwrites original files or keeps both versions (new) Image compression with minimize.pw Fail-safe mode so that your visitors won't notice any problems if we're offline or you have no volume left. Usage with templates First, download and install the module. You have to enter a license key. Get a free license key hereTo embed a minimized image into your web page, simply call the method mz() or minimize() on your Pageimage-object. Please note, that is has to be a single Pageimage. We also support apeisa Thumbnails module. $img = $page->image; $img->minimize(); Or put in context $img = $page->image; echo "<img alt='A minimized image' src='{$img->minimize()->url}'>"; You can also use it combined with other Pageimage methods: $image->size(300,400)->mz()->url; Read more at Github Pricing While the module is free, our service is fee-based. We have to pay for servers and traffic With this version we've dropped our year-based pricing structure and introduce a new volume-based pricing. Everyone gets 2000 images for free and you can buy additional volume anytime. Free: 1000 images once 5000 images / 19€ 15000 images / 39€ 50000 images / 89€ Buying more volume will also drop the site limit of three. Questions Feel free to ask any question you might have.
    7 points
  3. I agree. Everyone please vote if you haven't already. This would be good exposure for ProcessWire. I hope to get an email distribution sent out for those that might not yet know about this, but don't want to send it till the last couple days of the contest (urgency produces better results with those things).
    7 points
  4. Following up from the previous message, the update is now committed to dev. I ran a test install, and all appeared to work well (Chrome / OS X). If anyone else gets to test it out in other browsers or platforms, please let me know if you run into any issues. Here's what the color theme selection looks like (screenshot attached) ... basically just a select box that swaps the stylesheet with an onchange event.
    5 points
  5. Ok I've got the admin colors selection built into the installer now (with live preview even). Installer also now uses the new theme. I ran out if time before I could get it in GitHub (now at my girls' swim practice), so hope to get it committed to dev later today.
    5 points
  6. I really like all the work & love you've put in this module. I consider this one, one of the best modules available for ProcessWire. I have big respect not only for the the module it self, but also for the care you take for this.
    4 points
  7. Actually, on the topic of the default look. I personally quite look the futura color scheme, and I don't mind the warm (your current default), but I wonder if "modern" should be the default since it most closely matches the color scheme of the PW website. So, while the website looks as it does, I think that "modern" would be my vote for default "color set" and for the installation routine. Anyone else have a preference?
    4 points
  8. The password requirement has been retired for at least a couple of months now on the dev branch. https://github.com/ryancramerdesign/ProcessWire/issues/278
    3 points
  9. This is not intended behavior. Good call. It's happening because the TemplateFile class is checking if the file it's given exists from the constructor rather than from the render() method. The PageRender module gets a copy of the TemplateFile instance from the Page, and then changes the filename if you've given if one. As a result I think I can solve this just by moving the "file does not exist" exception out of the TemplateFile constructor and to the render() method. I've just made the change, so it should appear in the next batch of commits to dev.
    3 points
  10. I agree here with Adrian. I really like that ProcessWire, still looks like the ProcessWire I started with. This is a sign of great vision & craftsmanship
    3 points
  11. yep, context RTE. Reason, make those linebreak visible, so content editors are aware of those breaks. Lot's of time, the writers use line-breaks when they shouldn't, or don't know that they are using those. So that red, green & gray is done with CSS pseudo elements. Here you can see that the header also includes a strong tag, I don't like that so, there's the visual feedback. Ps, I did solve it, but don't like as I press solved, it tells me: Best Answer
    3 points
  12. Somehow content editors love the <br> tag. On a 'random' base, the're putting in a line break. The cases of double <br> is easy to solve, but the single ones are just a pain in the *ss, as they could be intended. Think 80% of the <br /> makes me <grrrr />. For other elements I can use some pseudo elements to foo-doo visualize when they are used. For br thats not possible without some javascript I think. I even think: Disallow br tags at all.<br> How do you guys solve this.? Putting this in the the CSS, will visualize the BR. p br { content: "*"; display: block; margin-bottom: 0; line-height: 1; } p br:after { content: "<br>"; display: inline; background: red; color: #FFF; font-size: 12px; border-radius: 2px; margin-right: 2px; padding: 0 4px; float: left; }
    2 points
  13. Always eager to learn something new! Unless it's beyond my comprehension....
    2 points
  14. I know I am hijacking this, but teppo brought it up first Although, I am not sure that anyone outside Australia got these ads, but they played for a long time when I was growing up! I'd also like to see an option for the color scheme to be chosen during installation!
    2 points
  15. Hanna Code doesn't actually execute from the DB. It writes each Hanna code to a file in /site/assets/cache/HannaCode/ and then uses the DB copy of the code to compare against the one on the file system, to make sure something hasn't changed the one on the file system. It executes the PHP code from a file in order to ensure it is as fast as possible (avoiding eval) and in the same context as a template file. That's what it does behind the scenes, but Soma's tip is just as useful either way, as Hanna Code wouldn't let you edit its own PHP files directly.
    2 points
  16. I like warm. Feels all... warm Could just be an easy installation choice I think.
    2 points
  17. to continue the thoughts of adrian and Martijn: why not drop the (old) theme in /wire/templates-admin/? Is it technically needed? Instead of that make the new AdminThemeDefault preinstalled by default and preselect the most liked color scheme (Modern ?). In the moment it's a little bit confusing for PW newbies. At first they get the old admin after installation, then they have to find out how to get the new AdminThemeDefault.
    2 points
  18. Lovely job, Ryan! I was so close to booking a 10+ person venue for an impromptu ProcessWire gathering at Calvigny, but $52K per night just sets off my grunge alarms. Maybe the pools aren't refilled nightly or something, you never know.
    2 points
  19. Ah, ok. You may also try to create a simple php script somewhere outside of pw with this content: <?php header("location: http://www.your-site.com/page-url-with-mail-script/"); or with this one: <?php file_get_contents("http://www.your-site.com/page-url-with-mail-script/"); and call that with your cronjob.
    2 points
  20. Well, I'm no pro at this and you could probably improve it, but here's my attempt which serves my current needs pretty well: /** * Creates a repeater field with associated fieldgroup, template, and page * * @param string $repeaterName The name of your repeater field * @param string $repeaterFields List of field names to add to the repeater, separated by spaces * @param string $repeaterLabel The label for your repeater * @param string $repeaterTags Tags for the repeater field * @return Returns the new Repeater field * */ public function createRepeater($repeaterName,$repeaterFields,$repeaterLabel,$repeaterTags) { $fieldsArray = explode(' ',$repeaterFields); $f = new Field(); $f->type = $this->modules->get("FieldtypeRepeater"); $f->name = $repeaterName; $f->label = $repeaterLabel; $f->tags = $repeaterTags; $f->repeaterReadyItems = 3; //Create fieldgroup $repeaterFg = new Fieldgroup(); $repeaterFg->name = "repeater_$repeaterName"; //Add fields to fieldgroup foreach($fieldsArray as $field) { $repeaterFg->append($this->fields->get($field)); } $repeaterFg->save(); //Create template $repeaterT = new Template(); $repeaterT->name = "repeater_$repeaterName"; $repeaterT->flags = 8; $repeaterT->noChildren = 1; $repeaterT->noParents = 1; $repeaterT->noGlobal = 1; $repeaterT->slashUrls = 1; $repeaterT->fieldgroup = $repeaterFg; $repeaterT->save(); //Setup page for the repeater - Very important $repeaterPage = "for-field-{$f->id}"; $f->parent_id = $this->pages->get("name=$repeaterPage")->id; $f->template_id = $repeaterT->id; $f->repeaterReadyItems = 3; //Now, add the fields directly to the repeater field foreach($fieldsArray as $field) { $f->repeaterFields = $this->fields->get($field); } $f->save(); return $f; } And here's an example of calling it: $f = $this->createRepeater("sc_promos","sc_promo_active sc_promo_code sc_promo_discount","Promotional Offer","shoppingCart"); You can then use $f to add your new repeater field to a fieldgroup/template.
    2 points
  21. Ok, sorry for the delay on this. I have added the ability to rename files uploaded via the API. It works on my testing using something simple like: $page->images->add("/local_path_to_image/image.jpg"); $page->of(false); $page->save(); I have attached a revised version of the module, rather than pushing to github for the moment. Please let me know if it works ok for you. I am not sure how your upload form is working, but at the moment the module will rename the file in its original uploaded location before copying it to the final ID based folder under /assets/. I am not sure if this will work in all scenarios, but I had to use a "before" hook on "Pagefile::install" so that I could still change the filename using: $event->setArgument(0, $newFilename); Using a before instead of after hook means that I am working with the file in its original location. It also means the module can't handle images from remote servers with full http:// paths. Does anyone have any ideas how I might be able to rename after it has been move to the assets/xxxx/ folder? None of the InputfieldFile hooks get called with API uploads, so they are out. I am thinking maybe I might need Pagefile::setFilename hookable, but I'd love to hear any ideas on how to do this. On an unrelated note, I have also added the ability to drag/drop sort the rules in the module settings, making it easier to change the order as needed, which can be important if you have a lot of very specific rules that need to take precedence over more general ones later in the order. CustomUploadNames.zip
    2 points
  22. I've been working on this one for a few months and just launched it this morning: http://villasofdistinction.com I also did the previous iteration of this site, 5 or so years ago (which was running ProcessWire 1.0). The new site is powered by ProcessWire 2.4 (2.3 dev). The site is responsive and designed for a good experience on both desktop and mobile. While I did all the development, the site's design/look and feel was created by the client (they have their own internal design agency). Most of the work in this project was actually not anything you can see on the front end. Instead, most of the work went towards back-end management, workflow and web services. The client has a large number of editors and agents that needed various capabilities, workflows, feeds and such. So there's a lot more going on here in terms of a management platform than in the previous iteration... and that's mostly what kept me busy for so those few months. Modules used here: Foundation 4 Profile All In One Minify (AIOM) FieldtypeMapMarker (with MarkupGoogleMap) Pro Cache Form Builder Hanna Code Redirects Selector test Changelog Version Control for Text Fields Batcher Admin Template Columns CKEditor Select Multiple Transfer CollagePlus And a few custom modules
    1 point
  23. Working fine on Win7, Chrome. Just installed with the 'Futura' color scheme. This was actually the first time i bothered with changing the default admin theme, but i like it. Biggest shocker though is that the installation screens have also been updated; gone are the 'vintage' screens i've looked at so many times (but it's a good change)
    1 point
  24. Really, really lovely website!! https://minimize.pw/
    1 point
  25. Glad to hear that you found a solution, but in a case like this I'd really suggest taking a look at bootstrap method. It's perfect for tasks like these, where you don't really want or need actual page, just code that can access data and/or features of ProcessWire.
    1 point
  26. It minimizes the images the same way thumbnails (e.g. ->size(120,60)) are generated. The image takes the trip to minimize.pw and returns. So the first time, your page loads you will notice the longer page loading speeds. After that, the minimized image is served from your disc. It takes around 15seconds to compress 5MB PNGs to 1.3MB PNG or to compress two 6MB JPGs to 3MB JPGs. The next milestone for the module is a feature where it will replace the image directly after upload - so the minimized version will be the only version on your disc and the performance should be better. Another plan includes an async method to send the images back "behind" the scenes - but only if there is a need for such a function.
    1 point
  27. PRINT "I LOVE MY COMMODORE" You key in this and press RETURN I LOVE MY COMMODORE The computer prints this READY ▋ Admittedly this is a border case for a book-related thread, but I simply couldn't resist after todays comments in the admin theme thread: anyone remember that user manual C64 shipped with? The one that was part how-to guide for using C64.. but mostly an introductory book for Basic programming? Well, for those who do remember (or don't but would like to) it's available as an HTML version from lemon64.com.. and commodore.ca has even more of that same stuff in PDF format. They really don't make manuals like that anymore (probably for a good reason -- just imagine a modern PC or Mac shipping with C/C++/Objective C manual) but that's also one of the few manuals I remember reading from cover to cover more than once.. and actually enjoying it "Before you can use sprites it's important that you understand a few general things about how computers work.."
    1 point
  28. Your variable names makes me a little dizzy. For better responds on this forum maybe you can make clear & proper english/american variable names.
    1 point
  29. Tested out here and works very well, good results, and was easy to implement. Nice work Philipp!
    1 point
  30. I don't think that you could get two instances of ProcessWire running from the same PHP script. Perhaps that's something we should work towards for the future (and we really aren't far from it), but currently the convenience and simplicity of being able to use functions like wire('api var'); among others, takes precedence over true isolation of the ProcessWire instance. While I've not tried it, I'm pretty sure this would prevent you from having more than one PW instance operating from the same PHP script. You would need your multiple PW instances to use more traditional web service communication.
    1 point
  31. That error is caused by the fact that you run this file without involving ProcessWire at all. You can't just run template file "standalone" and expect it to automatically load ProcessWire, you know Solution @horst provided above is most likely what you need here (or external / real cron job instead of this awfully limited scheduler thing you're using now). Then again, if this is the only reason you need that template, i.e. it doesn't need to be web-accessible, you could forget whole template and page thing and simply place a PHP file somewhere your scheduler can access (such as your PW root directory) and in that file bootstrap PW and write any program logic you need. Point your scheduler to that file and you're all set.
    1 point
  32. Nice work - that's pretty much exactly what I was thinking. I am not sure about setting the flags to system and permanent though as the defaults for a function. I think there should at least be a comment on that line that users should adjust to their needs as I don't think this is a typical use case. Glad to see that code of mine is getting some use - I have to say it was quite an effort to figure out and as you said, very un-PW in its complexity. I would love to hear from Ryan as to whether there is an easier way to achieve this. Also, for the sake of putting all the information about creating and working with repeaters from the API in one thread, I think it is worth mentioning the special getNew() method for creating repeater items. It is used in the Page Tree Migrator module and described in detail on this page: http://processwire.com/api/fieldtypes/repeaters/
    1 point
  33. Good it's solved. But there's more then meets the eye. The last site move I did was problematic to. Looks like there were issues with the file ownership/permissions also after unzip. At the end, I did a fresh install of PW, then ftp'd the site folder, dropped the database, and imported the SQL dump.
    1 point
  34. Admin > Setup > Fields > your-field ` input ` Custom PHP code to find selectable pages
    1 point
  35. Like I mentioned here before, strange things seem to happen on the last few days. I do think a little more effort could be made to get processwire some more votes. it is a couple of months now since i asked Bitnami to register processwire for the contest and started the ball rolling back in November. http://processwire.com/talk/topic/5043-vote-for-processwire-on-bitnami/?hl=bitnami Such was my excitement at discovering processwire. I have felt since then that the push to win this is a bit lacklustre. Let's rally in the troops and win this.
    1 point
  36. Ryan - just wondering if you are planning on theme-ing the installation routine to match the new default admin theme before 2.4 is released? I think it's important for maintaining a cohesive look for PW.
    1 point
  37. Thanks! I've been lurking in the shadows for awhile now and working on my first big project. I'm loving it more and more. That worked like a charm. When I'm done with this project, I'm going through each line of code to see if I can become fluent. I'm like a kid in a candy store with this CMS.
    1 point
  38. Ah just read end of post again.. mobile. So just to clarify. This hook only modifies the url returned from a $page->url. Not handle the request of that url. You only half way there. To catch that url which doesn't exist you would need enable url segments on home template and write a handler in template file. Check for first segment and if a name found render that page instead. For any other you throw a 404.
    1 point
  39. some (translatable) strings in modules to fix (PW dev 2.3.13) \wire\modules\Inputfield\InputfieldPageName\InputfieldPageName.module line 206-210 $field->label = __("Character replacements"); $field->description = __("Enter the replacements that will occur when a user is entering characters into a page name field. ") . __("Enter one replacement per line in key=value format. ") . __("Meaning, on each new line, enter the character(s) you want to replace followed by an equals sign '=' and the ascii character(s) you want to replace with."); line 212 $field->notes = __("The replacement value for each must be one or more of: a-z, 0-9, dash, underscore or period."); \wire\modules\Fieldtype\FieldtypePage.module line 739-740 $inputfield->label = __('Find and clean orphaned page references'); $inputfield->description = __('This cleans up for an issue in older versions of ProcessWire that could leave orphaned page references for deleted pages. If you are getting inaccurate results from page finding operations (especially with selectors using pageref.count), then you may want to run this.'); line 743 $inputfield->notes = __('Warning: To be safe you should back-up your database before running this.'); \wire\modules\PageRender.module line 391-392 $f->label = __("Clear the Page Render Disk Cache?"); $f->description = __("There are currently $numPages pages cached in $path"); EDIT: \wire\modules\PageRender.module line 392 is not translatable? Changing text in the translation doesn't show the new translated phrase in the module setting. It stays english. \wire\modules\Process\ProcessPageSearch\ProcessPageSearch.module starting at line 838 - 863 $inputfield->label = __("Default fields to search"); $description = __("Enter the names for one or more text-based fields that you want to search, separating each by a space. "); $inputfield->description = $description; $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldText"); $inputfield->attr('name', 'searchFields2'); if(!isset($data['searchFields2'])) $data['searchFields2'] = 'title'; if(is_array($data['searchFields2'])) $data['searchFields2'] = implode(' ', $data['searchFields2']); $inputfield->attr('value', $data['searchFields2']); $inputfield->label = __("Field(s) to search in admin search (ajax) mode"); $inputfield->description = $description; $inputfield->notes = __("We recommend limiting this to 1 or 2 fields at the most since results populate a live autocomplete field. Typically you would just search the 'title'."); $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldText"); $inputfield->attr('name', 'displayField'); $inputfield->attr('value', isset($data['displayField']) ? $data['displayField'] : 'name'); $inputfield->label = __("Default field name(s) to display in search results"); $inputfield->description = __("If specifying more than one field, separate each with a space."); $inputfields->append($inputfield); $inputfield = Wire::getFuel('modules')->get("InputfieldSelect"); $inputfield->attr('name', 'operator'); $inputfield->attr('value', isset($data['operator']) ? $data['operator'] : self::defaultOperator); $inputfield->label = __("Default search operator");
    1 point
  40. I've pushed some updates to the CKEditor Inputfield fixing some bugs and updating to the latest version of CKEditor (4.3.2). I recommend upgrading if you are already using a past version. I've also added a couple of detailed tutorials to the README file including: How to make your own custom styles menu How to customize the appearance of the editor While you are upgrading, be sure to grab the latest version of the HTML Purifier module as well.
    1 point
  41. Exactly as you said it, thanks adrian. The fault was entirely my own -- when I couldn't get the relative path working I jumped to the conclusion that the spaces in the filename were causing issues. That, of course, was a dead end. final working code for anyone interested: // do a bunch more stuff $p->save(); echo "saved id:{$p->id} {$p->url}\n"; // add images, y u no store? // Answer: using relative path was wrong (and rawurlencode is unnecessary) // $p->images->add( "./images/" . rawurlencode($row["image"]) ); // get the full server path to processwire, and from there the images $path = $config->paths->root . "test/images/" . $row["image"]; $p->images->add( $path ); $p->save(); Thanks again, Adrian.
    1 point
  42. One more tweak this morning. There is now the option to preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. I am not sure if this is what @peterfoeng was looking for in his post above, but hopefully people will find it useful regardless. For the moment, this new version is only available as the attachment here. CustomUploadNames.zip
    1 point
  43. The full path to the image would be: /home/samplers/public_html/dev/test/images/Best MCC Pic-2.jpg When PHP is doing file operations you need to use the path, as opposed to the URL, which would be: http://dev.domain.com/test/images/Best MCC Pic-2.jpg
    1 point
  44. You can go to Settings on the page you are editing and there is a "Created by User" field that you can change to the user you want to be the author.
    1 point
  45. I finished "Rework" the other day - great book that I wished I'd read sooner. Don't get me wrong, so much of it is common sense, but a lot of common sense is things you don't think about until after it's been pointed out to you or after you've made your mistakes (basically common sense isn't always common ). It's over 200 pages, but none of the sections is more than a few pages and they've dropped illustrations in every couple of pages, so it's not a difficult read by any means and could be read easily over a few evenings or an afternoon. Currently reading "Remote: Office Not Required" by the same guys. I've not read "Getting Real" yet but I'll add it to my list. My family were a little confused as to why I was asking for work-related books for Christmas, but I knew these would be fairly easy-going.
    1 point
  46. Looks like we've got a bug here on the dev branch (if that's what you are running?). First, update to the latest version of the dev branch. Then edit your /wire/core/InputfieldWrapper.php and add this line as the first line in the getChildByName() method: if(!strlen($name)) return null; Does that fix it? I think it will, but am not in my office to test yet. I can't yet find any indication of why this wouldn't work, and have it in use on a few sites. Make sure your dev version is up-to-date. Also make sure that you don't already have a "custom PHP code" or "custom selector" specified that might be overriding your template setting. If you still can't get it to work, let me know and I'll attempt to reproduce when back in the office. Another way you can get the same behavior would be to use the "custom selector" and specify "template=your-template".
    1 point
  47. Personally, I think PW is better off focusing on the CMS rather than worrying about building a forum solution. This just distracts and removes time better spent on expanding and improving an already excellent CMS. There are plenty of exceptional forum solutions out there already, why not use one of them? A native one just become a lot more work starting from scratch when tons of options already exist. That's my two cents.
    1 point
  48. This should do it throw new Wire404Exception();
    1 point
×
×
  • Create New...