Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. This issue is what Migrator (https://github.com/adrianbj/ProcessMigrator) aims to solve (although not for users just yet). It works very well in most scenarios - there are just a few situations that still need some tweaking. It works by converting page IDs to named json records, named assets folders etc so that they can be imported into a new site without causing clashed with existing page IDs. Unfortunately for your purposes of migrating user accounts, there are currently several checks to exclude pages under Admin (I wanted to prevent it messing with this stuff), but I do think they can probably be removed - carefully! Anyway, not a complete solution for you right now, but something for you to investigate. I haven't found much time to work on it of late, but I am still intending on finishing it up sometime soonish.
  2. Because an autocomplete inputfield is connected to a page field, you are dealing with an array, so try this: $page->autocompleteField->add(7111);
  3. You don't want the ProcessWire-master folder, just its contents. Many of those folders you see will be removed during installation. In particular, all the site- .... folders will be removed except the one you choose and it will be renamed to simply "site". EDIT: Too slow - @LostKobrakai typed while I was distracted with a phone call
  4. Hi @Bill* and welcome to PW and the world of web development in general! In most shared hosting environments you'll want to unzip it to a folder called: public_html. Sometimes there might be a /var/www/ or yourusername/public_html or something like that. The key thing is that generally it should be at the root of your web folder structure. If in doubt you should ask your host, but if you can view a page that links to a default index.html file (or maybe home.html) if you unzip processwire where this file lives, you should be fine. Hope that helps.
  5. 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!
  6. 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.
  7. 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.
  8. 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!
  9. 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.
  10. 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.
  11. 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';
  12. Here is an old thread with similar symptoms: https://processwire.com/talk/topic/997-image-not-responding-to-size/ It shouldn't matter given that first() is working for the url, but what setting do you have for Details > Formatted Value ? Does it help if you force "Array of Items" ?
  13. 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.
  14. 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.
  15. 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.
  16. 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!
  17. 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/
  18. 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.
  19. 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/)
  20. Hi Peter, You can easily limit the images like this: foreach($i->Images->find("limit=5") as $image) {
  21. Thanks for spotting! Github issue posted: https://github.com/ryancramerdesign/ProcessWire/issues/1171
  22. 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/
  23. Or you can go even shorter with: $fields->yourField->icon
  24. No problem! "start" is hidden - try turning on Advanced Mode on the API Cheatsheet and you'll see it under the selectors section.
  25. 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");
×
×
  • Create New...