Jump to content

dotnetic

Members
  • Posts

    1,078
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by dotnetic

  1. And with my function the code is inserted before the page is rendered, so no jumping should occur. Also you use PW`s internal method for adding a stylesheet instead of something custom.
  2. Then the ProcessPageEdit::buildForm would be the hook for you.
  3. Where do you use the CSS? In the modules config page? Or does the module hook into a normal page that is being edited in the admin? Or do you have a custom module output inside the admin?
  4. Where do you want to use the additional CSS, in a page edit form? if so, you could use this code and edit it to use your GET variables public function init() { $this->addHookBefore('ProcessPageEdit::buildForm', $this, 'addAssets'); } protected function addAssets(HookEvent $event) { $this->config->styles->add($this->config->urls->templates . "css/your.css?v=2"); }
  5. Have you tried it in the init method instead? If not, try it.
  6. There is an alternative method in ProcessWire to determine if $page is editable by current user: https://processwire.com/api/ref/page-permissions/editable/ It returns true or false if the user is allowed to edit the page.
  7. Yeah, little bit of confusion on my side. I think it was too hot on this day. Moving to the dev branch.
  8. Changed the translation of "move" as suggested by @bernhard: https://github.com/jmartsch/pw-lang-de/releases/tag/4.0.1 Also added new translations for latest master 3.0.159 https://github.com/jmartsch/pw-lang-de/releases/tag/5.0.0
  9. The big catch is, that no HTML is generated but structured data and you only have to define your elements once and can reuse them as often as you like in one field, without modifying the template or adding new fields to ProcessWire. You can move things around and render the different elements like an image for example, however you want it. Output it as a picture element, put some divs around it, etc. Or render a heading of level two as a heading level 3 instead. This is not possible if you only have HTML.
  10. This is awesome. Have to test it in production. Thank you
  11. I think I can also lead you in the right direction. I think it's possible, if I understood you right. You can get all fields of a template and render them in a module, if you want to. And so you can with multiple templates. Do you want to do the output on the frontend or in the admin? Maybe I find the time in the next 2 days to give a more detailed answer. What do you mean with that? What you mean with modules? ProcessWire modules or just a modular approach?
  12. You can achieve what you want with ProFields: Table. It is excactly what I did for a customer portal: You can add as many items as you want, and define the type of each field of a row. For example the field "Eigenschaft" is a FieldtypePage, which pulls it options from a list, that my customer can manage himself. Additionally one requirement was, that when one item was already selected, then it should not be selectable in the other rows. I wrote a blog post how to do this: https://dotnetic.de/blog/disable-options-in-select-elements-that-are-already-selected-in-another-select-element/
  13. Shut up and take my money. I also thought a long time about making a fieldtype with editor.js, because it is just awesome to store contents as structured data. Prosemirror is an alternative, which works similar and is used in Statamic for its Bard field (which is also awesome). Is there any release date yet?
  14. Thanks @horst for this tutorial, which is very good for new users. I also updated the link in the README of the german language pack: https://github.com/jmartsch/pw-lang-de/blob/master/README.md
  15. @awesomolocity I think I found out what you meant: You selected no filter for the module name or the category and then clicked "show all". That was a bug/missing feature, which is fixed now https://github.com/jmartsch/processwire-modules-manager2/archive/v2.0.103-beta.zip.
  16. Hi @awesomolocity. The XHR request is only being made once on loading the module, and not when changing what to show. If you select "Show all" make sure, that nothing is selected in the "Search for module" field. If a category is selected "Show all" means to show all modules in this category.
  17. You won't regret it!
  18. Till which step did you get? Is the setup completed? Did the error occur within the setup?
  19. Your are welcome. I don't think that this should be in the module repository, as it is for a very special case. And If users or search engines guess your preview variable, they are able to see/index your content, which is not yet to be meant to be read, hence the unpublished status.
  20. The first selectors would not return unpublished pages. You have to use $pages->find('your-selector, include=unpublished') or include=all instead. The $pages->get() method already includes hidden and unpublished results, as you are explictly requesting pages. Regarding your problem: You want to hook the ProcessPageView::pageNotFound method and modify the output. I made a little proof-of-work module for you. It is a combination of the hooks for pageNotFound and Page::viewable. Maybe there could be a better and easier solution. Install the attached module to test it out. previewOption.module.php
  21. If you iterate through the results of pages and use the page object in that iteration (for example if you want to get the value of a field), then the whole page would be loaded into memory, which is very slow if you have many pages. This could also lead to out of memory errors. I experienced this, before I found @bernhards solution RockFinder2 which is really great. There are some discussions about the performance here in the forums.
  22. There is not only the possibility to use ProcessWire in a subdirectory and for one page only. You can also use ProcessWire content in other pages, that are not being served by ProcessWire. This process is called bootstrapping and others here already wrote about this. You can find more information in "Including and bootstrapping ProcessWire"
  23. Did that. New README with updated instructions is live
  24. @bernhard Yes, I was just about to write about it ? I have reconsidered my statement, reviewed the procedure, and revoke the statement that it is bad practive. In my project there were some problems with languages at that time, but I can no longer reproduce them. I see no problems with the procedure described by Horst.
  25. @horst's tutorial should be a sticky post in the forum.
×
×
  • Create New...