Jump to content

LuisM

Members
  • Content Count

    24
  • Joined

  • Last visited

Everything posted by LuisM

  1. Hi @Peter Falkenberg Brown sounds like you should have a look at this: https://processwire.com/blog/posts/multi-instance-pw3/ and hook into your Pages::saveReady method on Site1 to move your partials to Site2. What comes to mind when trying to copy your files/images via CLI is the mentioned problem with IDs. I think you should avoid manually moving the files and let do PW the handling. Im in a hurry right now. But what about a "copyPage" function inside the hook, which calls your 2nd PW Instance and creates the new Page in Instance2 with the Values of Instance1?
  2. you should have a look at the /site/config.php and set the Database Credentials accordingly.
  3. Well to quote Mr. Wilde I would second this. On my Job I had to venture in the Lumen/Laravel ecosystem a bit and really liked the Migrations approach they take. (https://laravel.com/docs/7.x/migrations) I really missed a proper migration integration when I started some new PW projects in the past. @LostKobrakai's approach was therefor my way to go. But ProcessWire is evolving and the lack of support he could give is a strong driver to switch.
  4. @LostKobrakai @bernhard sorry for the Off-Topic here, as I know both of your modules and follow both of your ProcessWire work for quite some time now. Would you mind to elaborate a bit on why you are not using PW anymore and what you have choosen instead?
  5. <div class="row"> <?php foreach($pages->find("template=spiel") as $spiel) : ?> <ul> <?php foreach($spiel as $field => $value) : ?> <li><?= $field ?> <?= $value ?></li> <?php endforeach ?> </ul> <?php endforeach ?> </div> Will output all the template fields in a <ul> for each Page. The caveat is, it will also output system fields. To get only your "custom" fields you could iterate the pages fieldgroup like this <div class="row"> <?php foreach($pages->find('template=spiel') as $spiel) : ?> <ul> <?php foreach($spiel->fieldgroup as $field => $value) : ?> <li><?= $field ?> <?= $value ?></li> <?php endforeach ?> </ul> <?php endforeach ?> </div> Which should output the corresponding Field with Value. To make the code a bit more readable I usually use the <?= $var ?> shorthand for <?php echo $var ?>. Some may like this Syntax, some does not.
  6. @teppo thanks for the mention in the last Weekly, much appreciated 🙂 I recently pushed a new Version to Github and changed the MarkupTables with DataTables. I am well aware that the module isnt that polished someone might expect. I more or less hacked it together to fullfill some very specific needs I had. But, I plan to work on it from time to time. One thing which came to my mind was to integrate the recently published LogStash Module. Im always open for suggestions 🙂
  7. And the next piece of information... Have you ever asked yourself on mondays, what should I do now with my project? Could I start with $method1 or would I like to do $method2? The right answer is, none of them! PLAN YOUR TIME AND TASKS! So far we have learned about basic conceptional work, estimation matrix and components/sub-components. The next logical step would be to use this knowledge and start to manage ourself. Lets say we have 183 Tasks as a result from all our work we have done upfront. Great. We also know how long each and every task would possible take. Better. We can now use a method called TimeBoxing. If you are familiar with Scrum you probably know about sprints. Which is nothing else than a timebox. I dont want to dig deep into the Scrum Framework. So lets take this method and use it for ourself. The typical dev timebox in my teams runs for 2 Weeks. So on mondays we plan what we want to achieve in the next 2 weeks. How can I timebox myself? Lets assume you work 40h a week, for a 2-week timebox we have 80h pure worktime. Typically you dont work 8h straight on your tasks. Maybe your phone rings, you have to answer some emails or you help a colleague. We assume a "task efficency" of 80%. So 80% of our time could be put straight into tasks. Which means 80h * 0.8eff = 64h of effective Worktime for our project in a 2-week timebox. Lets have a look at our tasks now. There are 183 Tasks in our "Backlog". Wow thats a lot. Lets start to prioritize them. What is essential for our project and so on. Once done, great. But there are still 183 Tasks?! You remember our estimation we did? Create a new Backlog for the next 2 Weeks. This could be a Excel file or what ever. Take all your prioritized tasks which fit into your 64h. Congratulations you have now planned your very first timebox. Your timebox should now include so much work to keep you busy for the next 2 Weeks. The core concept of project management is to break complex systems into smaller much more easier and understandable fragments. Therefor, see yourself as a project which has to be managed 🙂 An example Project Backlog and Timebox Backlog down below. Left is the timebox, right is the project
  8. To elaborate a lil bit more on this topic 😄 yeah yeah yeah I know I know. Project Management sucks and we have a self-organized team yada yada... Could be but...who is the person communicating with clients and stakeholders? This should be the project lead. Therefor you should always have a good understanding about project progress. Lets asume you are not a freelancer and have to manage a dedicated developer team or ui team or whatever. Try to have a minimum viable project (MVP) defined and refined. What does this mean? You have carefully planned and refined a piece of software which is able to provide the basic feature set to satisfy the End-Users needs. In case of an eCommerce project this could be a piece of software with the following set of methods a cart a product page the possibility to create a product the possibility to put a product into the cart the possibility to order the items in your cart We try to cut out every single thing which is not needed to have a running eCommerce system. Things like newsletters, categories, payment methods via modules etc etc. Why should I do this you may ask, well we are humans and we have simple minds. The greater and more complex a problem is, the more problems we have to understand the system. Next comes an refinement. Tackle each component and identify sub-components. Something like this CART Order button -> createOrder() Remove Product -> removeItemFromCart() List my Products -> getCartItems() Every bits and pieces we need to develop a basic version of our Cart. Next should be an estimation meeting. What do we think each component of our MVP would take to be completed? Depending how granular you have been in your refinement you could come up with something like this (estimation in hours, you could use days, story points, apples, eggs what ever) CART Order button - 4h Remove Product -> 2h List my Products -> 2h Total: 8h Do this for every single component! You, your team and your client now know what it takes to create V1.0. But be carefull, v1.0 doenst necessary mean you have a shippable product. We just try to cut out complexity 🙂 Once done with every component create an estimation matrix, example below. The power of project management starts to unfold 🙂 You can start to create tasks based on your refinement and estimation and furthermore you can prioritize. You have to discipline yourself to do all this work, I know. It could be a bit tedious and boring, but once implemented you have the knowledge and the insights about project progress AND your project is well planned, well tought and manageable.
  9. Click on Branch:master .then => click on Tags
  10. Hi huseyin, just to put things into the right perspective. I studied design with an emphasis on concepting digital media and I am a certified scrum product owner. My projects are in the range of 100 - 500 dev days with usually 5 - 10 project members and a variety of stakeholders on top. Usually I start with a blank piece of paper writing down my ideas, thoughts, possible workflows etc. call it a typical mindmap. This should give me a brief understanding of the problem we try to solve. From this first rough idea I iterate into several pieces our project may need, something trivial like a login or newsletter register. The output of the second phase usually are all needed views and workflows we try to tackle. This could but doesnt have to include wireframes. Lets call it the refined product/project concept. Depending on the team, client and project we involve UI/UX for information architecture and design or use an existing Frontend Framework. But, not involving UI/UX doesnt mean we dont need a rough Design Wireframe. It is in yours, your developers and your clients best interest to atleast provide rough wireframes of every single view. At this point we should have the following documents project mindmap Initial concept with workflows wireframes for every view What could help to understand your project/product better is to create a product canvas. I attached 2 examples below. I highly recommend to try this method out. It helps to communicate, share and maintain a general overview of your project troughout the whole team including your client. Next we start to refine the concept into a technical concept, which means my developers have to provide an architecture blueprint. What servers are needed? How do they communicate? etc... What we also need is a planned database, how do our models look like? How are they organized? What services do we need? You get the point. This looks like a lot of work and it is. Usually 30-40% of our billable time is from concepting. If your client says a conecpt isnt needed, he knows what he wants. Believe me, he dont and he needs. Do yourself a flavor and plan your projects èn detail before touching your IDE. It will save you a lot in the longrun. [edit] You asked about tools, we use the following JIRA Confluence Slack good ol Excel If you need any help I would be happy to anyswer your questions.
  11. Your tree should therefore look like this: Access/Users - with n Users Accounts - with n Account Pages All your other pages...
  12. You dont need an own role for each customer. Just make a new Field->Page Reference and assign it to your User template and to every template you want to restrict for this particular user. Create a new Page as Container which contains all your Customer Accounts and let your field reference the created account. Also this give you the ability to have multiple users per account. So the next time you do a Pages->find you could use a selector like this: account=$user->account->id Regarding your Roles you now just need your basic roles like view edit delete for the particular action you want to deny based on Roles/Permissions
  13. @bernhard I recently installed your RockDateTime module and noticed some strange Errors I'm sorry, couldnt investigate further for now.
  14. @lele_ballackthe only fix would be to not use CKEditor for this field, as CKEditor will output Markup. Whenever you put CKEditor Markup inside a <p> Element you will get the same result. As a reminder: Whenever outputting CKEditor, use a proper div, article, aside element to wrap the output.
  15. @bernhard Im well aware of profiler-pro 🙂 I am a ProcessWire fanboy since 2014 but unfortunatly lost my forums account 😞 maybe some old veterans remember me. Anyways, why do I replicate the pro module you may ask, good question. I have a lot of small PW Instances running for various reasons and dont see the need to purchase a module for my profiling needs. Usually my instances are running solely on the ProcessWire Admin because the time I did websites are long gone. This in mind there are times I want to see how a specific module I my application runs. How do I achieve this? The core class ProcessController exposes the hookable Method ::execute. If your site is in Debug=true you already get timers before and after the method call which is totally fine, but once in production I want to avoid setting the site into debug mode just to get these timings. So we add 2 Hooks to ::execute $this->addHookBefore("ProcessController::execute", $this, 'startProfiler'); $this->addHookAfter("ProcessController::execute", $this, 'startProfiler'); This gives us also the ability to enrich our profiling with some more data like the requests memory_peak_usage or the avg_sys_load for the last minute. These are the 2 values I am the most interested in because they will provide me enough data to see bottlenecks not only on a custom Process Module but also on a specific method. For example this dataset will give me the opportunity to track down a single method in one Class to inspect the code if there is something fishy.
  16. Pushed Version 0.1.1 - added new PageRender Timer (tracks just the page->render() time) - cleaned Profile Dump - JavaScript refactored (was a mess before #SundayEvening) - added new ProfileName Method to avoid duplicate entries Still TODO - Filter / Limiting / Aggregation of logged datasets - more tracking options - maybe add a webhook to feed other services, will see
  17. Hi there, while developing a sideproject which is completly build with ProcessModules i suddenly had the urge to measure the performance of some modules 😉 as a result, say welcome to the FlowtiAppPerformance module. It comes bundled with a small helper module called FlowtiModuleProfiler. In the first release, even though you could select other modules, it will track the execution of selected Site/ProcessModules. This will give you the ability to gain insights how your Application behaves. The Main Module itself will come with 2 Logging Options, Database or PW Logs. Select Database for Charts and Logs...well If you just want your profiles as a simple log file in PW. You also could choose to dump the request profile into TracyDebugger as shown here: Dont wonder about my avg_sysload, somehow my laptop cant handle multiple VMs that good 😄 Settings Screen Monitoring FlowtiLogs again, dont look at the sysload 😄 I will update the Module in the future to give some filter options and aggregation, but for now it satisfies my needs. I hope it is helpfull for some. Module is submited to the directory and hosted at github https://github.com/Luis85/FlowtiAppPerformance Any suggestions, wishes etc. are much appreciated. Cheers, Luis
  18. @d'Hinnisdaël first of all, thanks for making your dashboard public. I am currently building a small Intranet Application for my department and want to include some charts. Adding the panels and groups worked fine but I cant get the colors on the Pie Chart Panel to work. All I get is a Pie with grey segments 😞 This is my code, maybe I am overlooking something... $group->add([ 'panel' => 'chart', 'size' => 'normal', 'title' => 'Kostenvergleich', 'style' => ['centerTitle' => true], 'data' => [ 'chart' => [ 'type' => 'pie', 'data' => [ 'datasets' => [ ['data' => [floor($normalTotal),floor($recurringTotal)]], ['backgroundColor' => ['rgba(193, 66, 66, 1)','rgba(193, 66, 66, 1)']], ], 'labels' => ['Einmalig','Laufend'] ], 'options' => [ 'responsive' => true ] ] ] ]);
  19. Yeah, this did the trick... Thank you 🙂 My solution for what I needed this for: public function templateSave($event){ $templateId = $event->arguments(0)->id; $templates = $this->wire('templates'); $template = $templates->get($templateId); $fieldgroup = $this->wire->fieldgroups->get($template->name); $data['name'] = $template->name; foreach($fieldgroup as $k => $v){ $field = $this->wire('fields')->get($k); $data['fields'][] = ['name' => $field->name, 'id' => $k]; } $data = json_encode($data, JSON_PRETTY_PRINT); $file = $this->wire('config')->paths->root.'models/'. $template->name .'.json'; file_put_contents($file, $data); } which would generate something like { "name": "BaseController", "fields": [ { "name": "title", "id": 1 }, { "name": "ControllerEnvironment", "id": 219 }, { "name": "active", "id": 132 }, { "name": "accesspermissions", "id": 197 }, { "name": "accesspermission", "id": 196 }, { "name": "appcompanyname", "id": 125 }, { "name": "appuserreference", "id": 177 }, { "name": "appuserroles", "id": 186 } ] }
  20. Hi there, im a bit lost right now. I added an hook after templates::save which should get the affected template and write its template ID into a JSON. The problem is, the event->object gives me an instance of the templates class. How can I narrow this down to the saved Template and get its ID and fieldgroup?
  21. You could try something quick and dirty in your template file. Before any output check if the $user is logged in on every request and redirect him to the same page if not. This should trigger your login I guess <?php if(!$user->isLoggedin()){ $session->redirect($page->url) } ?>
  22. Thomas, I recently found your module, good job. Right now im thinkering with Electron and making Processwire to serve as a headless CMS. So your module is quite handy. I forked the module on GitHub and made it a little bit more connected to Processwire. To sum things up, I creates a "Endpoint Container" in the page tree where you can add your routes and methods. It still needs to add responding classes to provide content ;) I added a skeleton Class called "Blog" to get all contents under the "Home" Page or a specific Page via ID. I created a Pull Request, maybe you like my approach. https://github.com/Luis85/RestApi
×
×
  • Create New...