Jump to content

webdecker

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by webdecker

  1. If this is still interesting... Easy to install Download zip, unpack, create database, run install script, go. Or copy one of your own example installations. No composer, no manager, no other stuff needed. Easy to understand All data is created in a hierarchical object structure. Each object has a certain type and may have a php output template. In every template you have full access to the whole data using an api which is easy to understand. No sql knowledge is necessary but an understanding of "selectors" similar to jquery. You have to have php knowledge. But you just have to get used to a manageable set of objects and methods (the api) and don't have to dive into huge frameworks which may take weeks to create a "hello world" website. Easy to use The backend for editors is kind of pure simplicity: One tree structure for the whole content. The backend for admins is easy, too: Do some clicks and you created a new data type with any input fields you like. Easy to customize and extend Almost everything of the core objects is hookable in an easy way so that you can intervene before or after a method or even replace the method. Writing your own extension or module is pretty easy. One class with some descriptive data and you got your first own module. In every hook you have access to the whole api and all your data. Easy to update core Download latest core und replace core directory in your installation. That's it. (Except from testing... 😉 ) Well documented There is a very good online documentation of the api so you can easyily find a description of all the methods of all core objects. Well informed There is a newsletter which informs you about new developments. 😀
  2. Well... pretty much... 😉 Some spontaneous remarks: 1. Did you try php method header()? 2. For readonly fields maybe create a disabled field ($field->attr('disabled'), but some browsers may not send data for it, so ensure an initial value). It should be possible to create and add a select field where you collect all templates and create an option for it. 3. Does the template you try to create a page with contain a file field or is your custom field a file field? Maybe the error message according to "localPath" refers to the page id's path in directory "assets/files" which does not exist unless you save a page (the first time). So maybe you should save your new page and then add / set other things which would rely on a path in "assets/files". 4. In modules I use... $this->error("Error message", \ProcessWire\Notice::log); $this->message("Message", \ProcessWire\Notice::log); 5. Do you mean how to create a multi language site where editors enter wysiwyig text or other fields in different languages? Well, that's a big topic for itself... Like / see https://processwire.com/docs/multi-language-support/multi-language-urls/ 6. Maybe you should post the code of your module so one can see how it all works together... e.g. when and how your hooks are really integrated. 6./7. In your method addOurHooks() you call $this->addHook() without telling when to apply the hook (before or after). The default is "after". Maybe the Inputfield::processInput would also provide an entry point to manipulate input (field).
  3. Similar to what @wbmnfktr and @poljpocket said before, I like PW so much because it is an API with a backend, the api is well documented (!), it is so easy to install, easy to update, easy to understand, easy to extend and customize, it can be installed anywhere, it is so direct, I can program simple php templates to output what I want the way I want. I could build simple websites and more complex web applications on my own without the need of experts of this and that technique or paradigm. That's cool! Please keep it simple, keep it that way and don't overload the core with too many features... ?
  4. Thanks for the console hints! ?
  5. What about the examples on https://processwire.com/api/ref/page/delete/? Due to processwire's database structure it seems almost impossible to delete records directly in the database... ? I would do such things in a template file. You asked "via the console" - yet I don't no such way, but I'm curious, how could such a way look like?
  6. If your "$terms = ..." code is really the first line in a .module file and not within a class method, then I would expect, that it won't work. It would be executed when the .module php file is loaded and I guess at this very early moment the whole machinery is not yet ready. Have you tried to write this line in a module's init() or ready() method or in ready.php?
  7. If I got it right, you are looking for pages having a (page)file (in field "file_field") named like something? Do you mean something like this...? $fieldname = 'file'; // or 'file_field' for your case...? $search = 'partofthename'; // V1 via api... $pgs = $pages->find("{$fieldname}%={$search}"); foreach ($pgs as $p) { echo "{$p->id} {$p->title}<br>\n"; } // V2 via database and api... $pgids = array_column( $this->database->query("select `pages_id` from `field_{$fieldname}` where `data` like '%" . addslashes($search) . "%'")->fetchAll(PDO::FETCH_OBJ), "pages_id" ); $pgs = $pages->find("id=" . ($pgids ? implode("|", $pgids) : "0")); foreach ($pgs as $p) { echo "{$p->id} {$p->title}<br>\n"; }
  8. @theo: I just installed it and made a quick test. Great!
  9. Sorry, too fast... My statement only works for labels and description, not for options, because InputfieldRadios for exmaple always sets $label = $this->entityEncode($label, Inputfield::textFormatBasic); - ignoring the field's textFormat setting ... ? So for options the above mentioned hook hack seems to be the way...
  10. Hi, I don't know FormBuilder yet, but if I prepare a form like this... $form = $modules->get("InputfieldForm"); //... $field = $modules->get("InputfieldText"); $field->label = 'Multi<br>line<br>label'; $field->description = 'Multi<br>line<br><span style="color:red;">description</span>'; $field->attr('id+name','testfield'); $form->append($field); //... ... to be able to pass HTML code to labels and descriptions of form fields I can set ... $field->entityEncodeLabel = Inputfield::textFormatMarkdown; $field->entityEncodeText = Inputfield::textFormatMarkdown; $field->textFormat = Inputfield::textFormatMarkdown; (ProcessWire 3.0.165, don't know whether it also applies for earlier versions...) This can probably be used in the hook mentioned before, too. Unfortunately a <p> tag is rendered around such a label, but I add to my CSS ... label p { display: inline-block; margin: 0; padding: 0; } ... and then it's ok.
×
×
  • Create New...