Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Some more info: Apparently the strange behavior only happens when a user is logged in...
  3. The first workflow is the more traditional way for me, I ensure the website is built first, then change them from HTML to Twig, since I am more of a fan of Twig than the default Processwire Engine.
  4. Maybe this? https://processwire.com/blog/posts/pw-3.0.145/ See the Inputfield Javascript API
  5. Is this a bug in Processwire or some PHP behavior? In _init.php there are two variables ($LANG and $sortNames): $LANG = $user->language->title; // in uppercase NL or FR $sortNames = array( 'NL' => array( 'apartment'=>'Appartement/Studio', 'house'=>'Huis/Villa', 'terrain'=>'Grond', 'parking'=>'Garage/Parkeerplaats', 'other'=>'Andere', 'commerce'=>'Commercieel' ), 'FR' => array( 'apartment'=>'Appartement/Studio', 'house'=>'Maison/Villa', 'terrain'=>'Terrain', 'parking'=>'Garage/Place', 'other'=>'Autre', 'commerce'=>'Commerce' ) ); If I use the variables in several templates, the the $LANG variable stays uppercase: echo $LANG; // gives the desired NL or FR foreach($sortNames[$LANG] as $k => $v){ echo $k.' '.$v.'<br>'; // gives the desired output from $sortNames } But if I do the same on the home template, then the $sortNames gives no output: echo $LANG; // gives the desired NL or FR foreach($sortNames[$LANG] as $k => $v){ echo $k.' '.$v.'<br>'; // stays empty !!! } The solution is simple but highly unusual, but in _init.php I done the following to correct the strange behavior: $LANG = strtoupper($user->language->title); Anyone has a clue why this is happening on home?
  6. Thanks! Hugely usefull! Think my main issue is the grid editing element so I might implement most of the site and leave the editable image/link section till last and maybe look at building something. I would like it to mirror the frontend as much as possible, so i could just use css grid and do some limited js stuff pushing the page id's, item number and span columns and rows into the database..... mmmmmmmmmmmmm
  7. Hi @gebeer, nice module, thx for sharing! Just tested it and everything worked flawlessly. 2 suggestions for improvements: When no image is selected the gallery could be opened by default (I guess that is what one would like to do in that case: Choose an image) Maybe there could be a link to the page that holds the images so if one wanted to upload a new image they could just click the link, upload the image and save the page. If your inputfield updated its content after that process it would even be better, but not necessary in the first step, I think.
  8. There is an old video around that shows how it could be done. It's the older version of ProcessWire in that video but it would work the same nowadays - just looks a bit different now. In terms of best workflow... it really depends on various factors as @bernhard already mentioned. I wrote about my personal workflow in or with ProcessWire here and here.
  9. Hi shogun, welcome to ProcessWire πŸ˜‰ imho that's totally up to you... It depend's solely on your preferences, other workflows, integrations, team members... I guess 1) would be easier in the beginning and 2) might make more sense after a while when you are more familiar with how pw works (and how you work with it). You can do a lot more than just inject some API magic into template files. For example you can do field rendering (https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/#field-rendering-with-template-files) or use Markup Regions (https://processwire.com/docs/front-end/output/markup-regions/) that open up a lot of possibilities but also make things more complicated in the beginning (if you are new to them).
  10. That should be enough. You just need to make sure that the server setup works, so I'd install a fresh copy of PW manually to see if that works. Then you create the db user on the new server, restore the db, copy your files and you should be up and running. I'm not saying anything against the other 2 recommendations. Just answering your question πŸ˜‰
  11. What @gebeer said. It could even be as simple as that in /site/ready.php if($page->template == "admin") { if(!$user->hasRole('your-role')) $session->redirect($pages->get(1)->url); }
  12. Great you found the reason. Maybe you can just do a die() or $this->halt() after $pdf->show() ?
  13. @bernhard I tried setting the header type in the console before the code however this didn't work. However for my template file which outputs the PDF I tried disabling auto prepend and append of my _init.php and _main.php file and this resolved the matter. So it would appear that somewhere in the setup the content type is being set even after I've set it in the template file or Tracy Debugger. For reference - https://mpdf.github.io/troubleshooting/strange-character-output-in-browser.html
  14. I merged your question to the correct thread earlier, so yes – this is it πŸ™‚
  15. Yeah, that's something I'm not sure about yet. I thought of maybe adding a minimum PW version and a maxium PW version that makes sure that the fix is only loaded on versions between that numbers. AOS is great, but it has lots of enhancements and it does not make it easy for anybody to contribute. PwQuickFixes should really only contain fixes of "real" issues that are reported in the pw issues repo (see the updated readme). And it should be really easy to add your own fix file, add the link to the issue report and optionally add pw minimum and maximum versions and tick a checkbox...
  16. @bernhard It's so bizarre. I get the following through Tracy Debugger console.
  17. But with this approach you have to install/copy the module files. And when the fix is fixed in the core, then what? Perhaps the mandatory field for the fix (along with the title and description) should be the PW version number and fix applied only on lower versions? Also, we have AOS that provides some fixes/enchantments and Admin Actions. Where do you position PwQuickFixes?
  18. Hi guys, thx alot for the discussion πŸ™‚ Good point. I think that should not be a problem. If there is an issue with the core, it should be easier to check a simple fix than to fix the issue yourself. If it was a complicated fix, this module might not be the right place for it. I've added @adrian as collaborator on the Repo - the goal is that this project is a "real" little community project πŸ™‚ --- Thx adrian, I've updated the description of the module: --- Actually I think it IS a module for the average user. See https://github.com/processwire/processwire-issues/issues/812 for example. This is a CSS issue that any webdeveloper can easily fix by some CSS rules. The only problem is: How to get the code properly into processwire. There are several possibilities: Overwrite the core css file (easy, but no option, of course) Create a PR (you don't know when it get's merged and you need a workaround until then) Use a module like Admin Custom Files (this works for CSS and JS, but this will not work if you need hooks for your fix) Add your fix via hooks in ready.php (you end up with a mess of hooks in ready.php and you need to copy over code snippets from project to project) Create a module for it (that might be too much effort for most users for simple fixes) The module makes it really easy to apply any kind of quickfix. And it makes it really easy to merge those fixes via PR's (for the ones maintaining this module). --- True! Nothing to add πŸ™‚ --- It's not intended for hacks, it's intended to fix issues that one would report in the PW issues repository until the issue get's fixed there properly. Hope that makes sense πŸ™‚ Thx, that's a good idea, thx πŸ™‚ --- Nice idea. I'm not sure how helpful automatic statistics would be though. I've got bad feedback on my modules implementing google analytics download tracking and numbers where small overall anyhow, so I'm really not sure how much help a "this fix was used 5 times since 08/2019" would be πŸ˜‰ What do you think of a obligatory property for every fix that links to the related PW issue report. This would make sure that the issue is reported in the issues repo, seen by Ryan and users can vote for the issue there (give a thumbs up). That would also have the benefit that users can raise their voice there, comment things, add screenshots etc.; A lot better than some strange number where nobody knows what it shows exactly... --- Could you please try to do that on your own? I've added you as collaborator πŸ™‚ --- Thx again for all your contributions! Have a great week.
  19. Hi @alexmercenary, I can't reproduce what you are describing:
  20. You can mimic a basic authentication in the file "site/templates/admin.php" Therefor you have to handle a set of valid usernames and passwords in that file too, like in the following example: <?php namespace ProcessWire; $validUsers = [ 'user1' => 'pass1', 'user2' => 'pass2', 'user3' => 'pass3' ]; $validAdminUser = false; if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { if(isset($validUsers[$_SERVER['PHP_AUTH_USER']])) { if($validUsers[$_SERVER['PHP_AUTH_USER']] == $_SERVER['PHP_AUTH_PW']) { $validAdminUser = true; } } } if(!$validAdminUser) { header('WWW-Authenticate: Basic realm="Adminsection"'); header('HTTP/1.0 401 Unauthorized'); echo '401 Unauthorized! Accessing this page needs a valid useraccount!'; exit(); } require($config->paths->adminTemplates . 'controller.php');
  21. Hello, thanks a lot for your messages and applications. We are happy to have found someone who will support us. Regards Annemie
  22. Here is my final init.php code for bilingual password forgot. if (wire('session')->language) { wire('languages')->setLanguage(wire('session')->language); } $wire->addHookBefore('ProcessLogin::execute', function($event) { if (wire('input')->lang == 'fr') { wire('languages')->setLanguage(7085); wire('session')->language = 7085 } });
  23. Will do that. Also think it is better. Only have to find a way how to open the respective repeater field on that page and ideally scroll to it. There should be a built in way to do this. I remember having read sth about it but can't recall where it was.
  24. @teppo Thanks! I only cant find that thread. Via the module page, this board is linked. Could you let me know where to find the correct board? I did some investigation and found out that the AdminUIkit uses a different way (or at least code) to populate the breadcrumb. For that reason the standard way to remove them doesn't work. To be able to manipulate the output, I used a hook. $this->addHookAfter('AdminThemeUikit::renderBreadcrumbs', function(HookEvent $event) { // Get the object the event occurred on, if needed $AdminThemeUikit = $event->object; // Populate back return value, if you have modified it $event->return = $return; });
  25. @kongondo, have U any good news for us? Just say you're ok ;)
  1. Load more activity
Γ—
Γ—
  • Create New...