Jump to content

adrian

PW-Moderators
  • Posts

    11,176
  • Joined

  • Last visited

  • Days Won

    371

Everything posted by adrian

  1. Hi maba, Thanks for the positive feedback and picking up on those errors. Only catch is that line 249 doesn't refer to ruleData, so I am wondering if you are running the latest version (0.0.8). Can you please check again with the latest version and let me know what, if any messages you get. I don't get any notices show up at all. Did you mean to attach a screenshot regarding the fix for the new admin theme? Thanks, Adrian
  2. A little more testing - if I move the mouse very slowly onto the "compare with current" it works with some PW admin themes but not all and it is pretty difficult to get right. I actually tried on Win7/Chrome and am actually having more troubles - haven't managed to get it to work at all. I have tested different versions of PW without any real pattern. Maybe don't worry until someone else confirms it!
  3. I am not really sure exactly why you are getting that error, although my hunch is that you have the opposite problem that apeisa identified earlier with the $createduser->img_lg field. It sounds like that one was set to single image, but the img_user is set to multiple, so you need to either use first() or eq(0) or change it to be single image. Does that work? I assume img_user is set to type CropImage?
  4. Hey teppo, OSX and Chrome with CKEditor, TinyMCE, or plain textarea. I tried on body and summary fields and both have the same issue. I'll try to investigate further when I have a little more time - sorry I don't have anything more useful right now!
  5. Hey Teppo - this looks to be great - thanks! Only catch is that I can't seem to ever click on the "compare with current". I have tried the default and the new dev admin theme but no matter how careful I am, it disappears before I can click on it.
  6. Does the problem still exist if you are not using that code to add the additional image fields?
  7. LeiHa, $createduser = wire("user"); will get you the currently logged in user, or "guest", rather than the user that created the current page. Is that really what you are looking for? Have a read of this: http://processwire.com/api/variables/user/
  8. Hi tina, Sorry for the limited answer - was in a hurry. Actually looking at this module a little more, I realize that I have never used the built-in render, but rather just used it as a way to enter addresses in the admin. I have been using Ryan's RCDmap class: http://processwire.com/talk/topic/690-map-marker-fieldtype/?p=10667 Although I actually haven't hidden the poi in any PW sites yet, so I don't have a final code snippet for you. However, this is the code that I used on a mobile site I developed that made use of: https://code.google.com/p/jquery-ui-map/ var myStyles =[ { featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; $('#map_canvas').gmap('option', 'styles', myStyles); I wouldn't necessarily recommend jquery-ui-map - I thought it might be worth trying, but mostly just seemed to add another layer of complexity. I think I would stick with the standard gmaps api. Here is a relevant POI link from google: https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType Hope that helps.
  9. Glad you got it sorted out I have definitely had a few issues with modules disappearing in the past, but not for quite a while. I am running the latest dev, so I wonder if something was fixed recently. Give it a go - I don't think there is really any reason to stay with the stable release.
  10. Take a look here: http://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/
  11. Not sure why the modules aren't showing up, but you might try deleting module related files in site/assets/cache folder and see if that helps. As for the built-in installer - you'll need a recent dev version for that feature. Oh yeah - definitely install the modules manager - can't live without that one
  12. The module soma is talking about is included in the core, but not installed, so go to the modules page and install "Session Handler Database" which will also install the required "Sessions" module. Let us know if you are still having problems finding this.
  13. Thanks for putting together the PR for Ryan. Just for the sake of keeping connected posts linked, this post and the following reply from Ryan are relevant: http://processwire.com/talk/topic/3023-module-ckeditor/?p=42523
  14. This config option should disable the POI for you: [ { featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" } ] } ] Obviously this is not a module setting, but rather a setting you need to add to the javascript that loads the map on the frontend. Hope that helps.
  15. I actually haven't used the module, but I am assuming it will force any pasted text to be truncated, whereas the normal max characters maybe just prevents further typing. Here is a relevant post from Martijn: http://processwire.com/talk/topic/2343-char-counter-for-texttextarea-fields/?p=47468 Have a play around with it and see what happens
  16. Does the news-pager-index.php file exist in the templates directory?
  17. I think you might need to do something like this: $users->get($page->createdUser->name)->image->last->getThumb('micro'); You need to get the name of the createdUser of the current page and get that user's fields from $users. As for the issue of keeping multiple images - those settings won't work on the front end - you need to delete all existing images before uploading. See this post from Ryan: http://processwire.com/talk/topic/4267-creating-new-page-in-combination-with-a-file-upload/?p=41876 Hope that helps.
  18. Hi dazzyweb, This module should take care of your needs: http://modules.processwire.com/modules/textarea-counter/
  19. Anyone know if this can be done via the API? I feel like there should be an equivalent of the $field->setAsmSelectOption('sortable', false); that works for PageListSelectMultiple fields, but looking through the core code, I can't seem to find anything. I guess I could remove the InputfieldPageListSelectMultipleSortable class with jquery, but I feel like there should be a better way.
  20. Just pushed a new version to Github that supports setting a filename length limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. The final filename will be truncated to this length if set. I have also added support for jquery 'on' as well as 'live' depending on what is available. I have one thing I'd like to sort out before releasing this if anyone has any ideas. I can't seem to get dynamically added (click "Add another rule") ASM fields to properly initialize. The: <select class="asmSelect" name="asmSelect2" id="asmSelect2"> is not being setup, so the fields just looks like a standard html multi-select field until the config settings page gets saved, then it works fine. I am wondering if there is an easy way to fix this. I haven't looked through things thoroughly yet, but it seems weird that the InputfieldPageListSelectMultiple field is working properly. Any ideas? I have the ASM fields now mostly working (works almost every time a new rule is added, but not 100% for some reason). I resorted to a setTimeout to wait until the select form elements are created. I feel like there should be a better way to do this, but it is something I always struggle with a little in jquery. I have used this function in the past: https://gist.github.com/aziz/3792797 but I still think there should be a better way. Anyone?
  21. adrian

    Bitbucket

    Just started using it a few days ago actually, together with SourceTree. Seems like a pretty good free combo setup!
  22. This should do it: ^(?:0?[0-9]|1[0-2]):[0-5][0-9] [ap]m$
  23. This module allows you to automatically rename file (including image) uploads according to a configurable format This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs. Github: https://github.com/adrianbj/CustomUploadNames Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/ Renaming Rules The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can 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. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files. $config->webpOptions = array( 'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). NOTE: This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like: Final ReportV6 web version for John Feb 23.PDF
  24. Thanks Ryan, Not sure why I actually never tried that. I have used InputfieldFile::fileAdded in my SVG rasterizer module, so it should have been on my radar. Anyway, for this module I have gone with InputfieldFile::processInputAddFile and it seems to be working great. New version is on Github and here is the official module support post: http://processwire.com/talk/topic/4865-custom-upload-names/ Thanks again for seeing me through this one
  25. Sorry for yet another post, but I just fixed a bug that prevented certain fields being exported and assigned to templates in some situations. Not the most elegant solution (repetitive declaration in the JSON file), but it should work for the moment until I have time to rework slightly. Grab the latest version from Github for testing
×
×
  • Create New...