Jump to content

elabx

Members
  • Posts

    1,479
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by elabx

  1. One issue is I am not using delayed output but rendering normally through each template/file. Another issue is that I am using also repeater matrix heavily and to keep things organized I also decided to declare the field rendering in each "matrix type" file, so I also wanted to had "alt templates" for this repeater matrix fields rendering.
  2. Was just driving back when I thought: Why the heck am I just not checking if the file exists, though I didn't know about is_readable Thanks @kongondo, @Robin S !
  3. Hi, I've gone a different way to achieve kind of "auto swap" of template files through hooking TemplateFile, because I wanted to swap template files if a template file with some naming convention exists (eg. home.custom.php replaces home.php) I'd like to ask for some opinions about the performance of this hook and if it makes a sensible approach because it feels a way too much to check for files on disk on every template render: $wire->addHookBefore("TemplateFile::render", function($event){ if($this->user->name == "admin"){ $templateFile = $event->object; if($templateFile->page->template == "repeater_content"){ $existingFiles = $this->files->find($this->config->paths->templates . "fields/content/"); $customFileName = $this->config->paths->templates . "fields/content/{$templateFile->page->type}.custom.php"; if(in_array($customFileName, $existingFiles)){ $templateFile->setFilename($customFileName); $event->return = $templateFile; } elseif($templateFile->page->template == "home" || $templateFile->page->template == "basic-content" ){ $existingFiles = $this->files->find($this->config->paths->templates); $customFileName = $this->config->paths->templates . "{$templateFile->page->template}.custom.php"; if(in_array($customFileName, $existingFiles)){ $templateFile->setFilename($customFileName); $event->return = $templateFile; } } } });
  4. Why is this mandatory? Does it have to do with template configuration of trailing slashes?? Can this be altered to don't matter in a global way??
  5. EDIT: Created topic insted of post.
  6. This works?? strtolower($page->options_field->title);
  7. Doing this myself right now in a project, and very weird what's happening to you because I'm also using the table field inside a RepeatrMatrix and I'm not having any issues with adding rows.
  8. Don't think this is possible because Table field uses it's own schema and adds a database column per table column, so changing it in the field would change it to all fields it is instantiated. The quickest idea I have to hack around this is to use RuntimeMarkup field and render your custom inputfield using jQuery datatables or something simliar and save it's data in a hidden text field).
  9. @theo Maybe I jumped ahead to help too fast, haha, ¡De nada!
  10. Every CKEditor field has a configuration field Custom Editor CSS File (regular mode), by default it is: /site/modules/InputfieldCKEditor/contents.css If you set this option in all your CKEditor fields, with the same path, they will share that css file. https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-css-file
  11. You don't have to write a different file for different field, you cant point the all to the same file. Though you do have to configure each one.
  12. Does anyone know if this works with Multiplier fields?
  13. I think you need to concentrate on parsing the CSV file with a library like this one. Or also this function is built in PHP which takes a string as input: http://php.net/manual/en/function.str-getcsv.php
  14. I think your are outputing things wrong I see this line: <?php foreach($pages->find("parent=1034") as $item) { echo "<li><a href='index.htm#' data-filter='.{$item->select->category}'>$item->title</a></li>"; } ?> </li> You say the category field is named category? what is that select field you are accessing? I would have expected the code to be like this: <?php foreach($pages->find("parent=1034") as $item) { echo "<li><a href='index.htm#' data-filter='.{$item->title}'>$item->title</a></li>"; } ?> </li> This should output the category title. And on the actual portolio items: <div class="portfolio-item {$item->category->title}<?php echo $single->category->title ?> ">
  15. Just in case you haven't crossed it:
  16. I think you have to call save on the field object, not the global $fields. EDIT: what about: $page->set("hiden_field", $value); Because I think you are trying to save the actual field (in the whole PW context), not the field that actually belongs to the page. This would set the field value so it get's saved after the hook.
  17. I've gone this way leveraging on shell scripts to automate things (update files in the multiple site/templates folder) and if I need to add fields or anything database related, I use Migrations module which includes a CLI to run migrations on multiple installations without going through the graphic interface.
  18. Does anyone know if there is a way to enable styles configuration through the Inputfield settings, as a textarea configuration? That is, instead of calling the configuration mystyles.js from disk, actually call it from a field setting. Maybe enabling an extra config field through a hook abd faking a url?? I'm going through this trouble because I have multiple sites sharing templates through Git and I'd like to enable specific styles to only some sites. (Another solution would be to just ignore files with .gitignore, but want to try solving it on the processwire side)
  19. Just in case you haven't crossed it, is a more recent version of the multisite module by @kixe https://github.com/kixe/Multisite
  20. If I understand correctly you have to get the events from $recurme->find() or equivalent.
  21. Yes pal don't even say sorry, I wasn't really asking for features, rather I was just trying to give my opinion about the usage and the overall project I guess the word wishlist was misleading haha.
  22. I really like this!! I just thought of using this module in the following case: I have some big configuration screens (in page edit screen) that I want to reorganize, so I thought of doing it with this mockup tool prior to actually editing fieldset/fielsettabs setup, get user to approve it and write the migration script (this same template configuration migrates to around 20 or so other sites). I also use PW's admin as dashboard for different types of applications (and try to use the API as much as I can) so mocking up all this stuff would be super useful for me, and the roadmap does seem too look like a perfect fit for the type of activity I do. (I was writing a big wishlist until i realised it was all on the roadmap :D)
  23. Hi everyone! Does anyone know if it's possible to set the amazon S3 uploaded files to the infrequent access storage class?
  24. This, every day of the week! Always keep in mind that the PW admin is basically a blank page with a masthead (or sidebar haha), everything else is optional through roles and permissions.
  25. Love the UI update,I think it's something that is really going to round up the module, congrats @kongondo you rock, aweome work!
×
×
  • Create New...