Jump to content

bernhard

Members
  • Posts

    5,759
  • Joined

  • Last visited

  • Days Won

    273

Everything posted by bernhard

  1. Thx @ukyo, it is, as I thought, a windows problem. I've tried the "next" branch - no change. It works on my linux server. Would be great to get a fix for this. As you can see in my screenshot the strange thing is that the FilenameArray is populated on line ~118 but it is empty on line ~174 (where the select field on the input tab of the pw field should get populated).
  2. Hi, I want to wrap the first line of every H2 and H3 in a <span></span> tag so that I can do further CSS styling on that element. The problem is that the markup comes from a CKEditor field, so it can have different versions: <h2>This is a headline</h2> <h2><span>This</span> is a headline</h2> // result <h2 foo="bar">This is a headline</h2> <h2 foo="bar"><span>This</span> is a headline</h2> // result <h2 foo="bar"><strong>This is a headline</strong></h2> <h2 foo="bar"><strong><span>This</span> is a headline</strong></h2> // result Any tips for me? Domdocument? Any 3rd-party dom parser? Or Regex? Thx for your help! ?
  3. Hi @ukyo, I've just tried your module for the first time, but unfortunately it does not find any resources! This is the tracy dump: Somehow the resources array is empty: I have the following files in my setup: C:\laragon\www\kaum\site\modules\Mystique\configs\Mystique.example-dive.php C:\laragon\www\kaum\site\templates\configs\Mystique.mystique.php No matter what I try - the resources select is empty: I've even tried to do a $config->paths->normalizeSeparators() on the path without success (thought it might be a windows issue). Thx for your help!
  4. That was related to all previous posts, not only psy's - even though I think "stupid" might be an unappropriate wording here ? But I didn't want to blame her for that either ?
  5. I don't think it's fair to blame him for his opinion. I think there are some valid points in it. He clearly has a non-tech marketing background and I can imagine that some kind of problems get a huge challenge with ProcessWire that are simply some clicks on other platforms. We know the pro's and con's, but if you don't have the technical background I can really understand that you get frustrated with ProcessWire. Not everybody has the time or will to learn things "from scratch". The headline states that he assumes PW is great for developers, pretty bad for everyone else. While I don't agree 100% on that, the point that PW aims on developers is true. I'd maybe add that it is also great for clients. But that's not always the case, to be honest: I think we all have had situations where we've stored data (settings, lists of countries and so on) somewhere in the page tree, because that's the way to do it in PW... But that's not the way someone coming from other platforms would assume it to be. I guess they'd be looking for it somewhere in the menu, in some listings or whatsoever... I've also needed @gebeer convincing me that it is a great platform. But I enjoy all the technical challenges, so that'll most likely be a totally different experience than someone who he calls "business users" might have ?
  6. How does that work with Tracy? ?
  7. I haven't used it, but it looks great! Thx for sharing!
  8. https://processwire.com/api/ref/page/get-unformatted/ $timestamp = $page->getUnformatted('event_start');
  9. Disregard that. I thought Joomla had a standard way of defining module positions. But that seems to be different for every template. The backend would nevertheless have to know which positions are available to choose from for the frontend ?
  10. I built it 2017, so that's totally possible that I had some Joomla UI in my head ? I get your point, but I guess that would get very complicated... We'd need a complete UI for widget management. At the moment those widgets in my setup are pages and I only need one inputfield to handle visibility. Imagine the other direction: We are on the frontpage and want to let the user choose the widgets there... Which widgets do exist? If the user sets the widget visible, what about child pages (eg on blog overview page, what about the detail pages?). How to add a new widget to the page? Hmm... Maybe a quite simple field would be enough: Widgets visible on this page: W1, W2, W3 Other available widgets: W4, W5, W6 The widgets could be links that open the widget edit screen in a panel. Simple enough. But thinking about that, the next step would be some way of defining WHERE the widget should live on that page. Including some way to define the position/sort order... That's quite how modules in Joomla worked (at least until 2014). I think, a Widget Management Module would make the most sense... But then we would need some kind of frontend companion. I guess that's not how PW works?! Or at least it does not shine in that regard as much as it does elsewhere...
  11. That's a good input, thx. That would mean we'd need some kind of "not visible on that page, but on at least one descendant"...
  12. Hi, there has been some discussion about widget systems using ProcessWire: https://www.google.com/search?q=site:processwire.com+widget+system When working with widgets, you'll need to define somewhere WHERE the widget is visible and where it is not. The first thought might be: Let's use a Page Reference field for that! But there is a problem: What, if you want to show the widget on all "blog" pages? That's not possible with that Inputfield. OK, second thought might be that we can do that using the Selector Inputfield: The problem: This would mean "template=blogitem|clubs|event, parent=/presse" which only shows 2 blogitems that live under /presse, which is not what I want, because I'd need an OR condition for all rows... Besides I think this Inputfield is too complicated for non-tech users. What I've done in 2017 is this: (https://processwire.com/talk/topic/8635-simple-example-for-widget-management/?do=findComment&comment=148216) This post got 3 likes - I'd like to get your feedback on that approach, because I might need something similar on a current project and I'm not sure if that 3 likes mean "useless" or "overengineering" or similar... I'm thinking if that's maybe also too much for a regular webmaster and I should just create a simple text Inputfield to write a custom selector into (done by superuser)?! How are you solving this? What do you think of the ui shown in the screencast? Is that inutitive? Worth putting it into a module?
  13. I just voted YES because of the backend part ? Thx in advance!
  14. Thx for the link @dragan. I don't know if there are any options that one could set for the export. Maybe there is a way to make it work properly with native export as well...
  15. Not sure if the native backup tools are really the best option... When restoring native backups on sites with a lot of data it took ages while it only took several seconds when using a regular mysql dump. I think the native tools add quite some bloat. It has been discussed somewhere, but I have no links at the moment, sorry. You might have this in mind ?
  16. Hi @gebeer, I think it would be better to name the title of the fieldtype "Image Reference" instead of "Image Reference Fieldtype": https://github.com/gebeer/FieldtypeImageReference/blob/2df486396ae58a5ff1687d30434cbfce6f913602/FieldtypeImageReference.module#L32 I guess this was due to a wrong field setup, but I also got these errors: Regarding your AJAX: I found it easier and safer to handle my ajax calls via hooking into ProcessPageView::pageNotFound: https://github.com/BernhardBaumrock/RockTabulator/blob/6670f2647fcbbb1f5ad4c5237ea9fd03b8899315/RockTabulator.module.php#L73 https://github.com/BernhardBaumrock/RockTabulator/blob/6670f2647fcbbb1f5ad4c5237ea9fd03b8899315/RockTabulator.module.php#L159-L188 I've taken a similar approch to yours on RockGrid and had some problems with it, because of scripts not being available when the field is collapsed and loaded via ajax or the like...
  17. It would be great to get a more detailed description of your problem and what you have so far and what you want to do and what and why the current solution is a problem. You can of course hook processInput and you can set any values there as you like. But it's hard to give an advice when you don't have the bigger picture ?
  18. That sounds awesome! Thx for your great work ?
  19. I think I don't understand what you are trying to do. Why do you need a readonly select? What is the difference to a locked field that just shows the value?
  20. Thx @adrian true. That would be a good option. Though not ideal imho. But the best option we have so far. Thx
  21. Can't you just set the inputfield collapsed to collapsedNoLocked ? https://processwire.com/api/ref/inputfield/#pwapi-methods-collapsed-constants
  22. @ryan SettingsFactory would be another example of how useful a file upload inputfield that is not connected to a pw page could be :
  23. Hi @Macrura, just tried your module and have some suggestions: This is the screen after installation: What do you think of adding this section in the instructions field? https://github.com/outflux3/SettingsFactory#instructions (or at least the link) You could even add a direct link to create a new page under ADMIN (.../page/add/?parent_id=2) or under SETUP (.../page/add/?parent_id=22). Maybe you also want to add this screenshot for anybody wanting to get a quick impression of how this module looks in action (using the kitchen-sink example file): Looks like I should start using your modules for my projects! ? Thx! How do you handle file uploads? Eg site logo, favicon, image placeholder, invoice template etc? Maybe we get a possibility soon: https://processwire.com/talk/topic/22815-new-post-weekly-update-for-27-dec-2019/?do=findComment&comment=195465
  24. I think the best would be to create a custom process module. You can assign a permission to that module so that only some of your users can view this pages in the backend. This page could be a 100% custom UI with a list of all pending users and a button for each of them that adds the role to that user when clicked. class Process extends Process { public static function getModuleInfo() { return [ 'title' => '', 'version' => '0.0.1', 'summary' => '', 'icon' => '', 'requires' => [], 'installs' => [], // name of permission required of users to execute this Process (optional) 'permission' => 'foo', // permissions that you want automatically installed/uninstalled with this module (name => description) 'permissions' => ['foo' => 'May run the foo module'], // page that you want created to execute this module 'page' => [ 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World' ], // optional extra navigation that appears in admin // if you change this, you'll need to a Modules > Refresh to see changes 'nav' => [ [ 'url' => '', 'label' => 'Hello', 'icon' => 'smile-o', ],[ 'url' => 'something/', 'label' => 'Something', 'icon' => 'beer', ], ] ]; } public function init() { parent::init(); // always remember to call the parent init } /** * */ public function execute() { $this->headline('Manage users'); $this->browserTitle('Manage users'); /** @var InputfieldForm $form */ $form = $this->modules->get('InputfieldForm'); $form->add([ 'type' => 'markup', 'label' => 'foo', 'value' => $this->usersTable(), ]); return $form->render(); } /** * Render users table */ public function usersTable() { $users = $this->pages->find('...'); $out = '<table>'; foreach($users as $user) { $button = "<a href='./activateUser/?id=" . $user->id . "'>activate</a>"; $out .= "<tr><td>{$user->name}</td><td>$button</td></tr>"; } $out .= "</table>"; return $out; } /** * Activate user and redirect to overview */ public function executeActivateUser() { // get user $user = $this->pages->get($this->input->get('id', 'int')); // !!!! caution !!!! // check if user is really a user and if the current user is really allowed // to modify this user! if(!$access) throw new WireException("no access"); // otherwise add role to user $user->of(false); $user->addRole(...); $user->save(); // redirect to overview $this->session->redirect("./"); } }
×
×
  • Create New...