-
Posts
11,097 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
Ryan - I agree with Peter here. I find that Save label confusing, because by itself it doesn't make any changes to what the user sees in the admin if they then choose to "Cancel" rather than "Save as Copy" or "Save and Replace". I understand that the crop is saved to the page's assets/file folder, but it really becomes an orphan if "Cancel" is clicked - right? As for the "Save As Copy" and "Save and Replace" buttons, I really think the developer needs to be able to control which of these is available. There are many times when "Save As Copy" can really mess with template code loops to output images in carousel or thumbnail gallery. Thanks!
-
Hi and welcome! I actually just posted about this: https://processwire.com/talk/topic/10010-users-with-specific-role-as-checkboxes/?p=95546 You'll see a screenshot there showing how to configure a page field to grab all the users from your PW site. You can choose whether you want ASMSelect, checkboxes etc as the inputfield type. Let us know if you have any other questions.
-
It's been a while since I did this, but I think you will have problems with the change to loading the image at the start rather than using readImage. The problem is with setResolution - this needs to happen before the image is read. The image is rasterized as soon as it is read, so setting the resolution afterwards can result in a poorer quality image.
-
I would do it like this: foreach ($page->tags as $tag) { if($tag->allowed_users->has($user)) { //show news item } } That assumes your page field that is linked to users is called "allowed_users". PS Sorry I forgot about the role issue when setting up the page field selector, but glad you sorted it out!
-
I would love to see this As much I like the existing crop modules, I honestly don't like the inconsistencies in the UI/UX between the new core cropping and the 3rd party ones, but I really want predefined cropping.
-
Sounds like you just need a page field that is linked to the users template. Let us know if you need any help setting it up. These settings for the page field should do the trick - in particular note the Label Field set to "name". Of course if you want checkboxes change ASM Select to checkboxes. It really depends on how many users there are and how many will likely be selected as to which will be better.
-
That's a limitation of PHP before 5.4 http://php.net/manual/en/language.types.array.php "As of PHP 5.4 it is possible to array dereference the result of a function or method call directly. Before it was only possible using a temporary variable." It's an easy fix to support PHP 5.3 though: $moduleInfo = self::getModuleInfo(); $storage->title = $moduleInfo['title'] . 'StoragePage';
-
Hey Peter - these are awesome! I posted a link to this thread on Github as a comment to an issue I brought up about this confusion I have seen: https://github.com/ryancramerdesign/ProcessWire/issues/968 I especially love the Choose and Upload tabs.
-
Glad to hear that it's working again for you! I am still baffled about the -1 suffix with "Rename on Save" though. Could you maybe post screenshots of your settings for this module as well as letting me know the settings for your PDF field, eg: Max Files Allowed Overwrite existing files I have tried lots of different combinations and it keeps the filename without the numbered suffix for me. Any chance you are on a Windows server - just wondering if maybe there is a directory separator issue. Is there only one files field on the page? If it allows more than one file to be uploaded, are you actually still only uploading one or are there several? Is there anything else you can think of that might contribute to this? Thanks! EDIT: One other thing to check - it there any chance that there is an extra file in the page's assets/files/1234 directory. Perhaps when it wasn't being renamed correctly I duplicate was left over - this would cause the behavior you are seeing, so please empty the files folder and try again. And/or try on a new page where you know the files folder is empty / without duplicates.
-
Sorry about that @charger. I had to change on of the hooks when I added support for repeaters which resulted in the issue you saw. It should be fixed now and actually the new method is better and more reliable in other situations too. Please grab the latest version and let me know. On another note, I am curious about your comment regarding the -1 suffix on every second save - that actually shouldn't happen with this module, so if you are seeing that, please let me know and I'll investigate further. That said, I avoid the "Rename on Save" option whenever possible, so not suggesting you should use it, but I do want to make sure that using it doesn't result in the numbered suffix. Thanks for reporting this.
-
Line 15 and 16 will need to be changed. You just want: $input->urlSegment2 You don't want the "post" and you can't use "=" where you have it, hence the syntax error. EDIT: Oops - tpr beat me!
-
Which fieldtype should i use for Bootstrap Lists?
adrian replied to GeraldSchmidt's topic in Getting Started
Hi Gerald, That is exactly what Page fields are all about. Most new users struggle to understand the approach at first, but it is incredibly powerful. Here is a bit more info about it: http://wiki.processwire.com/index.php/Page_Field There is actually a much better description somewhere, but I can't seem to find it right now - hopefully someone else will post it here shortly. You may also find this new module a great addition to the page field interface, allowing your editors to edit the content of each option page inline: http://modules.processwire.com/modules/admin-page-field-edit-links/ -
Which fieldtype should i use for Bootstrap Lists?
adrian replied to GeraldSchmidt's topic in Getting Started
Hi @GeraldSchmidt and welcome to PW - great to have you aboard. What you are looking for is a Page Fieldtype (http://processwire.com/videos/page-fieldtype/) or an Options Fieldtype (https://processwire.com/api/modules/select-options-fieldtype/.) Then you'll need to choose an Inputfield type (ASM Select, Checkboxes, Autocomplete, Multitransfer etc). Then in your template file: foreach($page->fieldname as $item) { echo "<li>{$item->title}</li>"; } Please let us know as you have more questions. -
I hear ya - sometimes the brain reaches boiling point and I swear it just goes to mush I see masonry mentioned quite a bit around here, but just to add another option in case folks haven't seen it, I really like Freewall (http://vnjs.net/www/project/freewall/)
-
Hi Peter, You can easily limit the images like this: foreach($i->Images->find("limit=5") as $image) {
-
Thanks for spotting! Github issue posted: https://github.com/ryancramerdesign/ProcessWire/issues/1171
- 1 reply
-
- 1
-
-
There is this module: http://modules.processwire.com/modules/download-guard/ You might also find some useful info in these posts: https://processwire.com/talk/topic/5820-protected-downloads/ https://processwire.com/talk/topic/5292-proctecting-files-from-non-logged-in-users/ https://processwire.com/talk/topic/6463-website-with-protected-download-area/ https://processwire.com/talk/topic/869-protected-files/
-
Or you can go even shorter with: $fields->yourField->icon
-
Page array is empty when using limit = n with MarkupPagerNav
adrian replied to Gideon So's topic in General Support
No problem! "start" is hidden - try turning on Advanced Mode on the API Cheatsheet and you'll see it under the selectors section. -
Page array is empty when using limit = n with MarkupPagerNav
adrian replied to Gideon So's topic in General Support
I think you need to override the "start" selector that is being added from PagerNav. Setting it to 0 should fix things. $grandChildren = $child->children("limit=5, start=0"); -
OK, I think they need to be treated as separate translatable strings, like this: $fieldEnabledTemplates->description = __('The batch editing option will only be available for the selected templates . '. "\n" . __('NB Leave blank to allow all templates.', __FILE__); Or using $this->_() it would look like: $fieldEnabledTemplates->description = $this->_('The batch editing option will only be available for the selected templates . '. "\n" . $this->_('NB Leave blank to allow all templates.', __FILE__); Seems a shame to have multiple strings to translate though just because there is a line break, but as far as I can tell there is no other way. Or maybe it actually makes more sense so the translator can't accidentally remove the line break?
-
Thanks for testing. I'd probably be OK without the line breaks in those spots in your screenshot, but what about this line for example: https://github.com/adrianbj/BatchChildEditor/blob/master/BatchChildEditor.module#L1198 - this definitely needs the line breaks. It seems like this should work. Could you please confirm? $fieldEnabledTemplates->description = __('The batch editing option will only be available for the selected templates.'."\n".'NB Leave blank to allow all templates.', __FILE__); I probably should switch them all over to: $this->_() for the speed advantage since they are all inside a class, but that can wait for now.
-
Thanks @Manfre62 for testing. I don't think the double quotes is the issue because in @mr-fan's screenshot he has translated the "Configurable Pages" option and the description for it also uses double quotes. I don't use translated modules though, so could you please double check and confirm that it is the double-quotes. It's always been my experience that you can't use \n inside single quotes, which is why I use them in situations where I want to break things across more than one line. "NB" is a common acronym in English for Nota bene which is latin for "Note well".
-
Thanks for the kind words and for your efforts on this translation - must have been quite a task - there's lots to translate in this module I accepted your PR and also fixed (I think) the issue you were having translating that the enabled templates setting description. Please let me know if it works now.