Jump to content

dragan

Members
  • Content Count

    1,734
  • Joined

  • Last visited

  • Days Won

    20

dragan last won the day on December 31 2019

dragan had the most liked content!

Community Reputation

1,541 Excellent

4 Followers

About dragan

  • Rank
    Hero Member
  • Birthday 10/18/1969

Contact Methods

  • Website URL
    http://www.fantastique.ch/

Profile Information

  • Gender
    Male
  • Location
    Switzerland

Recent Profile Visitors

6,814 profile views
  1. I would take a look how other module developers handled this. A good example is Tracy Debugger (or probably any other module that has lots of files/sub-directories), e.g. if($this->wire('input')->post->uninstallModule) { $dependents = $this->wire('modules')->getRequiresForUninstall($class); and then the relevant code in wire/code/Modules.php getRequiresForUninstall + public function ___delete($class)
  2. Ah, centered! LOL, I knew I was missing something... I'd say, stick with your solution. With frontend only, you'd have to use JS as well. For at least big screens this might work though (updated): https://codepen.io/dragan1700/pen/bGNZBEK?editors=1100
  3. Actually, the .gitignore in PW root is a nice starting point already. Some of the things I would probably add: *.notes *.sql *.zip site/assets/cache/* site/assets/ProCache* site/assets/pwpc/ site/assets/sessions/ wire/ .sql + .zip are most likely local backups, so I def. don't want them included site/assets/... stuff depends - cache (regular + ProCache) stuff + sessions I'd also not want to carry over. wire/ should certainly not be part of a repo. btw: .notes is just how I store login details; Apache blocks web-access to any files starting with a dot anyway, but you don't want to take chances, so I added this to .gitignore too.
  4. Not sure, but I guess this applies to fieldsets as well: https://processwire.com/api/ref/inputfield/#pwapi-methods-collapsed-constants $field->collapsed = Inputfield::collapsedYes;
  5. @Haagje R. I assume you have FTP-access? The error screenshot you posted says that your PW installation still has the install.php in root. That should have been removed right after the initial installation (removing that file - and others - is actually part of PW's installation routine). If that install.php still exists on the server, simply delete it, and try again. PS Checking https://www.neuro-insight.de/install.php throws an error about your 404 page not being viewable by guests (guest user = not logged in). So there might be more strange things to check...
  6. here's a quick try: https://codepen.io/dragan1700/pen/bGNZBEK?editors=1100 Whatever you do: don't ever try to do stuff like "underline only the last line of a text block": it's a major cause of migraine. Without using JS this can't be done (yet) only with CSS alone. (Well - not unless you do PDFs, of course, or don't have to make stuff responsive...). A client recently came up with BS like that (which was designed by another agency), and we had a hard time explaining why this was not a good idea.
  7. quick, dirty & ready 🙂 $this->addHookAfter('Page::render', function ($event) { if ($this->page->template != 'admin') { // just an example I use in almost every PW site: add responsive wrappers around iFrames: if (strpos($event->return, 'videoWrapper') === false) { $event->return = str_replace("<iframe", "\n<div class='videoWrapper'><iframe", $event->return); $event->return = str_replace("</iframe>", "</iframe></div>", $event->return); } // another example I use in almost every PW site: add responsive wrappers around tables: if (strpos($event->return, 'scrollTable') === false) { $event->return = str_replace("<table", "\n<div class='scrollTable'><table", $event->return); $event->return = str_replace("</table>", "</table></div>", $event->return); } $cleaned = preg_replace('~(<h[23]\\b.*?>(?:<[a-z][^>]*>)*)(\w+)~ism', '$1<span>$2</span>', $event->return); // BitPoet's regex magic $event->return = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '\1', $cleaned); // remove default paragraphs around images in CKE } });
  8. Did you inspect the toolbar with the browser? You should at least narrow down the issue that way, i.e. if it's a CSS or JS issue. Or maybe you get 404 errors on the icons that are not displayed.
  9. @Macrura I'll try and give some more information. Version: it seems SF installs actually two modules. One is v. 1.0.4, the other 1.0.3. Since I just installed it 1-2 days ago, it's unlikely I accidentally picked an old version. I'm using the JSON kitchen sink version. I de-installed SF y'day and installed again today. The same issues persist. I attached a few screenshots. before installing: after installation: after installation, under modules (notice versions 1.0.3 + 1.0.4) Trying to update process SF: editing the page under /admin: the page I entered for the JSON is 100% correct: Thanks a lot for looking into it.
  10. I can't answer all of your questions right now, but you should never edit any file in the wire-folder. It will be overwritten the next time you upgrade PW. With admin themes, you can simply copy the entire admin-theme folder from wire/modules/AdminTheme/AdminThemeDefault to site/modules/AdminTheme/AdminThemeDefault. PW will notice there are two versions of the same module and ask you which one it should use. Just select the site/... version and then you can work with the copy. (I think that applies to any kind of module - not just admin themes) re: your first use-case / question There's an old module out there which does something similar: Pick an image from the page and display it in the page-tree. iirc it's a module (or hook?) by @Soma; search the forums - you'll find it eventually.
  11. @Macrura First of all: Thanks for this great module. I noticed it already when you first released it, but because there was no real for it in my own projects, I never installed it till now. I found a confusing behavior (bug?) when I use the kitchen sink example. No matter what email address I try, PW always shows me an error: "InputfieldEmail: Please enter a valid e-mail address - Email Test" It doesn't matter if I use a real, existing email, or just a semantically correct one. What's even more strange is that this red error shows up on every page in the PW admin - literally everywhere. Am I missing something obvious? PW throwing an error if a required field is empty or doesn't match some regex rules is one thing, but that should only be visible in the respective page-edit screen, not globally? The only thing I noticed: There is no "autoload disabled" checkbox in module/edit?name=ProcessSettingsFactory I'm using SF 1.0.3 and ProcessWire: 3.0.149 PHP: 7.3.13 Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1d MySQL: 5.7.24
  12. You could try https://modules.processwire.com/modules/settings-factory/ Probably overkill if you only really need one single field, but really useful if the number of such global fields increase over time...
  13. Well, maybe "breakpoint" is not the right word, i.e. the code won't stop to process like in JS dev tools. But you can dump all kinds of stuff with d($doc) inside the template. Then you'll quickly see e.g. if a var doesn't contain what you thought it should etc. (null, 0 results, nullpage etc.). I'm sure you used it a million ways... What's perhaps a bit misleading in Tracy, is that addBreakpoint() is meant to only be used with the performance panel. So yeah, not exactly the same as adding JS breakpoints in frontend-land 🙂
  14. I have of course read that thread, but that approach has a few limitations. If you set up categories and sub-categories the way you did, it works without a doubt. However, if you want to stick to the DRY principle (don't repeat yourself), and choose a maincat<-->subcat relationship that I have chosen, this won't work. In a real-life scenario you'll likely have several sub-categories that are eligible for more than just one main category. Suppose you (or your client) re-names a certain sub-category, you'll have to update all instances of that one single sub-category for each main-category as well. With a small setup this might not be an issue at all. But as the site (and products...) grows, this can turn into a chore to maintain. I'd rather have a separate, independent set of sub-cats to choose from. IRL many of those sub-cats are overlapping ("backups" or "upgrade" surely isn't only available on Win or Mac). From a UX/GUI perspective, when you need multiple subcats to attach to a maincat, your options are rather poor. Select Multiple, even in 2020, looks and feels... like 1999 (without the party aspect). So if you decide to use checkboxes in the admin, this approach won't work.
  15. Is your file-field configured to have just one file, or multiple? If multiple, you'd have to do $filefield->first()->url Since you get 403 (forbidden) errors, it's maybe more likely those file-fields are somehow access-protected. Check your access setting of that field and/or template. Do you get these errors also as a logged-in superuser or just as guest? Do yourself a favor and install Tracy Debugger (if you haven't already). You can then insert breakpoints in your code (similar to console.log() with Javascript), and you'll see more infos and hints about the error(s).
×
×
  • Create New...