Jump to content

adrian

PW-Moderators
  • Posts

    11,182
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Oops - sorry about that - try v3 now on Github
  2. Hi everyone. The new functionality based on Martijn's suggestions for creating the select options with multiple fields is ready. I have updated the code on Github and modified the instructions in the first post above. Please test and let me know how it goes for you and whether there are any improvements I could make.
  3. Thanks for the positive feedback everyone. Matthew - that was definitely part of my reasoning for creating this. There are a few times I have wanted to set up a page field, but have gone with hani's fieldtype Select module to save time. I still think there are times when his module is more appropriate, but now I think I won't be making the decision because of the time/hassle of creating a page field setup. It is also why I chose to put "Select" in the name of the module - hopefully it will help newcomers find it more easily. Martijn - I like where you are headed with those ideas. I think rather than selecting an existing child template (which I think is what you are suggesting), how about I allow the Select Options field to also handle multiple fields if entered? I might take a stab at that and see how it goes - stay tuned!
  4. This module provides a way to rapidly generate Page fields and the required templates and pages for use as a drop down select (or any other Page field type). This module will let you create a full page field setup in literally a few seconds To use, run Page Field Select Creator from the Setup Menu Enter a Field Title, eg: Room Types Select Options - These will become the child pages that will populate the page field select options. There are two different options. Option 1. TITLE FIELD ONLY - enter one option per line, eg: Single Double Suite Option 2. MULTIPLE FIELDS - the first line is used for the field names and the first field must be 'Title'. Subsequent lines are the values for the fields, eg: Title, Number of Beds, Number of People, Kitchen Facilities Single, 1, 1, Fridge Only Double, 2, 2, Fridge Only Suite, 3, 6, Full Kitchen Choose the parent where the page tree of options will be created, eg a hidden "Options" parent page Select a "Deference in API as" option depending on your needs Choose the input field type Check whether "Allow new pages to be created from field?" should be enabled. As an example, if you entered "Room Types" as the field title, you would end up with all of the following automatically created: a fully configured page field called: room_types MULTIPLE FIELDS OPTION - 3 additional fields - number_of_beds, number_of_people, kitchen a parent template called: room_types a child template called: room_types_items (with either just a title field, or with the 3 additional fields as well) a parent page called: Room Types a series of child pages named and titled based on the per line entries in the Select Options textarea The templates are configured such that the "room_types_items" child template can only have the main "room_types" template as a parent, and vice versa. Then all you have to do is add the newly created page field to any template you want and you're ready to go! You can grab it from: Modules directory: http://modules.processwire.com/modules/process-page-field-select-creator/ Github: https://github.com/adrianbj/ProcessPageFieldSelectCreator
  5. Thanks Ryan, I have just updated the module on the module's page with v1.0.3. This version moves many of the settings to the module configuration page, rather than on a per field basis. I dealt with the leading zero issue by appending a tilde on settings save and removing it when loading the settings, so it is transparent for the user. I have also update the instructions in the first post above. If anyone has any changes they'd like to see, please let me know.
  6. Here's another bit of code from Ryan that might prove helpful: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 It is not for random filenames, but it does show how to set up a file renaming module
  7. It really is personal preference, but I think Ryan would most likely go with the first: Here are a couple of relevant threads/posts: http://processwire.com/talk/topic/4439-when-do-we-need-curly-brackets/ http://processwire.com/talk/topic/3835-sorting-pages-by-multiple-values/?p=37797
  8. Replace: src:'assets/img/overlay.png' with: src:$page->bgimage->url EDIT: horst has it right - I wasn't awake apparently
  9. In the selector: $newsposts = wire("pages")->find("parent=/news-articles/, $category, template=TUT_news, limit=3"); you should just need to add: sort=-created eg: $newsposts = wire("pages")->find("parent=/news-articles/, $category, template=TUT_news, limit=3, sort=-created"); That will sort your posts in reverse order (-) of created date/time.
  10. Hey Martijn, I just sent you a pull request to add the ability to specify the maximum filesize for an image once inserted in an RTE. I needed this functionality because clients were uploading very high resolution images and embedding those - nasty! Training only works for some people and only some of the time The interceptor will automatically compress this image until it reaches the limit specified in the module settings. If the limit is set too low, it can obviously result in some poor quality images. I wonder if it would be good to have a bit of a sliding scale for this setting based on the physical dimensions that the image is going to be displayed at. Let me know what you think and definitely feel free to ignore, or give me your ideas for a different approach. I am also open to making this a separate module if you'd prefer.
  11. Ah, sorry - been on 5.4 for so long I forgot about this. Yes, repeaters aren't supported yet. For the moment I'll add that to the list of fieldtypes to ignore so at least there won't be an error. Btw, the last update also now handles RTE links that have been processed by the PageLinkAbstractor module. EDIT: Committed version with those small fixes. NB that the check to ignore repeaters is currently only on the export, so you would need to export again to check.
  12. Is this of any help: http://modules.processwire.com/modules/process-page-clone/ Could you store all the snapshot versions (copied with the clone module) in an "archives" parent. Also, if you haven't seen it, is this also any use: http://modules.processwire.com/modules/version-control-for-text-fields/
  13. diogo - thanks for spotting that - I misread what he wanted and forgot that unpublished is the default. As for the error - not really sure why that isn't working. Not really advisable, but you could hack the module code: https://github.com/ryancramerdesign/FormTemplateProcessor/blob/master/FormTemplateProcessor.module#L202 Comment out that highlighted line.
  14. $form->addStatus(Page::statusUnpublished);
  15. I think you can probably replace: $form->parent = $page; with: $form->parent = $page->parent;
  16. Looks like you got it sorted! At least they are both working for me. Thought I'd mention this, just in case it's an issue at your end - you never know sometimes
  17. This is a recurring issue for those new to PW. Your images field is by default set to handle more than one image, so you can either change it to only support one image, or you need to define which image from the field you want to display: if($page->themeimage) echo "<img src='{$page->themeimage->first()->url}'>"; Or replace first() with last() or eq(n) where n is the number of the image in the order, starting with 0. To change the image field to only support one image, go to the field's details tab and change Maximum files allowed to: 1
  18. All these avatar changes are freaking me out I am starting to see vxda's point. I was caught up on embedding into RTEs and then display through templates, but I can see the scenario where it would be great to have a client be able to insert an existing image from another page into a dedicated image field.
  19. This is in the works: http://processwire.com/talk/topic/3219-images-manager-alpha/
  20. But why do you need to upload them multiple times? You can access them from any page, either through the RTE example above, or using the API to display them in your templates like: $pages->get("name-of-other-page-with-image")->image-field-name->url That assumes the images field is set to only handle one image. If it contains more than one, you would need: $pages->get("name-of-other-page-with-image")->image-field-name->first()->url or instead of first(), you could choose last() or eq(n) where n is the number of the image in the field based on their order.
  21. From: https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced If you're using Git, the best method is to clone this repository to your ST Packages folder. (on Mac, it's here: /Users/your_username/Library/Application Support/Sublime Text 2/Packages/). You can also download the zip file and unzip into the Packages folder. Either way, I would recommend creating a ProcessWire subfolder as there are more than 200 files.
  22. Just a wild guess - do you think it is possible that they have messed with the .htaccess file or have some other redirect rules (maybe even in the apache conf file) that would be causing the redirect?
  23. If you are referring to using them in an RTE, then to expand on Kongondo's comment, when you are in the Insert Image dialog, click the "Images on Page" header and click the "change" link to browse for images on another page.
  24. Hey Antti, I have just committed an update that I think fixes the multi-language issues. I know there are two different ways to do different language versions of a field, but from my understanding, this should work with both. Would you mind checking on your end and see if the import is now working for you. Thanks!
  25. I am no Github expert, but the only way I have ever been able to submit a pull request is to fork the full repo. This seems to confirm this: http://stackoverflow.com/questions/14821583/pull-request-without-forking However maybe I am not exactly understanding what you mean by "Or can I do this only with the files which need the changes?"
×
×
  • Create New...