Jump to content

fbg13

Members
  • Posts

    344
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fbg13

  1. You don't need an extension, just add vscode://file/%file:%line to tracy. https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls
  2. If I understand correctly you require the interface in the main module, but not in the sub module were you implement it. Maybe you need to require it in the sub module.
  3. @SamC your $imgOptions is null since it's not in the function's scope. The code works because $options is ignored if null. https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/core/Pageimage.php#L377 You can check function test() { return $imgOptions; } var_dump(test()); just replace $imgOptions with wire("config")->custImages in your function
  4. You can add your own properties to $config $config->customProperty = "whatever"; $config->prefixName = [1, 2, 3];
  5. Have you tried $config->urls->httpAdmin ?
  6. The get method generates the cache if no cache is found, if you pass it a function/closure. And with a hook (on page save or wherever it makes sense for your use case) you can generate/update the cache.
  7. You can pass a function to $cache->get and it will generate the cache for you $expiration = 3600; $cache->get("cache_name", $expiration, function() use($page) { $markup = "<div>$page->title</div>"; return $markup; }); https://processwire.com/api/ref/cache/get/ https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/core/WireCache.php#L136 Edit: Read again and I think that is not what you want. To prevent the cache being generated by a visitor you can generate it in a hook, depending on when you want the cache to update.
  8. I think just $form->login_submit = "???"; should do it. $wire->addHookAfter('LoginRegister::buildLoginForm', function($event) { $form = $event->return; $form->description = false; $form->login_submit->value = "???"; $event->return = $form; });
  9. You can use $start = microtime(true); // code to test echo microtime(true) - $start; // or log the time $log->error("code xyz took: " . microtime(true) - $start); to find which part takes the most time to execute. http://php.net/microtime
  10. You can put it wherever you want. Depends on how you want to use it. You can put in a template file and it will run when a page using that template is accessed, you can wrap it in a get variable and it will run only when that variable is set. You can make a module and add a page in the admin and add a button that deletes the users. This are just basic examples you can do a lot more than this.
  11. $users = $pages->find("template=user, role=spammer, field=value ..."); foreach($users as $u) { // don't use $user $u->delete(); } https://processwire.com/api/ref/page/delete/
  12. If it was a shared host then that is normal, if it was a vps then it's another story. Maybe the files weren't downloaded as much on the WP site.
  13. @The Frayed Ends of Sanity $pages->addHookAfter('LoginRegister::buildRegisterForm', null, 'changeHeader'); function changeHeader(HookEvent $e) { $form = $e->return; // setting $form->description to false, null or "" (empty string) removes it from the form; $form->description = "Header text"; $e->return = $form; } in ready.php https://processwire.com/api/hooks/
  14. You need to know php to use processwire. Read this post and the replies to it. And maybe this too
  15. The page tree in the sidebar can be a little inconvenient at times, when the sidebar is small and the action buttons span on multiple rows or on mobile devices. I made them open in a drop-down on click. Here's a codepen.
  16. @Peter Knight You have to compile the less files. I'm using Koala to compile them. Only the pw.less (uikit/custom/pw.less) file needs to be compiled as it includes all other necessary files. I add my styling in pw.less (below @import "pw/_import.less"), but you can do it in a separate file and include it in pw.less, or use the files in uikit/src/less/theme if you want to keep it organized. That's my understanding of it, haven't used less/sass much before.
  17. @Peter Knight you can take the theme module (wire/modules/AdminTheme/AdminThemeDefault) put it in site/modules and modify it to your needs.
  18. Lets discuss the new admin theme, there has been very little talk about it, a few questions about its status and some simple designs by a few users. Have you played with it? Do you like it? Do you dislike it? Of course I'm not talking about its design, but the way its structured, how it works and the features it offers so far. ------------------------------ I'm working on a purple color scheme for it and it turned out quite well (imo), but one thing I dislike is the use of iframes. I haven't used iframes before so it might be just me, but I'm struggling with them when it comes to javascript. When iframes are used all scripts are loaded in every frame, which can lead to unexpected results. Javascript is an easy way to add, remove, move etc. elements in the admin, but the iframes complicate things. What are your thoughts? Is it just me? Here's a screenshot of the purple theme:
  19. echo (count($page->comments) > 1) ? 'persons' : 'person';
  20. I think it's because of this https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/core/WireInput.php#L628
  21. Am I the only one who likes the default admin theme?
  22. Do you have any images related modules or custom code? What PW version are you on?
×
×
  • Create New...