Jump to content

alejandro

Members
  • Content Count

    90
  • Joined

  • Last visited

Everything posted by alejandro

  1. But $slider is not a field in the block template, just a php variable in the template code. I'd need then a new checkbox field in the slider type block just for this.
  2. Anyway, it can be done in the render page with: foreach ($page->blocks as $block) { if (in_array($block->template->id, ['77','79'])) { $slider = true; } echo $block->render(); } So the blocks (using pageable field) with templates 77 and 79, for example, set the variable and it can be used in he appended _main.php file. But it seemed more logical to define it in the block itself.
  3. But I wanted quite the opposite, I mean: 1) The rendered page is a block containing a slider (block-slider), so I declare a variable here, like $slider = true. 2) The render page ("basic-page" for example) renders that page/block 3) I'm using markup regions and in the _main.php file: $slider = true, so it outputs the necessary scripts and styles for the slider to work Thought it was a good way to optimize page load speed, to only use the scripts/stylesheets needed for each type of rendered block. But I misunderstood how point 2) is actually working.
  4. Your way seems better to me thanks. Curiously using "page list" as input field type shows all pages tree, using a "select" shows only users.
  5. I think I found the solution. Edited the admin template to allow editor role to view it.
  6. Hello, I've created an "editor" role and there is a template (blog post page) with a page reference field where it should be able to choose an user (post author) but it seems it doesn't have access: "You don't have access to list page /alambre/access/users/" What permission should I add to the editor role? Already added view/edit in user template. Thanks in advance.
  7. Hello there, I'm using a pagetable field with several templates and render(), it's possible to pass a variable? for example: - file "block" where: $slider = true - basic-page: $block->render() - _main: if ($slider == true) { slider scripts and css } (but $slider doesn't exists and throws an error, as I understand render() just outputs the html markup) Is there a way to do this? Thanks, Alejandro.
  8. Yes, I upgraded to the latest version. Anyway, I've changed it to repeater field with image + page reference fields, so problem solved.
  9. Hello, I'm having the Select button disappearing, so I can't select anything. Is there a fix for this issue? I'm using last version of the module. Thanks!
  10. So much to learn... even searching the documentation
  11. Well, I've just recently installed it, but I need to sit and learn to use it. It seems it's going to be of great help.
  12. Thank you both. I like solution #3 $session->order = array_merge ($session->order, ['price' => 50]); I didn't know about "setFor", didn't found in docs or cheatsheet. And, what's? bd($session->shop); The array_merge works without it
  13. Hello, after creating an array and assigning it to a variable in session: $order = array (); $order['token'] = 'token'; $order['product'] = 'product-name'; $session->order = $order; I try to insert another item: $session->order['price'] = 'price'; But it doesn't work: Notice: Indirect modification of overloaded property ProcessWire\Session::$order has no effect in... Isn't possible to modify such session variable? I could build another array from the session variable, add the new item, and then store it again in session, but doesn't looks good. Thanks!
  14. Well, I found a solution, duplicate mystyles.js file (or whatever name), change the name and use it for the conflicting field.
  15. Hello. Now it´s happening again with other field. I really don't find how to show the custom styles... It´s enabled for other fields and working.
  16. Yes, it's been fixed indeed, it works. Thanks.
  17. Hello, would you mind to point how to do this, I get this very same error. Thanks.
  18. Finally I found it. It seems a conflict with the module Image Extra, which I installed previously, once uninstalled the animated gif is uploaded without problem.
  19. Well there is something weird going on, I tested the same file in another site, same version 3.0.25, (even animated gif module not installed) and it worked perfectly. Same setup for the image field in both sites.
  20. Version 3.0.25, and I already installed that module. The thumbnail is ok but it's not saved, ...
  21. Hello, I can´t upload an animated gif into an image field, when using "Choose file" or dropping the file onto the field it keeps spinning but doesn´t finish, and when saving the page it's not uploaded. Any idea why? Thanks in advance, Alejandro.
  22. Hello, it happened exactly to me: no way to display custom styles to "body" field for 2 days, but after enabling successfully to another rich text field they appeared in body field too.
  23. Well, I figured a way: $array = array(); for ($i=0; $i < (date("n")); $i++) { $array[] = $i; $field->months = $array; } But, just for the knowledge, is there a way to add $array to $field->months ?
×
×
  • Create New...