Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. 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.
  2. 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.
  3. Take a look here: http://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/
  4. 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
  5. 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.
  6. 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
  7. 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.
  8. 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
  9. Does the news-pager-index.php file exist in the templates directory?
  10. 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.
  11. Hi dazzyweb, This module should take care of your needs: http://modules.processwire.com/modules/textarea-counter/
  12. 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.
  13. 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?
  14. adrian

    Bitbucket

    Just started using it a few days ago actually, together with SourceTree. Seems like a pretty good free combo setup!
  15. This should do it: ^(?:0?[0-9]|1[0-2]):[0-5][0-9] [ap]m$
  16. 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
  17. 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
  18. 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
  19. Sorry - maybe my wording wasn't very clear - I am not having any problems - the "also" was referencing Martijn's comment.
  20. Hi nate and welcome to PW. I don't have Form Builder so I might not be of much help, but you should message Ryan to gain access to the form builder forum board. Normally in PW ->get returns only one thing. ->find will return an array and you can append ->last() after the selector to get the most recently saved, depending on how the sort order is set up. Unfortunately I am not sure how this works with form builder, but I am sure someone else will chime in with an answer shortly
  21. I know it doesn't help, but I am also having no problems with 2.35 (actually very latest dev today) and Safari 6.1 Not sure why or how exactly, but does setting: $config->sessionFingerprint = false; help at all? Are there any other settings in the config.php that are different between the site with the new admin theme and the other site you tested?
  22. Brent - sorry, I didn't read that you were only doing an InputField at the moment. From my understanding of things, a new FieldType is likely your only option. Actually, I wonder if you can have a separate field that stores the selector. Maybe that hidden field you are using is an actual PW field, or you take the content of your existing hidden field and copy it to an actual PW field (visibility set to hidden) on page save. Then on form render it is grabbed and populates the selector text field. Something like that anyway. Not sure how well this would work - seems like it should be possible, but maybe someone else will chime in with a better idea, or flame this one
  23. Hi sshaw, Thanks for your enthusiasm on this. I am still trying to figure out what I think is the best approach here. Here are the functionalities on my list that I would like to see: Code snippet repository that anyone can contribute to Snippets can be "installed/updated" on your site with one click An admin interface that handles running these snippets in different ways, so no need to copy/paste code anywhere. On-demand code execution - for admin type tasks, such as Ryan's clean-files.php script mentioned above Triggered by a specific PW hook Injected into specific template files Embedded into an RTE the way the Hanna Code works As I mentioned above, I think this could really remove the need for module creation in many cases. I wonder if this needs to be a new module, or if extending Hanna Code would work best. PS Just read your last post properly - sounds like we are on the same wavelength here I am definitely happy to take the lead on this, although I'd really like to get some input from the PW gurus on this - in particular Ryan, what do you think about the idea of using Hanna Code as a base for this. I don't want to bloat it with things some users won't want, but I also don't want to have a completely separate module to store snippets that can't be embedded like Hanna does. Maybe the new module could just hook into the Hanna snippets DB table. Any thoughts?
  24. Sounds interesting. You should be able to save the selector by defining a new database field for your fieldtype (in addition to the standard "data" field). This approach is used in a few fieldtype modules, like: http://modules.processwire.com/modules/fieldtype-phone/ http://modules.processwire.com/modules/fieldtype-dimension/ http://modules.processwire.com/modules/fieldtype-map-marker/ Have a look at the getDatabaseSchema and updateDatabaseSchema functions in those modules, along with their dabatase tables and you should get the idea. Hope that helps. Also, this is just a quasi-related module that I'd reference here for the sake of it: http://modules.processwire.com/modules/fieldtype-pages-selector-query/
  25. Hey Ryan - thanks for getting back to me - I think the module will be really cool once I get this figured out! I just tested on a brand new PW dev installation and I still can't Pagefile::install to work. This is my hook (line 74 of my module) which doesn't work: $this->addHookBefore('Pagefile::install', $this, 'customRenameUploads'); As soon as I make setFilename hookable and use the following hook instead, it works perfectly: $this->addHookBefore('Pagefile::setFilename', $this, 'customRenameUploads'); Maybe I am missing something obvious This comment - "I mention this because it's not uncommon when doing data conversion jobs to put the file right in the destination directory before adding it to ProcessWire's data." has me thinking. I am not really sure what you mean by data conversion jobs, but I am just using PW upload dialog to get the images into the system and I am calling "addHookBefore" so I would think it should happen before the file is copied into the assets destination folder. I have attached a version of the module with the install version of the hook, which is the only difference to the version on github, execpt for a error_log call to see if the function is actually being called at all from the hook. Thanks for looking into it. ProcessCustomUploadNames.module ProcessCustomUploadNames.js.txt
×
×
  • Create New...