Jump to content

charger

Members
  • Posts

    111
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by charger

  1. This issue turned out to be related to this module. In short: As long as Custom Upload Names is installed, I get a fatal error when I try to view an entry within the Entries tab within a FormBuilder form.
  2. I'm using 2.6.1. And the Hello World module works as expected. According to Ryans comments in the ProcessHello module, it's possible to use *.info.json or *.info.php.
  3. I'm slowly getting into module development. My aim is to - in a first step - convert Ryans TextformatterVideoEmbed module to the new module structure he proposes in the Helloworld module. In a second step, I'd like to add some more options to the module. My fork can be found here. However, I'm having a problem with the getModuleInfo function. As soon as I replace it with a TextformatterVideoEmbed.info.php file, I start getting the following error when I edit a field like title (text) or body (textarea): Method TextformatterVideoEmbed::getModuleInfo does not exist or is not callable in this context Additionally, the Details tab of that field is not shown at all. Am I missing something? Do textformatters have special requirements in this term?
  4. I noticed that the module also renames the files of a language pack during upload (if no fields are listed under Enabled Fields). Maybe this should be prevented by default.
  5. Ok, seems like I've found a solution by using exif_imagetype(). See the github repo for more details.
  6. I also use somas script and actually tried to enhance it a little. However I'm stuck with line 23: if($inputfield->name != 'images') return; // we assume images field What if I have multiple file upload fields for images that should all use this script? Is there no way to do something like... if(!($inputfield->type instanceof FieldtypeImage)) return; // not working! ...instead to not have to assume a certain field name?
  7. I've attached the screenshot of my settings. The PDF allows max one file and does overwrite existing files. There's also just this file field on the page. I created multiple new pages to make sure there are no leftover duplicates in the assets/files folder. The website is not hosted on a Windows server. Hmm.. I don't have any clue what else could cause it.
  8. Thanks for the quick update, it again works as expected! The -1 suffix still happens though with the "Rename on Save" option enabled. So whenever I hit Save, the filename alternates between having the suffix and not. Let me know if you need other specific info.
  9. Hi Adrian, I've got a problem when using fields in the filename format that are populated at the same time as the upload field (PDF in my case). The format looks like this: customer-{$page->customer_id} When a new page is created, the user fills in a value into the customer_id field and then uploads a PDF, which should get renamed. However, the value inside customer_id is not respected, as the PDF gets renamed right after upload and before hitting Save. A click on Save also doesn't rename it again. I remember this worked a couple of versions ago, but not anymore. Did you change something in that area? Using "Rename on Save" isn't an option as I need the filename to stay the same and not add a -1 suffix every second save.
  10. Thanks for your answers, I've used the following (slightly modified code) in my template to get it work: if(!$input->urlSegment1) throw new WireException(); // check for url segment $filename = $sanitizer->pageName($input->urlSegment1); // sanitize url segment (filename) $p = $pages->get("files=$filename"); // search all pages for $filename in field files if(!$p->id) throw new Wire404Exception(); // check if page exists $session->redirect($pages->get($p->id)->job_pdf->url); // redirect to file For some reason, the additional viewable() check for $p always resulted in a 404 error. So I removed it.
  11. I need assets (PDF files) from multiple pages to be accessible from a single URL. That means, instead of http://www.domain.com/assets/files/1011/example1.pdf http://www.domain.com/assets/files/1012/example2.pdf ... it should be e.g. http://www.domain.com/assets/files/example1.pdf http://www.domain.com/assets/files/example2.pdf ... so without the page ID in the URL. The reason I need it this way, is because: I can't use a single page to save all files (PDFs) in it, as there are additional fields to every PDF. That means I need PageTable or Repeater, and both create new pages for every PDF There's a 3rd party service that links from external pages to the PDFs. That service however doesn't know about the page ID in the URLs, it only knows the filename of the PDFs. I've found the following topics in the forum that somewhat touch my subject, but I couldn't make them work for me: https://processwire.com/talk/topic/8312-creating-my-own-folders-for-image-assets/ https://processwire.com/talk/topic/4127-can-assets-folder-be-moved-to-another-domainsubdomain/ Any idea on how I could solve this?
  12. I obviously would love to see this being added But it might be error prone on the input side of things. You'd have to tell the user exactly what's allowed and how to enter it. I think this needs a bit more thinking on how it can be best integrated.
  13. Great stuff!! Thanks a lot! I did some testing, and everything seems to work. I have one feature that I'm missing. I'm aware this is not the core idea of this module, but I wanted to mention it anyway. Ok, so here it is: If I have a selector for columns/rows that goes like parent=1283|1284, it works as expected by listing the children of both parents. The output could be like this: S M L Cotton Nylon However, it would be cool to have an option (checkbox) that creates all possible combinations of the selected children, like this: S Cotton M Cotton L Cotton S Nylon M Nylon L Nylon In my case, I need this because I have multiple currencies for the rows. As mentioned, I don't know if this too much out of scope and maybe needs an additional module.
  14. Just tested it and works like a charm. Thanks a lot for the quick support!
  15. The problem is that if I upload 10 files at a time and they all get renamed to tmp-filename.pdf before saving, then I have no chance to see the original filename and thus write the according description to it. An example: I upload a file that is originally named 30_10_2014_EventHappyMonday.pdf. In order to know what to fill in in the description field (in this case it would be "Event Happy Monday"), it helps a lot if I still see the original filename and not tmp-filename.pdf. Enjoy your holidays!
  16. Supposed I upload multiple files at a time and want them to be rename to the following format format: mysite-[Y-m-d]-{$file->description} The problem is that all the files get renamed immediately (before hitting the save button) like this: tmp-filename.pdf tmp-filename-1.pdf tmp-filename-2.pdf ... Now, how can I tell which tmp-filename belongs to which original file? Sure, I could still open the files by clicking on their filename. But what if the new file format would only be applied after hitting the save button?
  17. Just very busy days, so I'm a bit slow in response. I'd love to get more explanation! With low-level I meant deep inside the core system. High-level would be closer to the surface/front-end. Don't know if that's the right way to put it though
  18. Wow, lots of action here I'm sorry, but I can't keep up with the discussion. It's too low-level for me. I don't know the interns of PW that well yet. But I'm happy to help where I can.
  19. I think we got tangled up in my use case. Maybe I have to go back to the beginning, because what I'm looking for has different use cases in my opinion. What I'm looking for is to have some kind of matrix fieldtype where I can define the row and column headers. Now, these headers should automatically be built by the page title of definable pages (actually their respective child pages). Say I have two pages (Size and Color) with the following child pages: Size – S – M – L Color – Red – Blue – Green Now in this matrix fieldtype, I could apply Size to be the row header and Color the column header. This would result in a matrix like this: | Red | Blue | Green | –––––-------------------- S | | | | –––––-------------------- M | | | | –––––-------------------- L | | | | –––––-------------------- Now, if I add another child to the page Color (e.g. Black), the matrix would be automatically extended: | Red | Blue | Green | Black | –––––---------------------------- S | | | | | –––––---------------------------- M | | | | | –––––---------------------------- L | | | | | –––––---------------------------- Is there already a fieldtype like that?
  20. I'm not sure if I can follow your example. Let me add another screenshot to clarify my setup. I have a product page (T-Shirt) that is displayed on the frontend. Then, there's the Tools page (only for backend), where I define a products attributes and categories. Now, within the page T-Shirts (which represents a product category) I want to be able to have the table I mentioned above where I can set the prices for each product variant of the attributes size and color – pretty much as in my other screenshot above. The product page T-Shirt then actually just has a drop-down to select a product category (in this case T-Shirts).
  21. As I mentioned at the beginning, I already tried to use the ProFields Table, Multiplier and Page Table. The screenshot in my post above is actually from the ProFields Table fieldtype. It should be one template in the end that I can use on different pages (-> product categories).
  22. No, the product itself (T-Shirt) is assigned to a category (T-Shirts), and all the pricing information is stored within the category page.
  23. It might help if I add a screenshot of what it looks like if it's manually built with the fieldtype table. The downside is that I have to create all possible variations by hand, and that if I add a new currency or a new product option, it's not populated automatically to this table. One solution (at least for the product options size and color) to this would be if the fieldtype table would allow columns to be of the type page and then output them as radios/checkboxes. It would be even cooler of course if the variants (all possible combinations of the product options size and color) would also be built automatically
  24. Thanks for the tip, but I don't think that module can help me. It doesn't create the rows/columns based on the children of pages (so that I can add another child page and that the matrix would be extended automatically). If I would do it manually, I would prefer the fieldtype table.
  25. I want to be able to set the price of a product (e.g. a T-Shirt) by its category (well, T-Shirts). Now for all products within the category T-Shirts, there are the same options (size S, M, L and color red, green, blue). So if I go to the category page of T-Shirts, I want a matrix that lists all the options of this product category and then let me set a price for each currency I'm offering the product in. I hope that's understandable
×
×
  • Create New...