Jump to content

adrian

PW-Moderators
  • Posts

    11,182
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Let your clients create customized CSV exports of pages using Batch Child Editor (http://mods.pw/6K)

  2. Some cross-linking and gratuitous self promotion I have just implemented highly configurable CSV exporting (admin and API) into Batch Child Editor: https://processwire.com/talk/topic/6102-batch-child-editor/page-2#entry95855 It does lots of work for you, including supporting ProFields Textareas and Multiplier, along with outputting Page field title/name, rather than ID. Export settings can be configured by the developer and/or the site editors. It might be useful for others searching for CSV export and finding this thread.
  3. Another major new feature! I have added an Export to CSV mode which generates a CSV file containing the fields for all child pages. It currently supports most field types, including: Text/Textarea/Integer/Date fields Page fields - exports the "Title" if available, or "Name" if not (eg user template), rather than just the page ID File/Images - exports the filenames Profields Textareas - automatically converts field into multiple columns - one for each subfield Profields Multiplier - separates values with a customizable separator - you can choose a line break if you want which is nice when opening the CSV in Excel. This same customizable separator is available for other multiple fields like Page fields, File/Image etc It does not support Profields Table, PageTable or Repeaters as these would get very messy. Note if you want to provide an export for specific Table fields, don't forget to check out: Table CSV Import/Export Fields to be exported can be predefined or customized by the user. Also includes an API export method: //export as CSV if csv_export=1 is in url if($input->get->csv_export==1){ $modules->get('ProcessChildrenCsvExport'); //load helper module //delimiter, enclosure, file extension, names in first row, multiple field separator, array of field names $page->exportCsv(',', '"', 'csv', true, "\r", array('title','images','textarea_test')); //$page->exportCsv() - this version uses the defaults from the module or page specific settings } // display content of template with link to same page with appended csv_export=1 else{ include("./head.inc"); echo "<a href='./?csv_export=1'>Export Table as CSV</a>"; //link to initiate export include("./foot.inc"); } Like the rest of this module, everything is configurable at various levels, so you can include this functionality as a separate tab, or part of the Children tab. You can predefine all settings so the user only has a simple Export button - whatever works best for you. Please let me know how this new functionality works out for you and if you have any suggestions for improvements.
  4. Of course Seriously though, I find that in general it works really well, but I do need more testing from others to find these situations where it doesn't. Keep in mind that there might be an issue with recent versions of PW (https://processwire.com/talk/topic/8660-migrator/?p=92889) that I need to look into. The issue you mention might be related to this, however I do also need to work a bit on the behavior for migrating the content page tree for page fields - I need to check to see if that tree already exists before importing so it can update/replace it, rather than adding a new one. Interesting that you want to exclude field/template migration - what happens if the fields/templates for the pages you are trying to import don't already exist? I don't think it should be hard to make this an option though. If you'd like, please PM me your exported json or zip file so I can test - it might help me to discover some other scenario where it isn't working as expected. I really do want to get this stable and released sometime this year.
  5. 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.
  6. Because an autocomplete inputfield is connected to a page field, you are dealing with an array, so try this: $page->autocompleteField->add(7111);
  7. 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
  8. 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.
  9. 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!
  10. 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.
  11. 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.
  12. 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!
  13. 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.
  14. 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.
  15. 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';
  16. 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" ?
  17. 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.
  18. 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.
  19. 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.
  20. 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!
  21. 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/
  22. 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.
  23. 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/)
  24. Hi Peter, You can easily limit the images like this: foreach($i->Images->find("limit=5") as $image) {
  25. Thanks for spotting! Github issue posted: https://github.com/ryancramerdesign/ProcessWire/issues/1171
×
×
  • Create New...