Jump to content

dragan

Members
  • Posts

    1,974
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. @gebeer I've installed your module today for the first time. I was mostly interested in the feature "select from folder". But sadly, that just didn't work. I cleared site/cache several times, refreshed modules etc., but the field always would state that no such folder exists. I have added that folder after creating the field. Does that matter? Does the folder have to be there before you create an image reference field? Nothing suspicious in the logs, btw (debug mode on). ProcessWire: 3.0.149 PHP: 7.3.13 Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1d MySQL: 5.7.24
  2. A word of advice: Forget everything you learned about Wordpress. PW's technical concept and philosophy has little to do with how WP handles things. Make yourself familiar with the PW API, selectors, what a PW page is (or can be), and how pages, templates and fields work together. If you've got the basics down, I suggest you take a look at page reference fields, and how they can be used: for creating/defining cross-references, categories + relations - of any kind: not just in a classic sense of "frontent page A relates to page B". It's a very powerful concept.
  3. Nice! That's indeed much more user-friendly. Thanks for sharing.
  4. @Roych No offence, but I guess you should develop some basic PHP know-how... There are (roughly speaking) three major template output strategies with PW Direct output is what you seem to use, i.e. constantly echo()-ing everything to the browser. In that case, you would declare a variable before that language image count code block, and then use <a href="<?=$album->url; ?>"><div class="imgcount"><?=$myVariable;?></div></a> $var = ''; // init $var .= "foo"; // add stuff to that variable Since I'm using the delayed output approach in my test PW installation, my var is called $content, that's why I used it here for these quick code examples. You can of course name it whatever you want. Hope that makes sense.
  5. @adrian Both email fields are set. That's what I would suggest too. It's just a bit irritating, that's all. Thanks!
  6. Thanks! I feel bad for asking about another issue though... Since approx. 1-2 weeks I see frequent warnings like these popping up: Frequently = several times during a backend session. When I check the "clear email sent" checkbox and hit save, I get this error message: The checkbox stays un-checked after save. Latest PW dev + last 2 or 3 TD versions.
  7. There's a blog site profile you can choose when installing PW with a full example blog (comments, comments-admin, tagging etc.) I don't understand this sentence. What do you mean with "ongoing"? Do you mean "single page application"-style? Why should a blog post and a portfolio detail page have the sample template? It's certainly doable.
  8. Why did you insert so many echo()s? Remove it from echo $imgCount = $album->images->count(); and all echo() statements inside the switch statement. First we have to define a variable, before we output it 🙂 Also, I wouldn't do a another switch for non-Slovenian language. Do something like this in the else: // not slovenian: if($imgCount === 1) { $content .= "<p>$imgCount " . __('image') . "</p>"; // Image single form } else { $content .= "<p>$imgCount " . __('images') . "</p>"; // Image plural form } That way, you can handle string translation in the PW backend, as @MoritzLost suggested: setup > languages > language > select template > submit If you look at the search template in the regular site profile, you'll also see similar examples:
  9. I found a CSS bug with Firefox: The directory list panel in the file editor is not usable, i.e. you can't focus / click on any file or directory links. The three buttons at the bottom also don't work (test, save, restore backup). I can use the scrollbar, but only with dragging (mouse-scrollwheel doesn't work). The code-block works. If I remove position: absolute from .tracy-filterbox-wrap everything works fine, but it breaks in Chrome. I finally found that removing height: auto !important; from #tracyFileEditorFilterBoxWrap makes it work in both browsers. (You already set a fixed height for .tracy-filterbox-wrap, but of course an ID CSS selector + !important are much stronger than a class)
  10. $imgCount = $album->images->count(); $imgStr = ''; if ($imgCount) { if ($user->language->name === 'slo') { switch ($imgCount) { case 1: $imgStr = "slika"; break; case 2: $imgStr = "sliki"; break; case 3: case 4: $imgStr = "slike"; break; case 5: default: $imgStr = "slik"; break; } $content .= "<p>$imgCount $imgStr</p>"; } else { // not slovenian: $content .= "<p>$imgCount " . __('images') . "</p>"; } }
  11. @Roych Does this only apply to the first 5 numbers, or do the slovenian language rules go beyond that? If the former, you could simply create a switch/case with the image-count, and then output either slika, sliki, slike, slik in the output. Perhaps you'll need to create a translateable string variable __('foo') for this, so that you have an equivalent ENG as well (not sure which is your primary site-language).
  12. ... and everything went silky-smooth. I finally got around to update a small portfolio site from PW 2.3 straight to latest dev. I spent roughly one hour, tested everything, and hey: no major hassles. I updated the few modules I used (and installed some new ones like Tracy or AoS), updated PHP as well, and that was more or less it. Imagine having such an un-touched WP, Typo3 or MODX site, and updating straight to the latest version... What a nightmare. That is - if they would actually still run that long 🙂 I actually expected it to go as smooth as it did, but I'm always surprised and in awe again when I do such a big update. Thank you ProcessWire.
  13. I just got a weird error with this module and I'm a bit stumped... After entering a list, the following error occurs, and no pages are being created: CKE source code view: ProcessWire: 3.0.149 PHP: 7.3.13 Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1d MySQL: 5.7.24 I've been using this lovely module on-and-off for a while now, but never saw such an error msg before...
  14. You can use the API: $tpl = $templates->get('service'); $tpl->tags = "foo bar something else"; $tpl->save(); or for multiple templates, just create an array with tpl-names, and do a foreach()
  15. The DB itself won't suffer, but PW performance eventually will. Too many templates and fields won't scale endlessly.
  16. Yeah well, I just did a quick test-run with embed method A. I'm not sure if this is supported at all with other embed types. Did you check the browser console for errors? btw: I guess you should have posted this question in the dedicated FB forum, rather than on the official board... FB is a commercial PW module after all. Other users in the future, who search for similar topics/keywords, and narrow down their search to the FB forum only will most probably miss this thread. Your chances that @ryan will jump in with suggestions and answers is also much higher there than on the "open" forum threads.
  17. Just go to FB module settings (not form-settings) and add it as an allowed input type: module/edit?name=FormBuilder&collapse_info=1
  18. This works just fine: $input->cookie->set("foo", "bar"); // set the cookie d($input->cookie->foo); // get it you're printing out $c, which is the set command.
  19. @Arcturus Nice. Thanks for sharing. I guess it would be nice to have this as a textformatter too.
  20. Easiest thing to do is to add some custom CSS to admin.css, e.g. body[class*="editor"] #notices { display: none; } that would hide all notifications for role "editor". Or some variation thereof, e.g. body[class*="editor"] #notices .NoticeDebug { display: none !important; } body[class*="editor"] #notices .NoticeMessage { display: none !important; } The cleanest way would be if this core module would have an in-built permission, then you could handle it normally via the PW access system.
  21. Did you try to install the same mySQL version elsewhere (e.g. locally) and see how it goes? You could at least narrow down the issue (mySQL, or some DO-specific settings). Did you try access the DB directly?
  22. You can try to fine-tune the DB https://dev.mysql.com/doc/refman/5.7/en/fulltext-stopwords.html And for advanced stuff, you can play around with fulltext searches (raw mySQL queries).
  23. 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)
  24. 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
  25. 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.
×
×
  • Create New...