Jump to content

apeisa

Moderators
  • Posts

    4,631
  • Joined

  • Last visited

  • Days Won

    53

Posts posted by apeisa

  1. Ok, it was "fairly" simple. I didn't find a way to use WireUpload to handle unzipping, so had to do it manually. But this seems to work:

    <?php
    
    namespace ProcessWire;
    
    $upgrade = function (RockMigrations $rm) {
    	
    	// Install lang support module
    	modules('LanguageSupport');
    	
    	// get default language
    	$default = languages()->get('default');
    	
    	// Download lang pack from github to cache folder, unzip and loop and add .json files to language_files field for the language
    	$http = new WireHttp();
    	$zipUrl = "https://github.com/apeisa/Finnish-ProcessWire/archive/master.zip";
    	$zipLocal = config()->paths->cache . "language.zip";
    	$http->download($zipUrl, $zipLocal);
    	$items = files()->unzip($zipLocal, config()->paths->cache);
    	if(count($items)) {
    		foreach($items as $item) {
    			if (strpos($item, ".json") === false) continue; // Yeah, there could be more proper check here...
    			$default->language_files->add(config()->paths->cache . $item);
    		}
    	}
    
    	// finally save the language
    	$default->save();
    	
        // UI update needs still logout/login or modules => refresh
    	modules()->refresh();
    };

    Not sure what part of that could be part of RM and how? Also - in this level uninstall of LanguageSupport works nicely - I think it might be a lot more complex when multilang fields are involved.

    • Like 2
  2. Thanks @bernhard

    Yep, I guessed this might be tricky one... Things I would like to to do via API is

    a) install basic language support (this is probably easy one)
    b) add new languages (this probably too, since language is a page)
    c) upload json files to a new language (maybe this also, since json files are just files inside the language)

    If/when I get this working, I will definitely add support to RockMigrations for this.

  3. Thanks @d'Hinnisdaël

    Gotta say I really like this module, solid work & documentation.

    One suggestion - not sure I understand the reason for current Collection pagination? It only shows the count of results, instead of showing actual pager. Changing this to actual pager is trivial, but probably something you would like to offer as an option?

    $pagination = sprintf(
      $this->_('Showing %d of %d'),
      $this->collection->count,
      $this->collection->getTotal()
    );
    $footer .= "<div>{$pagination}</div>";

    so instead of that just use:

    $footer .= "<div>{$this->collection->renderPager()}</div>";

    And we have default PW pager working as expected. Of course this is not fully functional (and probably reason why left out from initial version?) is that it doesn't work with current table sorts which are only client sorts.

    Another route for case where you really need paging would be using pagelist, but there I think pager limit should be a setting too.

  4. Hi everyone!

    This is Antti from Avoine. Our website business is growing and we are looking for some extra talent to help us. We are looking for web developer(s) with great visual skills who can design and develop websites that look great and work fast on desktop and mobile. We are looking for a long-term partnership, not a single project gig. Agencies and freelancers can both apply.

    All the projects will come to our hosting and maintenance, so we expect you to build websites in a same way that we build all our sites. We will of course teach and help to get in track with this.

    Our current process includes:

    • source code hosted at github.com
    • gulp based workflow
    • composer based processwire installation
    • default site profile that all our projects use
    • tailwind css
    • wireframe used for output strategy

    We hope that you are familiar with tools like git and composer. Not too much, so don't be afraid about these.

    Please contact me with email to antti.peisa@avoine.fi and please include:

    • Links to at least 2 reference projects online (both design and front end development needs done by you or your company)
    • Some kind of estimate about how many hours reference project development took
    • Your hour price in euros or usd 

    Looking forward for your application. This is great opportunity to work with legendary creatures like @teppo  @Fokke and unfortunately me too.

    • Like 13
  5. On 9/15/2019 at 12:07 PM, Mike Rockett said:

    These columns are sorted in 1.5.56. However, instead of text, I've gone with varchar(512), which should be more than long enough. ?

    Thanks for this Mike. 

    Not sure if 512 is long enough. There isn't any limitations for user agent length (other than server limit for headers) and if request_uri means uri that user were redirected - then few pointers for uri lengths:

    Quote

    The HTTP protocol does not place any a priori limit on the length of a URI

    and 

    Quote

    Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browsers. 

    https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

    So if you want to limit these at the database level, then you should clip values also to that length.

  6. Thanks Mike!

    unfortunately we jut found another issue like this:

    Data too long for column 'request_uri' at row 1

    So there is similar issue at least with request_uri also (not sure about other fields). Any possibility to get this fixed as well?

  7. Hi @Mike Rockett

    We are using this module on few client sites and it works great. There is one issue though: varchar 255 is too small for referrer field, we do get occasional: 

    SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'referrer' at row 1 (in /site/assets/cache/FileCompiler/site/modules/ProcessJumplinks/ProcessJumplinks.module.php line 532

    Any hope to get this fixed? (we will most probably update local databases to text).

  8. Yes, that works great too in that case and others similar cases if there is possibility to tweak markup. 

    I also found that purge failed on rather complex navbar css so I found it easiest to skip purge on my own css. Not a problem since with tailwind I write very little css anyways. 

    • Like 1
  9. Two sites I have build with tailwind and purge css. Other site css file was 3.4kb and other 2.5kb... I also skip purge from my own css, just tailwind goes through it. 

    It is actually very simple. It does "scan" all the files you need. But in case of ProcessWire custom classes can come from many places, so I felt it easiest to purge only tailwind css. And I am pretty happy with the file size results... 

    • Like 1
  10. 12 hours ago, d'Hinnisdaël said:

    Doesn't LazyCron hook into ProcessPageView::finished to avoid this exact problem? What I've done in the past to avoid long-running requests is to merely use LazyCron to trigger the time-intensive action via curl or wget, making it asynchronous.

    To my best knowledge it is still same request and visitor has to wait before actual content is ready to be served. Lazycron is (in my opinion) usable for very quick cleanup type of things only. Much better to use actual cron or other background process to do that kind of stuff.

    SnipWire looks fantastic! Great that PW will have multiple e-commerce options available!

    • Like 1
  11. Do others get messages, that setting focus point doesn't work - and it is just a browser caching the older image? This seems to be a real issue for us with certain clients.

    Do you have any tips for this? I am thinking about small module, that would change filename (add suffix or something like that) everytime when focus or zoom is changed.

  12. Very beautiful site! I love the vibrant colors.

    15 hours ago, Sergio said:

    main design is made using Tailwind CSS as I can build an interface much quicker using it. I became a huge fan of it.

    Same here! It really speed up development time without limiting your possibilities and creativity. I especially like building responsive stuff with tailwind, makes it much more simple.

  13. I use sass with tailwind. Also in my opinion purgecss is must have with tailwind to remove all unnecessary css. 

    This is a good read, it nails just how I have felt about BEM and many other ways to css: https://adamwathan.me/css-utility-classes-and-separation-of-concerns/

    I do like vanilla css, but writing scalable, easy to maintain css is very difficult. Tailwind helps me a lot regarding that and doesn't take away css/sass/less when I want it. 

    My first reaction to utility frameworks was that those are worst idea ever. Glad I gave em chance! 

    • Like 3
  14. Yes, you can have generic btn class and then just tweak it with bg-red and rounded classes for example. 

    But biggest win with tailwind for me is that it is actually design system (scales for colors, margins, heights etc) instead of full design that you tweak/modify (foundation, bootstrap etc) or 100% custom styling, where it is very difficult to be consistent with the all decisions and endless possibilities. 

    First of the sites was designed already (photoshop) and other was me designing with tailwind. I was surprised how well it suited both of those use cases. 

    • Like 1
×
×
  • Create New...