Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/23/2019 in all areas

  1. Hi all, I'd like to give some feedback about the solution I ended up with. To bundle a few extra fields together with each image, instead of using a repeater I used the module ImagesExtra by @justb3a: https://github.com/justb3a/processwire-imageextra I created an ImageExtra field named imagex and added the following fields: startrow, startcol, widthcols, zindex They refer to a grid of rows and columns, each 2rem high and 2rem wide. startrow and startcol are the topmost row and the leftmost column covered by the image; widthcols is the width of the image, given as count of columns. zindex is the value of the usual z-index attribute to control which image is on top of the stack (in case of overlapping images). The picture below shows an image in the grid with the values startrow=2, startcol=4, widthcols=6 and zindex=1. The CSS grid is defined as follows: .wrapper { display: grid; grid-template-rows: repeat(60, [row] 2rem); grid-template-columns: repeat(40, [col] 2rem); grid-gap: 0; width: 80%; margin: 0 auto; padding: 0; } .wrapper div { width: 2rem; height: 2rem; } The CSS definitions for the images are embedded in the HTML code using a style element, allowing the use of php variables. (Note that the value of widthcols is used to calculate the width of the image in the unit rem, stored in the variable $wrem. The height is calculated automatically, keeping the aspect ratio.) The images together with the extra field values are stored in the field $imagex, and in the foreach loop for each of them the class definition is built: <section class="wrapper"> <?php if ($imagex) { $i = 0; foreach ($imagex as $pic){ $i++; $sr = $pic->startrow; $sc = $pic->startcol; $w = $pic->widthcols; $wrem = 2*$w . 'rem'; $zi = $pic->zindex; echo " <style> .no$i { grid-row: row $sr; grid-column: col $sc; } .no$i > img { width: $wrem; z-index: $zi; } </style> "; echo "\n<div class=no$i>\n"; echo "<img src=$pic->url alt='$pic->description' />"; echo "\n</div>\n"; } }; ?> </section> Works like a charm. Thanks again for all your hints and proposals!
    2 points
  2. Not why it wouldn't work for you - it works for me. Tracy Debugger is a useful tool that can help you debug. Now that I see you are deleting the page being saved you don't need to worry about making the fields not required - you can delete the page and redirect all within the before ProcessPageEdit::processInput hook. When you redirect you interrupt anything else that would normally happen such as evaluating the input for empty required fields and saving the page so these things will not happen. $wire->addHookBefore('ProcessPageEdit::processInput', function(HookEvent $event) { /* @var InputfieldWrapper $form */ $form = $event->arguments(0); // Only for the ProcessPageEdit form if($form->name !== 'ProcessPageEdit') return; $page = $event->object->getPage(); // Use $page to check for specific templates here... // Check field values in POST $input = $event->wire('input'); if($input->post->delete && $input->post->delete_confirm === 'DELETE') { $event->wire('pages')->delete($page); // Delete user also if needed $event->message('Your message here'); $event->wire('session')->redirect($event->wire('config')->urls->admin); } });
    2 points
  3. You have to hook before the input is processed and make those fields not required. Example: $wire->addHookBefore('ProcessPageEdit::processInput', function(HookEvent $event) { /* @var InputfieldWrapper $form */ $form = $event->arguments(0); // Only for the ProcessPageEdit form if($form->name !== 'ProcessPageEdit') return; $page = $event->object->getPage(); // Use $page to check for specific templates here... // Check field values in POST $input = $event->wire('input'); if($input->post->delete && $input->post->delete_confirm === 'DELETE') { // Get normally required fields and make them not required $first_name = $form->getChildByName('first_name'); $first_name->required = false; // Repeat for other required fields... // Do your delete/notification/redirect actions here // Or if you need the page to actually save when deleting then do actions in separate Pages::saved hook or similar } });
    2 points
  4. In the last few weeks... or almost months... I worked on a project for a restaurant. Sad to say that the company behind the restaurant went out of business before the project could be finished - or was paid or the website ever saw the light of day. As there is kind of a lot of work in it... but yet a lot of customization... I decided to create a site profile of it and make it public as ProcessWire Barebone Site Profile. Right now I'm stripping out every client detail and finish some functions and details that were planned a few weeks back so you can build right on top of it, if you like or want. Maybe it's only a playground for someone or an inspiration for how to f**k up data-mangement... but hey... better than a ZIP file on a backup drive. ? As the project was and is super tailor-made to that client, it may not work for a lot of restaurants out there, but nonetheless I don't want miss the opportunity to offer a foundation for upcoming restaurant projects you may face. The project had a huge focus on dishes, beer and wine variations so those templates are kind of feature-rich. You might want to rip out some of it as most restaurants don't focus that much on those details. Important details I want to be honest and clear about: this profile does NOT include a highly polished and usable frontend as the design is paid and therefore can't be made public the frontend will be a collection of re-usable snippets to show every possible detail of each page, item and whatever the whole site profile will be without any support - future updates aren't planned right now the site profile will be released in single-language setup only (english) existing translations (as seen in parts of the screenshots) will be changed to english existing data, for example dishes, will be replaced with demo content if you, one of your clients or anyone else wants to use this profile - feel free to do so Pro Modules were already stripped out of it only public modules were used and are included with the profile itself the full module list will soon be published on Github the full README will soon be published on Github the full LICENSE will soon be published on Github So... yes... that's just a short preview of an upcoming site profile. As mentioned before, the site profile will most likely never ever receive any future updates, so it will be available on Github only. It's not planned to publish this as a full featured site profile, yet. More details, screenshots and the site profile itself (of course) will be available soon. Questions? Please feel free to ask. Github Repository: https://github.com/webmanufaktur/pwbrestaurant
    2 points
  5. Modules Manager 2 provides an easy to use interface to download, update, install, uninstall and configure modules. It is meant to provide an optimized alternative to the core ProcessModule dashboard. Maybe @ryan agrees to merge it to the core at some point when it is finished and polished. Features: Seamlessly download, update, install, uninstall or delete modules Live-Search (aka find as you type) for module names Live-Search (aka find as you type) for categories Browse new and unkown modules from the modules directory on modules.processwire.com Choose your favorite layout (cards, reduced cards, table) Modern UIKit design (therefore only works with AdminThemeUikit) Caches the module list from modules.processwire.com directory locally. What is Modules Manager 2? Why a new module manager? Some people including myself think that the actual module installation in ProcessWire could be improved in some places. Make it easy for ProcessWire beginners and power users Offer better discoverbility to find the right module Make it easier and faster for powerusers to manage modules A manager that list all official modules is a feature, that many other frameworks/CMS's like ModX, WordPress or PrestaShop have by default. What are the disadvantages of the actual core module interface? Installation of a module is not very user-friendly: You have to be aware where to get new modules, search for a module, copy or remember the module name or URL, go back to your ProcessWire installation, paste the module name(URL, click on "get module info" and finally install the module It only displays installed modules, not the ones that are available in the modules directory Uninstalling a module requires you to go to the module detail page, click a checkbox and then submit the change. After that you have to go back to the module overview page. It only displays installed modules, not the ones that are available in the modules directory, so it makes discovering modules hard BETA software Use this module at your own risk. I am not responsible for any damage or unexpected behaviour. Some things might not work fully, please see the TODO list for details. I need your feedback and help This module is still in development and I am happy to discuss with you and get some feedback. What do you like? What is missing? What could make the process even easier? Ask, suggest or provide pull requests. You can download the module at https://modules.processwire.com/modules/modules-manager2/ or from Github: https://github.com/jmartsch/processwire-modules-manager2
    1 point
  6. I doubt Tracy is the problem, but to disable Tracy you can rename it to .TracyDebugger. Just FTP into the server and rename the folder in site>modules>.TracyDebugger Hope that helps
    1 point
  7. Couple of other questions though: 1. If I have multiple cropping options (normal, higher, lower height), how can I easily control which crop setting should be used? Since it does all crops when uploading the image, I can't simply check if a crop version exists. Also what if I want to use the original image instead of crop versions, how can I select that? 2. Translation file lacks a few fields from the modal: "ESC" and cropped image parameters (imgUrl, suffix, width x height, quality, sharpening). Also cropped image modal title "Save" can't be translated. Otherwise great module! ?
    1 point
  8. Yes, issue is gone now ?
    1 point
  9. Please point me to some examples, thanks. Hi Kongondo... So I'm not sure if this is what B3ta is referring to - one solid piece that has gone through a bit of a wringer in terms of testing and configuration/transformation over the years is CS-Cart, which was originally in itself an offshoot of X-Cart. I believe both carts now have multishop setups. I am more familiar with the CS-Cart edition. Its a bit tricky, because on some level the owner needs to be able to decide if they want to have one unified database in the backend for various shops (the 'food court') model where you have multiple shops for different types of food but they all share one big common kitchen in the back and also share the credit card processing. Or the subcontract model where each store on the back end has its own unique instance in place with a universal dashboard that allows an admin to oversee everything. My advice, do not touch it with a 10-foot pole. As much as I love the idea, in practice the coding and debugging required has been a real nightmare/evolution for other products. How deep will admin go? Will customers be shared? Will customers use different logins for each storefront? Do cart contents carry over from one store to another? Do all storefronts have the same shipping and tax rules? Is there a shared pool of inventory that only the admin sees and that sub-storefront admins can pull from? Are products added by sub-storefront owners shareable? There are just a ton of variables laid on top of the shopping cart platform which already has a tendency to become super bloaty and confusing. CS-Cart made some serious errors during the evolution of their product, it has taken many years for them to iron own the kinks and hurt feelings that multi-vendor has created. I'd love to see a step up from padloper in terms of interface-in-place. Looking forward to the alphabetagamma.
    1 point
  10. @Robin S - thank you very match!!! The solution as I wanted!
    1 point
  11. Hi,sorry if the topic is covered elsewhere.Background : I'm a part-time, for hobby (ie. not-for-a-living) processwire developer,so I'm probably not very representative of the community, Question : I'm wondering what is the "governance" status of processwire, these days ?With this question, I mean that let's say we segment processwire as follows :1- pw core / roadmap / Ryan new features2- pw core / roadmap / community features requests3- pw core / issues fixes4- pw websites / main site5- pw websites / forum6- pw plugins ecosystem / Ryan commercial extensions7- pw plugins ecosystem / community free + community commercial8- pw weekly...My understanding of the current governance status is :1- : This is Ryan's soverain decisions (for very good reasons ? , with addition of some core members work (on some pull-requests).3, 4- : This is also Ryan driven ; with several core community members doing the diagnosis & triage of issuesAll the above activities (1, 3, 4), along with activity 2-, basically, are funded by the community purchasing Ryan commercial extensions (6).5-, 8- : These are mostly run by several core community volunteer members.Now I'm wondering about 2- :What is the governance system for defining pw roadmap ? for "injecting" the community feature requests into pw roadmap ?Is there some kind of "board" of core members + Ryan, for deciding on the prioritization of these things ? or something like that ?Is there some kind of baseline defined for the breakdown of work on core activities 1- vs 2- vs 3- ?As a not-for-a-living user, I don't have any special nor legitimate expectations about pw roadmap decision-taking (besides having a better understanding of what becomes a feature request which one deposits on github ?But I guess the expectations must be different for other people, who are financially involved in pw ecosystem.And as a side note, I'm also wondering about 7- , as my feeling is that a frontend merging of 6- (which would remain prime) and 7- would, I think, be key for a broader pw outreach beyond the current adopters, for the benefit of the whole community ; something similar to eg. https://www.opencart.com/index.php?route=marketplace/extension thanks for your insights
    1 point
  12. Your problems are gone! :) https://modules.processwire.com/modules/connect-page-fields/
    1 point
  13. Go to /processwire/module/edit?name=TracyDebugger edit Tracy's settings: Check this option That way only Superusers can see Tracy on the live site. Hope that helps
    1 point
  14. I'm not familiar with Django but for what I've seen, most PW users try to "translate" any other app models into page templates, and make a migration using either queries to the original database or leveraging any sort of API (REST/XML?), and creating the pages using the PW API.
    1 point
  15. Hallo everyone ? I have just release AdminThemeBoss 0.6.0: Introducing, a refined, more colorfull and streamlined expirience: Added: more colors ? Added: improved notifications ? Added: improved dropdows ⬇️ Added: improved integration with third party modules like ProDrafts, AOS and ASM… ? Under the hood improvements on how settings are saved and applied Fixed: Some minor bugs ??
    1 point
  16. No mockery from this group. We're here to help. If you have a statement comparing two conditions (eg. variable to1037, and variable to 1038) then there are four possible combinations: FF FT TF TT. Basically, for every n elements there are 2^n possible outcomes. Example 1. If you want to perform a conjunction (AND) then the statement is true only when both components are true, as follows: Assume $page->id = 100 IF ($page->id !== 1037) AND ($page->id !== 1038) THEN TRUE Example 2. If you want to perform a disjunction (OR) then the statement is true when either component is true, as follows: Assume $page->id = 100 IF ($page->id !== 1037) OR ($page->id !== 1038) THEN TRUE The problem you are experiencing is wanting to use the disjunctive case, as in Example 2. Because when the $page->id does not equal one of the test values (1037 or 1038) the result will also be true, which is not the desired outcome. Hope this helps.
    1 point
×
×
  • Create New...