Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/07/2016 in all areas

  1. MediaLibrary Update: MediaLibrary can now be found in the official module list. Out of necessity, I've started to implement a simple media library module. The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree. The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality. I've put the code onto github. This module is compatible with ProcessWire 3. Steps to usage: Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look. Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple. There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section). Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library. Edit 01.05.2016: Version 0.0.8: - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker). - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries. - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries. Edit 10.10.2018: Version 0.1.3: - Dropped compatibility for ProcessWire legacy versions by adding namespaces - Allow deletion of libraries from the Media overview admin page - Added an option to hide media libraries from the page tree (optionally also for superusers)
    15 points
  2. Happy to announce that Media Manager (Beta 001) is ready for release! I had to change the view/edit modes to streamline these into one unified interface. I think it works better as can be seen in the video below (or if can't access YT, see this instead). I am working on the documentation this week and 'preparing shelves at the shop' with an aim to officially release the module next week or early the week after at the latest. If you can't wait that long and would like to get your hands on a copy soonest, please send me a PM. I am also finalising a pricing model. Initially, support will be via email. Thanks for your patience
    7 points
  3. outputformatting is always off when bootstrapping pw so your file-fields will always return arrays no matter what the setting in the admin is ps: yeah - the once in a lifetime moment when adrian has already posted a reply and i added (little) additional value with my answer. i will print that post and hang it up in my living room
    4 points
  4. My primary application will be for our intranet site where we have complex product datasheets and configuration information that link to parts sheets, supplier information, technical standards and whatnot. Keeping linked documents up-to-date is quite important, and with today's innovation speed we've got about twenty to thirty doc updates per workday. I'll probably keep creation rights for the MediaLibrary template limit to admins though, to avoid over-eager users cluttering every page with a media child (just in case...).
    4 points
  5. A first comparision in filesize & processing time among the first 4 engines with different qualities. Sharpening is set to soft here. Without sharpening, the Netpbm is much faster, but also more blurry than IMagick without sharpening. In regard of filesize and visual quality, Netpbm is better than IMagick. For the overall usage, IMagick as PHP extension is best optimized for speed with a very good visual quality. It is also faster than the IMagick-CLI engine in most cases.
    4 points
  6. Hi everyone, Thanks to a request from @Ralf, this module now also works on the front-end. If you have setup your own login form and profile editing forms you can enable this for the front-end and specify a URL to redirect to for the user to change their password.
    3 points
  7. Here is a better comparision, including all 4 sharpening modes and with 280px images output. I only post the link of an PNG screenshot here, because it is 8MB: http://images.pw.nogajski.de/assets/screen_255.png Here are the values, without the thumbnail images:
    2 points
  8. Looks like the homeboximage field is not set to "1" for the Max Files Allowed setting. Either change that, or do: echo $homebox->homeboximage->first()->url;
    2 points
  9. Related to this: https://github.com/ryancramerdesign/ProcessWire/issues/1728 ?
    2 points
  10. Yes, there's obviously a danger to add too many files to a library and make things convoluted. There's a point where simple dropdowns aren't practical anymore, but then, structuring information always is an ongoing task. That's a reason why one of the next points on my todo-list at work is a small module to show file usage (i.e. which pages' html fields link to a given pagefile), though that's probably going to be less pratical as I'll use a custom link and image url extractor in our OpenSearchServer to get quick results and avoid parsing multiple fields in a few thousand pages in the database for every file. I haven't read that book, but getting acquainted with tool sets and release procedures before forming bad habits sounds like a good plan, even if not everything (like e.g. composer use) can be used for every project. It's often harder to un-learn a bad habit than learn it the right way first.
    2 points
  11. Hello, you should mark this thread as answered if this is the case. Nice site anyway
    2 points
  12. A ProcessWire Fieldtype storing files in a customized location, outside the web root. This module is primarily useful if you need to store sensitive data which should not be accessible directly from the web. Normally, ProcessWire stores all files under /site/assets/files. Direct URL access to these files can be restriced by setting $config->pagefileSecure = true. Still you need to make sure that your template permissions are setup correctly. If something goes wrong, those files could be accessed from outside. GitHub: https://github.com/wanze/FieldtypeSecureFile Modules Directory: http://modules.processwire.com/modules/fieldtype-secure-file/ How does it work? After installing this module, you can create a new field of type SecureFile. Enter your configuration under the "Details" section when editing the field: Storage Location Enter a path outside the web root where the files are stored. You need to create the directory manually. Also make sure that the user running the web server has write permission. Roles allowing to download a secure file Users with a role selected here are able to download the files if a download is requested via the API. Allow Download in Admin If checked, users having a role selected above can download the files when editing a page. I needed this functionality for a recent project, so I created this module and thought to share it, mabye this is useful for someone else Consider it beta, I'm using it on one site but I'm sure it could be improved here and there. Feel free to suggest additional features! Cheers
    1 point
  13. ImageSizerEngine ImageMagick CLI Version 0.1.1 beta (requires PW 3.0.10+) Get it from the modules directory or from github. For information what it is and how to use and install, please read this Blogpost.
    1 point
  14. Sorry there's no example CSS. Definately something I try to add. Write your CSS with using the css classes the module gives you by default. . Often not much is needed. Also you can change the class names and use various tpl options too to add your own. I mostly use the default and give the "outer_tpl" => "<ul class='main-menu'>||</ul>" as a starting point.
    1 point
  15. Then in that case you would simply need to tell the module what root your menu has. Default is "/". (third argument) Most common is for example use the $page->rootParent() as the root. ($page->rootParent() will always return the root level page of the current page even if on a root page itself) echo $tree->render($options, null, $page->rootParent());
    1 point
  16. @surffun it's the "collapsed" => true, option.
    1 point
  17. This could look like this in a template $arrayData = array( "success" => 1, "products" => Array( Array( "id" => 1, "type" => 6, "name" => "product1", "title" => "Product1", ), Array( "id" => 2, "type" => 5, "name" => "product2", "title" => "Product2", ) ) ); class MyData extends WireData {} $someData = new WireArray(); foreach($arrayData['products'] as $prod){ $p = new MyData(); foreach($prod as $key => $val) $p->$key = $val; $someData->add($p); } $someData->sort("-type"); foreach($someData as $r) echo "$r->title<br/>"; $result = $someData->find("title=Product1"); foreach($result as $r) echo "$r->title<br/>";
    1 point
  18. Hello gyus, I recently update one website from pw 2.7 to 3.0.10 and I'm getting a strange error, the code is this one $check_vid = $config->paths->root."video/111.mp4"; if ( file_exists($check_vid)){ do things } I get this error Fatal error: Exception: Download URLs must begin with http:// or https:// (in /home/disinibi/public_html/tube/wire/core/WireHttp.php line 576) any Idea why it's trying to download the file?
    1 point
  19. mmm thanks I didn't see that
    1 point
  20. Here you go German buddies (only 720p though on Vimeo)..
    1 point
  21. This part of the domain is set in the settings tab of the homepage on the name field(s).
    1 point
  22. Afaik the header is just a convention. The usage of it in libraries might vary.
    1 point
  23. Hello again, while I evaluated possabilities around reusing the image dialog outside of CKE (https://processwire.com/talk/topic/10009-image-field-select-image-from-another-page/) I did a introspektion of CKE's pwimage plugin (indeed I reused a lot of the given logic). Because I don't like the way, the plugin grabs its image information in a big bulk of code, I started to refactor the code and ended in something like this (excerpt): [..] this.config = { uri : ProcessWire.config.urls.admin + 'page/image/' , selectors : { image : '#selected_image' , captionWrapper : '#wrap_caption' , cbLink : '#selected_image_link' , cbHiDpi : '#selected_image_hidpi' , cbCaption : '#selected_image_caption' , inDescription : '#selected_image_description' , inRotation : '#selected_image_rotate' , inPageId : '#page_id' } [..] }; [..] , getImageProperties : function (jImage , jIframeContent) { var that = this; var jImage = jQuery (that.config.selectors.image , jIframeContent); var jCheckboxLinkToLarger = jQuery (that.config.selectors.cbLink , jIframeContent); var jCheckboxHiDpi = jQuery (that.config.selectors.cbHiDpi , jIframeContent); var jCheckboxCaption = jQuery (that.config.selectors.cbCaption , jIframeContent); var jInputDescription = jQuery (that.config.selectors.inDescription , jIframeContent); var jInputRotation = jQuery (that.config.selectors.inRotation , jIframeContent); var jInputPageId = jQuery (that.config.selectors.inPageId , jIframeContent); var flipHorizontal = jImage.hasClass ('flip_horizontal'); var flipVertical = jImage.hasClass ('flip_vertical'); var src = jImage.attr ('src'); var cls = jImage .removeClass ('ui-resizable No Alignment resizable_setup') .removeClass ('rotate90 rotate180 rotate270 rotate-90 rotate-180 rotate-270') .removeClass ('flip_vertical flip_horizontal') .attr ('class') ; var imageProperties = { 'identifier' : jImage.data ('idname') , 'pageId' : jInputPageId.val () , 'src' : src , 'file' : src.substring (src.lastIndexOf ('/') + 1) , 'origin' : jCheckboxLinkToLarger.val () , 'width' : jImage.attr ('width') , 'height' : jImage.attr ('height') , 'widthAuto' : jImage.attr ('width') == 0 , 'linkOrigin' : jCheckboxLinkToLarger.is (":checked") , 'alt' : jInputDescription.val () , 'caption' : jCheckboxCaption.is (":checked") , 'hidpi' : jCheckboxHiDpi.is (":checked") , 'editing' : { 'rotate' : parseInt (jInputRotation.val ()) , 'flip-h' : flipHorizontal , 'flip-v' : flipVertical , 'crop-x' : 0 , 'crop-y' : 0 } , 'class' : cls }; if (! imageProperties.width) { imageProperties.width = jImage.width (); } if (! imageProperties.height) { imageProperties.height = jImage.height (); } return imageProperties; } As you can see, I started to put selectors into configurations und tried to build a literal of the significant image data (which was the goal). I thought it would be nice, if the Image modal page itself could implement an interface like this. So that every derived operation (including CKE) could simply ask for image properties instead of scratching data from markup and input element status all by itself. In result there would exist a future proof approach for times when UI elements, possible image modifications etc. change.
    1 point
  24. This just keeps looking better and better. Some great work gone into it so far! k
    1 point
  25. I finally got it working. Thanks Bernhard! This is the final code. <div class="row"> <div class="medium-12 small-12 columns"> <?php $selector = "limit=4"; $nextAll = $page->nextAll($selector); if($nextAll->count() > 0) { echo "<h3 class='detailmore'>Meer projecten →</h3>"; } ?> </div> </div> <div class="row"> <?php foreach($nextAll as $next) { echo "<div class='medium-3 small-12 columns end'> <a href='{$next->url}'> <h4>$next->title<br />$next->diensten</h4> <img src='{$next->overzichtsthumb->first()->url}' alt='' /> </a></div>"; } ?> </div>
    1 point
  26. Upgrading PHP from 5.4.29 to 5.6.18 solved the problem.
    1 point
  27. Hello saboor, Please don't update /wire/config.php. Update /site/config.php where you can add things found in /wire/config.php and modify them. You won't have to bother about the /wire/ folder upgrade.
    1 point
  28. I don't want to dig too deeply into circumventing PW's default behavior, so doing things in steps is the way to go for me. This way, I can use PW's default behavior in a lot of places. As for lots of images, it's the same as if they were added to the page itself, so with enough images the pwimage dialog will get sluggish (when depends on the client machine). While it doesn't scale infinitely, it should work in most common scenarios. The file links scale better performance wise, as only one is previewed at a time, though there's definitely a limit too when editing the library pages themselves. It can be a sub page of any ancestor, so a child of a "grandparent" or higher up works too. I'll probably not add much functionality besides what is already there in the short run. I see where you're heading, but that would be counter-productive to what I'm trying to accomplish (at least, where I'm planning to use it). I'll keep the idea in mind, and I won't rule out implementing it if a short, clean solution jumps my mind, but I've got too many other things already on the backburner. If you or somebody else uses my code to as a building block for something like this, you're welcome though.
    1 point
  29. @JasonS The docs are almost all visible here.
    1 point
  30. Welcome to the forum saboor, You might be interested in a few tips you can find in the forum, like this one: https://processwire.com/talk/topic/12431-moving-site-to-another-server Or the docs: http://processwire.com/docs/security/migration/ http://processwire.com/docs/security/file-permissions/ You might want to do a google search like this one: site:processwire.com/talk moving Anyway, what sort of error messages (PHP, Apache, etc..) do you get? You might want to use $config->debug = true; in config.php. By "procash", do you mean ProCache? ProCache is not required at all. As the name implies, it is for those who need some serious caching for the otherwise fast ProcessWire.
    1 point
  31. Hello guys thanks for the response, I did reply to this yesterday but must have forgot to post it doh! I managed to get the site working after following pwired advice and replacing the site directory, debug worked. Which showed a problem with the AssistedURL field type module. So I updated that and seemed to work. Which was a bit of odd one as the site worked when I tested it on another server and domain. Maybe something server related. SteveB iam using php5.5 The site is http://redmooncruises.co.uk if anyone's interested. Still got a few things to tidy up. Cheers Jon
    1 point
  32. @Ralf That's exactly the key of this module. There is no url associated with each file, hence the secure nature. You can only "request" the file to be sent to the browser by $file->download() in your code. How the user can request the file from the website is up to you, like Wanze showed above.
    1 point
  33. If I understand it right, using the options 'outer_tpl' => '<ul class="uk-nav uk-nav-parent-icon" data-uk-nav>||</ul>', 'inner_tpl' => '<ul class="uk-nav-sub">||</ul>', 'parent_class' => 'uk-parent', should do it.
    1 point
  34. Hi Ralf, I would do this by passing the internal position of the file in the array, e.g. foreach ($pdffiles as $i => $pf) { $content .= "<a href='{$page->url}?fid={$i}' title='{$pf->name}'>$pf->name</a> ($pf->filesizeStr)<br />"; } Then you can grab the file with this ID: if ($input->get->fid) { $file = $page->file->eq((int) $input->get->fid); if ($file) { $file->download(); } } Cheers
    1 point
  35. Hi Jon, Actually a 500 internal server error is a very classical one and in many cases related to the .htaccess ? uncomment # RewriteBase / ? Options -Indexes ? Options +FollowSymLinks ? a module that needs to be updated. ? bad database connection Always do a new fresh install of processwire on the new host. This will tell you first hand if the .htaccess and the settings on the new host match up. Second replace your site folder with the one on the new host, but leave the config.php. Only replace the user salt in the config.php. Normally everything works at this stage but sometimes you have to empty out cache and sessions in /site/assets/cache/ and /site/assets/sessions/, or simply have to set the right php version on the host. If things still don't work set $config->debug = true; check your site/assets/logs/errors.txt, apache error logs.
    1 point
  36. In my opinion this is a good idea, though it should be made clear that feature x getting a lot of votes doesn't mean it will be implemented – just that it's what most users voted on. If product development was all about "ask the crowd what they want and do it", products like ProcessWire – ones that dare to approach things from a different point of view – wouldn't exist. We'd just have a ton of WordPress clones. I'm not sure where I've heard it from and if it's even really true, but they claim that Nokia once asked their users what were the main griefs they had with their phones. The one they heard most was that the battery was drained too fast. For a long time their phones had terrific batteries, but in all other aspects they were way behind companies like Apple who literally decided not to listen to their customers. Sorry for going slightly off-topic, but my point here is that while it's good to ask what your users think, it doesn't mean that you should always do as they tell you. It can, nevertheless, provide you with new ideas and feedback regarding the direction you're going with your product. The idea is good, but needs to be put into right context
    1 point
  37. Check the xhr requests if the needed header is really present. If not it won't be recognized by processwire. Being a xhr request alone is not detectable for the webserver.
    1 point
  38. After convincing my main client/boss of the advantages of PW over WP, I'm currently build his personal/company site new version. He's a Project Management expert and currently works for the United Nations. His website received around 2k unique visitors per day. Running WP on a Digital Ocean 4GB droplet with Varnish and Apache on Ubuntu 14. MySQL DB runs on another droplet with 2GB. There are other apps running on the same 4G server. I'm planning to use Laravel's Forge to admin the new version. It will make things easier I think. This new version will merge two websites, ricardo-vargas.com and macrosolutions.com.br (the company services). I'm posting the screenshots for the template and admin pages of a consulting service that today leaves at: http://macrosolutions.com.br/consulting/projects-offices-assessment-optimization-and-restructing/ on the old site. There's no front-end yet but I reckon posting these screens may help someone. Numbers: 43 Fields organized in 4 tabs.
    1 point
×
×
  • Create New...