Jump to content

bernhard

Members
  • Posts

    6,155
  • Joined

  • Last visited

  • Days Won

    302

Everything posted by bernhard

  1. nope, this was a pr for another thing and is already merged
  2. Seems that this pub is a little boring But I can live with the <ironic> tags
  3. DEPRECATED - USE ROCKMIGRATIONS INSTEAD I'm very happy to share my newest module called "ProcessWire Kickstart" that I developed during the holidays Maybe some of you already saw the preview thread about this... What it does: This module makes it possible to install ProcessWire in a fully automated process. You can define all necessary settings in one single php file and you can even define "recipes" that get executed after installation. This means you can install modules, adopt settings and do whatever you want with your new site using the PW API (like creating pages and so on). You could also place a kind of frontend boilerplate on your git account and grab that after installation and place it in your templates folder. I ran out of time so maybe someone could try that out and show how he did it Additional to that there is a ProcessModule to install in your ProcessWire admin which makes creating and testing recipes super easy. Note: Alpha realese until this module gets some more testing. Please be careful with this tool since it does some heavy file system manipulations (unzipping, moving and DELETING whole directories...). Use at your own risk. Usage: Just grab a copy of the kickstarter, place it on your server, visit yournewsite.com/kickstart.php, adjust settings (like username+password) as needed and hit "install". If your mysql user does not have the rights to create a new database then you have to create a database before running the installer! Download: via SSH: cd /var/www/yournewsitedirectory wget baumrock.com/kickstart.php // or using curl curl baumrock.com/kickstart.php -L --output kickstart.php Manually: Klick baumrock.com/kickstart.php and upload the file to your server Note: baumrock.com/kickstart.php returns the current master file from the gitlab repo and changes the namespace of the script so that it can install itself via recipe. If you don't need to install the kickstart processmodule via recipe you could also download the kickstart.php file from gitlab. Screenshots/Walkthrough: The initial Screen: You can either upload a file via the left panel or take my example file from the gitlab repo: This way you can create your own kickstartfiles and host it on your own accounts. When the file is loaded you can easily edit all necessary informations, like username, password and the url where to grab ProcessWire from. I just tried it with an old version as well... 2.7 worked just fine (having the old installer that recently was updated) but an ancient 2.2.4 version failed. I don't think anybody will ever need to install lots of old versions of pw with this tool but I wanted to mention it here. Hit "install" and lean back - on my VPS it takes 15 seconds to install my very own custom version of processwire with all modules that i need After logging into your admin you'll see that all modules from your recipe are installed: Recipe Editor: As recipes are executed after processwire was installed you have all your API magic available there. Running this scripts is only possible inside of a working processwire installation, so I created a module to help you with that task. See the comments of the sample recipe for more information! I hope this tool helps you to save lots of time and create lots of awesome ProcessWire websites I would be happy to see how you use this and please share useful recipes here in the thread so that everybody can profit. Maybe you just want to throw in an idea what could be done (for example I can imagine a recipe that checks file permissions on the system after installation)... Some parts of the code and maybe also part of the idea are taken from @Soma 's old and still great online installer, thx for that!
  4. If you haven't heard about it yet you should read about these new vulnerabilities that affect almost any computer built since 1995 https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability) https://en.wikipedia.org/wiki/Spectre_(security_vulnerability) https://insights.ubuntu.com/2018/01/04/ubuntu-updates-for-the-meltdown-spectre-vulnerabilities/
  5. Nice idea! I have no need for it, but if i had, it would be great to have such a feature! And I can think of lots of usecases where someone could need this... [offtopic] I'm out
  6. thanks @SamC that brings some light into the dark of customizing the admin, at least for me can you please elaborate how you created this theme's less file? did you just copy&paste&modify it from the original theme? I haven't had a look into the theme's less yet, but regarding the template designer module i have some nice news: I'm just working on the PW Kickstart module and creating a processmodule which makes it very easy to modify the code of the recipes and run it. That's a perfect fit for modifying LESS files of your theme, compile them on save and instantly show the new theme. I'll try to put something together in the next few days with the help of your tutorial
  7. still i find chromes search shortcuts the best option - at least if you know where you want to search for your term... custom search for "custom admin"... lots of annoying ads (yes, i know you can "turn them off"...) search "pw custom admin" and finally searching in the blog: "blog custom admin" But maybe for newcomers such a search can be helpful (though I think someone already built one some time ago...)
  8. hi @owzim me again with a more important request i opened a PR on github to trigger an "loaded" event after acefy() is done. would be great to include this in your module, thanks
  9. hi @owzim i want to include your module in my kickstart module and found this issue on the uikit admin theme (full width font size input), would be great to get a fix for it thanks
  10. Ok just checked ASM inside an ajax loaded repeater with ajax loaded repeater items and this also works. Thanks for your example. That makes sense... Shouldn't it be possible to hook the buildForm method, check for your field and add scripts depending on the field settings there? A little This works: $wire->addHookAfter('ProcessPageEdit::buildForm', function($event) { $form = $event->arguments(0); foreach($form->fields as $field) { if($field->name != 'testasm') continue; if($field->inputfield == 'InputfieldAsmSelect') $this->config->scripts->add('/site/templates/scripts/alert.js'); else $this->config->scripts->add('/site/templates/scripts/otheralert.js'); } }); But I agree it would be nice to have this built into the inputfield somehow...
  11. true... though I had no problem with that so far and I can't really imagine a situation where this would be a problem? do you have an example? regarding the initial question: just tried an ASM loaded by ajax on a fresh DEV and it worked without any issues.
  12. Don't know about the core Inputfields but this can easily be done by adding scripts in the init() method of the module, not the render method.
  13. Credits to Ryan - I didn't know about that detail and he added it to the blogpost while proofreading it Sorry I think I misunderstood you try $headline = 'Happy ' . date('Y'); $this->headline($headline); $this->wire('processBrowserTitle', $headline);
  14. bernhard

    Fields

    There are several links inside this thread. Using google to search the forum works really well, see the link in my signature
  15. $wire->addHookAfter('InputfieldText::render', function($event) { $field = $event->object; if($field->name != 'title') return; $repeaterBtn = $this->modules->get("InputfieldButton"); $repeaterBtn->attr("value", "Generate something"); $repeaterBtn->attr("type", $submitID); $repeaterBtn->attr("id+name", "btn"); $repeaterBtn->attr("href", "/admin/page/edit/?id=1"); $repeaterBtn->attr("target", "_blank"); $repeaterBtn->addClass("customClass"); $event->return .= $repeaterBtn->render(); }); btw: panels are a great alternative for new browser tabs: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#using-internal-components-modules
  16. bernhard

    Fields

    Hi @Jwenk and welcome to the forum, the preciser you ask your questions the better the answers will be What are you trying to do?
  17. hey @Federico i didn't read all your code but I would hook the inputfield's render method of the field that is inside the repeater. or you create a runtime markup field with your code. that might be easier. the only thing you have to take care of when hooking yourinputfield::render() is that the $field->name is not the field's name only but it has some appended or prepended string (repeater name or id, not sure at the moment... you can easily check this with tracy). always start without any additional checks/ifs/returns and then continue step by step until you get where you want, for example this in your /site/ready.php: $wire->addHookAfter('Inputfield::render', function($event) { $field = $event->object; bd($field->name); }); then you can modify the hook to only execute when needed (like hooking InputfieldText instead of the Inputfield base class, doing a return when the field name does not match...). i think @Robin S came up with a good solution how to check for the right field name inside repeaters but i can't find where he mentioned it in the forum. this is another way of checking that i used, but maybe robin can show us the better way
  18. I'm sorry @modifiedcontent but I put a LOT of effort in the blogpost, so as long as you don't come up with preciser descriptions of what EXACTLY you are trying to do I can not help. Maybe someone else understands your needs better and can therefore help you better. maybe a google search for "dashboard" has some interesting reads for you: https://www.google.at/search?q=site:processwire.com+dashboard
  19. hi modifiedcontent, this sounds a little strange. the easiest way of editing content is of course the normal pw edit screen. you can do a lot with normal pw features (like hiding fields on several conditions etc). if you really need more customized forms I show how you can do that here: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#create-our-first-real-inputfields ; that's only one way of doing it. you can also easily modify the page edit forms via hooks. sorry for that. you can also start by using InputfieldRuntimeMarkup - maybe that's easier to begin with... totally up to you. you can create several pages in one module: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#hello-page2 ; but you could also create one module for each page. It depends on you and your usecase which level of separation makes sense. sure, thats what i do throughout the tutorial. start with hello world, end with a custom CRM
  20. hm... @dragan i guess the runtimemarkup field only has to return the "<button>" element (without the <li>, <div.InputfieldContent> and so on... you are right see this post for example (and the following): and also this: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#using-internal-components-modules (scroll down to the buttons section)
  21. Nice one Canada should be adrian's territory - I hope they hired him
  22. really nice feature introduced in november: live share (great way of collaborating with others!) https://code.visualstudio.com/blogs/2017/11/15/live-share ps: i don't want to abuse this thread for interesting stuff about vscode that is not related to processwire if that is not wanted...?
  23. @SamC great. Maybe you want to use less.js (http://lesscss.org/#using-less-third-party-tools) to show a very simple way of playing around with the admin themes LESS files? We could even build a theme generator using less.js and/or AIOM's php based less parser... Changing colors of the theme should be a lot easier than downloading source files, compiling everything, uploading...
×
×
  • Create New...