Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/28/2022 in all areas

  1. This week I'm happy to report that the InputfieldTinyMCE module is now released. It is currently released in the modules directory and GitHub but the plan is it will be merged into the core, likely before the end of the year. No need to wait till then though, as you can start using it today. Please consider the module in beta for the moment, though the TinyMCE library itself is in a stable state. A lot of the work that went into developing this module went into the configuration aspect. Here are a few a more details that weren't covered in last week's post: After installing the module, on the module configuration screen, you can decide whether several settings should be configurable for each field, or if you want to just configure them with the module (affecting all fields): One of things that I thought was important was to make it a lot simpler to add custom classes/styles to the editor. I always found this kind of a pain in CKEditor. So in TinyMCE, I made it so that you can just define these custom styles with the field settings using just simple CSS definitions. InputfieldTinyMCE takes care of converting to a format that TinyMCE can understand (for its menus), as well as the styles to show in the editor. For instance, I wanted to add some common Uikit text classes to a custom "Uikit" group in the Styles dropdown: And here's the result in the editor: The markup produced has the correct Uikit classes in the markup so that on the front-end of my site the output is Uikit ready. You can add 3rd party or your own custom plugins from the module settings: And then you can enable them for any field in the field editor: These are just a few interesting tidbits, but there's a lot more. Also, if you didn't see last week's blog post, that covers a lot more too. Either way, I'd encourage you to download InputfieldTinyMCE, give it a try and please let me know how it works for you. If you come across any bugs, please open an issue report. Thanks for reading and have a great weekend!
    17 points
  2. Hi, I'm very happy to announce that processwire is finally available on turnkey. Here is the link https://www.turnkeylinux.org/node/32567 Turnkey offers production ready free open source server images, meaning that they give you servers already installed and configured ready to be facing the internet. You can now host your own processwire without having to install or configure it. Thanks, Have a good day !!
    6 points
  3. Welcome @protro ? What you have is fine. This is another way you could do it, which is perhaps a bit more readable: $items = new PageArray(); foreach($page->children as $child) { if($child->hasChildren) { $items->add($child->children); } else { $items->add($child); } } $items->sort('-date'); And if the objective happens to be "I want all the descendants that don't themselves have descendants" then this is potentially quite a bit more efficient because it's only a single DB query: $items = $page->find("children.count=0, sort=-date");
    6 points
  4. Great news! I've just installed the new Inputfield on a testing installation. It seems to work well. I've tried both standard and inline modes. Pwlink and pwimage are working, same classes are added for alignment as before. I can't see HTML Purifier. I guess content managers will be happy now inserting all the pink h1's everywhere they love so much) Is it planned or will this be abandoned? As @cb2004 said migration instructions from CKEditor are indeed needed. Hope they are planned. And I guess we should politely ask (beg?) the CKEditor-related module authors to create new versions for TinyMCE. I am talking about: @Robin S and his HannaCodeDialog, @FireWire and his Fluency Translation... Please, please))
    4 points
  5. That's great. Can't wait to find a bit of spare time to take it on a test drive. Cool that the module is already on TinyMCE 6.2, as that release comes with a more flexible autocomplete api. This is going to shave a lot of (or almost all of the) JS code from my autocomplete module.
    4 points
  6. You can do that. RockMigrations will only do what you tell it to do. You can also do that and sometimes I do it myself. It's just a reminder that if you apply changes that are somewhere in code of a migration your changes will get overwritten. If you apply changes via GUI that are not set in any migration than you'll be fine and your manual changes will be kept. That indicator could be improved I guess. For example it could only appear on fields or templates that received changes from a migration. And changes done via RockMigrations could be listed instead of the generic warning. If that is an important feature for you (or anybody else) I'd be happy to merge any PR in that direction and provide all the help needed.
    3 points
  7. You can also use the selector with the children() method: $page->children("children.count=0, sort=-date");
    2 points
  8. Have a look at the docs, here are two pages I find very helpful. https://processwire.com/api/ref/page/ https://processwire.com/docs/selectors/ Cheer's
    2 points
  9. Hello @ all I want to share a new module with you, which makes the creation and validation of forms easy. Take a look at the following example of a simple contact form: // A very simple example of a contactform for demonstration purposes $form = new Form('contactform'); $gender = new Select('gender'); $gender->setLabel('Gender'); $gender->addOption('Mister', '0'); $gender->addOption('Miss', '1'); $form->add($gender); $surname = new InputText('surname'); $surname->setLabel('Surname'); $surname->setRule('required'); $form->add($surname); $name = new InputText('name'); $name->setLabel('Name'); $name->setRule('required'); $form->add($name); $email = new InputText('email'); $email->setLabel('E-Mail'); $email->setRule('required'); $form->add($email); $subject = new InputText('subject'); $subject->setLabel('Subject'); $subject->setRule('required'); $form->add($subject); $message = new Textarea('message'); $message->setLabel('Message'); $message->setRule('required'); $form->add($message); $privacy = new InputCheckbox('privacy'); $privacy->setLabel('I accept the privacy policy'); $privacy->setRule('required')->setCustomMessage('You have to accept our privacy policy'); $form->add($privacy); $button = new Button('submit'); $button->setAttribute('value', 'Send'); $form->add($button); if($form->isValid()){ print_r($form->getValues()); // do what you want } // render the form echo $form->render(); This piece of code creates a simple contact form and validates it according to the validation rules set. Inside the isValid() method you can run your code (fe sending an email) Highlights: 30+ validation types Support for UiKit 3 and Bootstrap 5 CSS framework SPAM protection Highly customizable Hookable methods for further customization Multi-language You can download and find really extensive information on how to use at https://github.com/juergenweb/FrontendForms. Please report errors or suggestions directly in GitHub. Best regards and happy testing ? If you have downloaded the module in the past I recommend you to uninstall the module completely and install the newest version 2.1.14. There are a lot of changes in the new version, so please test carefully.
    1 point
  10. Hello all, I'm working on a concept for a module that sends error reports via email to different recipients based on different error levels (notice, warning, error) and I don't know yet how to best tackle this. It would be preferable if I could use PW internal classes, functions. I had a read through https://processwire.com/blog/posts/debugging-tools-built-in/ and especially the logging section. But looking at related classes like FileLog and WireException, it doen't seem like one can hook into them. I'm quite tempted to use NetteTracy, like TracyDebugger does. It seems like it can do what I want https://tracy.nette.org/en/guide#toc-production-mode-and-error-logging. PW is writing errors/exceptions to the log, I just wouldn't know how to tap into this, especially for different log levels. If anyone can point me in the right direction it would be much appreciated.
    1 point
  11. @ryan I haven't tested this out yet but from what you are saying (you sound very passionate about the change), I am as excited as you have been to jump in. We start a new build next week and I am going to take the leap as it is going to be merged in the core. The site won't be live for a few months so it will be a good opportunity for us. Just as an early question, one thing my clients always ask for is the ability to embed social media posts or similar, it's the only thing they miss from another CMS which I think you can guess what it is. Is TinyMCE geared up for this as I always found CKE a complete nightmare to manage this? Finally, I am guessing with old sites everything will have to be reconfigured with regards to toolbars/settings? Thats fine, but the core code will obviously have to contain some instructions that CKE is EOL, and some documentation will have to be created. I am sure you have already considered this, but we obviously have A LOT of old sites that will need reconfiguring, and lots that use Combo now as well.
    1 point
  12. Another thing is, you can re-use custom page classes in new projects and have their fields/templates created automatically. Develop them only once, copy them over to a fresh PW install, and there you go.
    1 point
  13. What do you struggle with @Ivan Gretsky? I use RockMigrations for every project right now. You got version control for your fields and templates, and even more. So if you are using git and develop new features, it is of great use because it adds the needed fields/templates when switching branches. Also in conjunction with RockFrontends livereload feature, this is a lot of fun. You add a field in the migrate.php (or somewhere else where you need it, like a custom page class) and the page in the admin autmatically shows the newly added field. This made my workflow so much quicker. I don't use the deploy feature (github actions) because I got my own github actions, so I can not say anything about that.
    1 point
  14. Good day, community! I have found another great opportunity to support PW ecosystem - just look here! This is @teppo's sponsorship page. He is doing such a load of super cool and useful things, that sponsoring him is a sure must))) Please start throwing your money at this fine gentleman)) Pitifully I cannot do it myself now easily, but I'll find a way. I almost feel guilty for not paying for Wireframe)) I've updated my other post with the modules' authors accepting donations list - just in case. You can check other great sponsorship chances there.
    1 point
  15. Hey @gornycreative thx for the reports! I've just pushed an update that removes all hardcoded /site paths. See v2.1.13 No, not in this case. RockFrontend has the "smart paths" feature so you can simply do $rockfrontend->styles->add("/site/foo/bar.css") and it should work no matter if the installation is in a subfolder or not. It will automatically do what you have suggested, then get the modified timestamp of that file and then use $config->paths->url... to output that style in the page <head> and append the modified timestamp for cache busting. So you'd end up with something like this: <link href='/project-x/site/foo/bar.css?m=1666772973' rel='stylesheet'><!-- _main.php:10 --> Magic paths do not work in CSS files of course, so I have fixed those hardcoded /site urls there ? Let me know if everything works now as expected!
    1 point
×
×
  • Create New...