Jump to content

dragan

Members
  • Posts

    1,973
  • Joined

  • Last visited

  • Days Won

    21

Posts 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. 6 hours ago, shogun said:

    similar to a Wordpress site

    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.

    • Like 1
  3. @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,

    On 1/31/2020 at 7:14 PM, Roych said:

    <a href="<?=$album->url; ?>"><div class="imgcount"><?=$album->images->count();?> IMAGES???</div></a>

    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.

  4. @adrian Both email fields are set.

    50 minutes ago, adrian said:

    Maybe I shouldn't show the warning if these aren't filled out because it isn't really relevant if you're not getting emails I suppose.

    That's what I would suggest too. It's just a bit irritating, that's all.

    20 minutes ago, adrian said:

    new version won't enable email notification

    Thanks!

  5. Thanks!

    I feel bad for asking about another issue though... Since approx. 1-2 weeks I see frequent warnings like these popping up:

    1996707894_Screenshot_2020-02-01PagesProcessWirefantastiquech.png.28d720ef7b33127159324586a6f2d86c.png

    Frequently = several times during a backend session.

    When I check the "clear email sent" checkbox and hit save, I get this error message:

    1929031178_Screenshot_2020-02-01ModuleTracyDebuggerfantastiquech.png.83a14b85b36eb1d80f8de03cd245a12f.png

    The checkbox stays un-checked after save.

    Latest PW dev + last 2 or 3 TD versions.

  6. There's a blog site profile you can choose when installing PW with a full example blog (comments, comments-admin, tagging etc.)

    17 minutes ago, shogun said:

    but how can you make it so the user can add ongoing blog posts and or portfolio items that has the same template?

    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.

  7. 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

    1783213553_Screenshot_2020-02-01LanguageTranslatorProcessWirepwbigtest.thumb.png.b1746057bc5d5b36b66b7e1051168dd2.png

    If you look at the search template in the regular site profile, you'll also see similar examples:

    112638343_Screenshot_2020-02-01LanguageTranslatorProcessWirepwbigtest(1).png.b7b558128e2bd47e047181ea5595e977.png

     

  8. 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)

     

    • Like 1
  9. $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>";
        }
    }

     

  10. @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).

  11. ... 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.

    • Like 20
  12. 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:

    admin-actions-lists-to-pages.thumb.PNG.e6cb967ce58485c3b73541bf4decfe49.PNG

     

    CKE source code view:

    admin-actions-lists-to-pages-2.PNG.91ee099a787eed50dc240cffb661dbef.PNG

    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...

  13. 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.

  14. 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.

    • Like 1
  15. 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)

  16. 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.

    • Like 2
×
×
  • Create New...