Jump to content

gornycreative

Members
  • Posts

    352
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by gornycreative

  1. On 8/5/2022 at 6:44 AM, bernhard said:

    What do you guys think of the forwarded sections with 200/300% speed? Is that a good solution?

    In terms of cleanup? Cleaner to leave it on the floor. I think the random commentary bubbles and stock are funny though. It's hard to spice up dry material like coding, but I felt like these video have a good pace - I've watched them all through.

    • Like 1
    • Thanks 1
  2. This is great stuff - I love seeing how other folks work their process and it always gives me new approaches to try. I hadn't messed with latte at all before these videos (always got stuck using smarty and twig) but the simpler syntax looks awesome. Thanks for the work you've put into these modules and the videos!

    • Like 1
    • Thanks 1
  3. Just so I understand the use of this - are you creating this within your personal business website and redirecting clients to your site to view and pay their invoices, or are you including this in installs in order to be able to have invoices appear on the backend of client sites?

    I agree the ability to add a captioned math field that could include either a number or a formula would be helpful. Being able to order those fields and just have the calculations run in order would probably do it (some places allow you to tax freight costs as part of the invoice).

    Thanks,

    J

  4. On 7/22/2022 at 2:55 PM, ryan said:

    Sites were developed in a way that would make you cringe now.

    I just remember endless toil trying to get standard appearances across browsers - still an issue, but nothing like the nightmare of trying to get Opera, Netscape, IE and Safari to be friends. And so much flash animation. So much.

    And then XHTML was going to be a thing, and UML was going to make everything play nice.

    And then those fun proprietary tools like coldfusion - I thought CFML was pretty cool. And the not fun tools. Pretty much every yahoo store RTML project was a shotgun to the face.

    Things have gotten so much more enjoyable, thanks to preprocessors and more uniform standards, etc. Really amazing how for we've come.

    I built my own CMS in ASP, then realized being part of a CMS community was important - Textpattern did everything I wanted out of my own system. Then clients asked for WordPress. Now its just got to be interoperable, fast, flexible and Processwire serves that purpose very well. At the same time, there's so much that can be done without developers now - it's really been interesting.

    • Like 2
  5. I've seen this on a few other threads but their problems were more specific to certain plugins.

    I'm trying to wrap my head around what might be triggering this, and if other developers have run into it and have any workarounds.

    I have tried isolating different actions but have not been successful in figuring out the culprit.

    It usually happens when I have an admin windows open, the front-end open with developer tools and I am switching between responsive views - e.g. between desktop and Pixel 5.

    I'm editing template files, not PW page content.

    The site runs through cloudflare and rules are in place to sidestep cache on admin URLs. However for the front end I find I sometimes still need to purge cache on their side even with development mode engaged, and I also have to often clear cache on the processwire side as well.

    I don't believe my IP address is changing, however I do notice that in the session log a number of public IPs are used for my logged in sessions - whether this is a function of cloudflare caching, etc. I haven't tested. Could be. But there are times when the fingerprint breaks and the IP is the same for several hours.

    Not sure if clearing the cache on the PW side also clears out the session - I'm using the session db so it shouldn't but...

    Any thoughts on which of these actions might be breaking the session fingerprint? I can put up with logging in again after doing cache clears, etc. but I'd like to know what is causing the behavior for my own sanity.

  6. This all looks very promising, I can see areas where additional common tweaks or added tools would be helpful. Integration for USPS/UPS/DHL realtime rate quotes is an obvious one. Will you be setting up a roadmap/wishlist hub someplace like uservoice or something along those lines? This project is going to have a lot more of those than any other plugin you've done I think...

    • Like 1
  7. @adrian you answered @ErikMH tab question...

    I was asking about the auto_desc being blank for partial word matches on the terms - but I can also see how this might get sticky unless you limited the generation to a single/first appearance. There could be dozens of places where a term partially matches on a page.

  8. I have what might seem like a strange request, but is it possible to pick the delimiter for the name generation for templates?

    I typically use a dash delimiter for template and the underscore for fields, so I end up having to rename templates every time I generate them with the module.

    I don't know if there is a best practice for these conventions - I just have always understood that underscores in URLs were to be avoid in favor of dashes and so I use dashes in my template names and underscores in my field names to keep them sraight.

    Just an option to be able to separately pick or enter alternative delimiters for the template and field name generation would be nice.

  9. One thing I found with the Markdown textformatter updates is that it appears to be more strict in dealing with newlines. For some time you could simply put in a newline and the textformatter would interpret that as a line break but now you do have to strictly follow the two spaces return rule for Markdown to generate the <br>. I had a number of textarea markdown output areas where linebreaks disappeared because I didn't add the spaces.

  10. So I'm trying to wrap my head around what each() can do and when I need to use a regular foreach() structure.

    I have the following code:

    $pages->find('template=social-media-platform, !social_media_share_url=""')->each(function($zxc,$val){
        $smi = ($val->social_media_alt_icon<>'') ? $val->social_media_alt_icon : $val->social_media_icon;
        $ary[$zxc] = array(
            "social_media_share_url" => $val->social_media_share_url,
            "social_media_share_parameters" => $val->social_media_share_parameters,
            "social_media_icon" => $smi
            );
        return $ary[$zxc];
        })

    What I am trying to do is generate an array that is a subset of the values normally passed through the system, and trying to coalesce two value so that if the default value is empty and an alternative is not, the alternative is plugged into the same default value key.

    Regardless of whether I return $ary or $ary[$zxc] what I get back is a PageArray with page fields I have referred to in the loop included, but the substitution isn't made.

    I will do this with a regular foreach() but I guess I am trying to understand what the purposes/limitation of the keyed function argument are if you always get a PageArray as the result. What I'm trying to get is something simpler. Or I can actually use the PageArray object and just do the coalesce logic at output.

  11. This has been great. I just wanted to confirm one thing I noticed which is that _auto_desc doesn't seem to highlight/load a summary on partial word matches, although the search itself picks them up.

    So for example if I search for 'business' using a partial match operator, any article search_index that includes the whole word 'business' will create a summary with the word 'business' marked... and results will show up where businesses and businessmen are in the index, but no summary with a highlighted partial word appears. The summary for these entries is blank.

    Is this the intended behavior?

     

  12. It looks like this may be connected to a glitch in calculations for timestamps that account for daylight savings time.

    It looks like if you are in a timezone with daylight savings the UTC timestamp is advanced 60 minutes before it gets saved in the field. I have created an issue for it in github.

    Just explain further for the curious, I have a template with the following code:

    <p>Now: <?=( time() )?> Edited: <?=( $page->modified )?></p>

    And when I edit the page and save it, the output I get is this:

    Screenshot_1.jpg.a6da05e0703ffdb3440d3c6175bcfc4f.jpg

    CST (Central Standard Time) is -0600, but CDT (which we're currently in) is -0500 and if I expand the formatting to include the timezone name it is CDT - so the timezone is correct, it's just the extra calculation of the timestamp that is unnecessary - the field should preserve the timestamp as-is and let the session timezone dictate the offset.

    The time in the example should be 12:16:14 PM.

  13. I'm not sure I'm being clear. I can get my rules to compile and apply, but because they are loaded earlier in the css stack, stylesheets from modules are getting loaded later and in many cases where I want to override in the admin.less the rule gets struck out because another rule defined later in the loading order overrides it.

    So I can have rules like this in admin.less:

    //Awesomeplete for autocomplete modules
    
    .awesomplete > ul {
    	background: hsla(0,0%,5%,.9);
    	background: linear-gradient(to bottom right, @global-background, hsla(0,0%,5%,.8));
    	border: 1px solid rgba(255,255,255,.3);
    	box-shadow: .05em .2em .6em rgba(0,0,0,.2);
    }
    
    .awesomplete > ul:before {
      background: @global-background;
    }

    And the rules and color overrides appear in the CSS but they are struck out because the autocomplete module awesomplete has its own rules that get loaded later by the module.

    To make the rules work the quick and dirty way I have to use:

    //Awesomeplete for autocomplete modules
    
    .awesomplete > ul {
    	background: hsla(0,0%,5%,.9) !important;
    	background: linear-gradient(to bottom right, @global-background, hsla(0,0%,5%,.8)) !important;
    	border: 1px solid rgba(255,255,255,.3) !important;
    	box-shadow: .05em .2em .6em rgba(0,0,0,.2);
    }
    
    .awesomplete > ul:before {
      background: @global-background !important;
    }

    Here's the loading order:

    1688658738_cssloadingorder.jpg.5d6904877e897eb192bc21fd3cd383d0.jpg

    So for example, because aos.min.css is loaded after Admin.css and AdminTheme.css, any rules I put in place to correct the default colors set in place by the module loading its own css are superseded unless I use !important or more properly use a rule with greater specificity than the original rule in aos.min.css - I'm guessing the css order is in place to allow module builders to have more control over the display for their module components.

     

  14. Is there a way to push admin.less rules to the end of the loading stack? I've run into a couple of situations building out a dark theme where I've had to use !important rules to override because it seems like the admin uikit css get loaded at the base and then additional admin module css get loaded on top of that.

    This applies both to admin styled areas in both core modules and 3rd party modules. For example, there are rules in the image editor pop-up that appears when you hover over a thumbnail that are already flagged important and can't be stated with more precision to force an override.

  15. On 7/10/2021 at 8:08 AM, MarkE said:

    I have a web app with over 50 templates and over 150 fields (holiday cottage booking system). I don’t find that a problem, although there are not many users. I use page classes extensively with the templates as I find that is the best way of handling the business logic. Process modules for most of the admin user views. This is mostly a back-end admin system. The front-end public website is a separate PW instance with its own (smaller number) of templates and fields, interfacing the admin system via an availability calendar. There may have been better ways of doing it, as I am still learning about PW, but I find this a manageable approach. 

    That's an interesting way of doing it. Have you used the FieldtypeSelectExtOption module at all? Seems like it would be useful in that scenario.

    Only other thing I considered, as I thought about the original question, I find that when I want to to pass information to an include, I usually end up setting up a function to handle it. The _uikit.php file in the coffee site template made a lot more sense to me. I started out writing more includes but then realized setting up functions that I could pass arrays to made more sense and was a bit easier to work with once the functions themselves were done.

  16. My stuff is typically not that dynamic on the front side of things but I believe there are a number of users who have put together some pretty sophisticated partial loading methods with vue.js and other things that would probably cut back on the overhead if you are seriously concerned. I would think that the apps bringing in data to your dashboard probably have more overhead than pw, but I haven't built anything huge with it yet.

    Just digging around my links, it is old but you might consider looking at this for some ideas:

    https://github.com/microcipcip/processvue

     

  17. I typically start with the raw HTML output design and as I work I notice elements that I use often and break those into partials. In my _main I typically have the spacing and grid scaffolding for most items with the understanding I may embed nested structure as part of my individual page template, and then I will load includes into those embedded areas as needed.

    I see _main as the foundation and outer walls of the house. I see the page templates with their regions as different layouts of walls/rooms within that house. I see the furniture and features of the rooms of the house as partial includes.

    Whether you choose for the rooms themselves to be adaptable or not is really up to you. It isn't necessary to use partials at all, but I find it cuts down a little bit on the template counts.

    A common tradeoff seems to be between the amount of code you put into your template file region replacements/append/prepend etc vs the number of different templates you have, and whether you want the presentation routing to be directed more by the selection of the templates or programmatic responses to data in the fields your templates use.

    It is possible to have very few template files that reroute and alter the display based on tons of selections made on the pages themselves, or it is possible to have individual templates for all of the different scenarios you may want to come up with - but for complicated sites I tend to prefer fewer templates, more function controls.

    I would say that for the end user having lots of templates and transparent choices/structure on the pw backend is safer with clients. Because you can control a lot of things about adding new content, etc. it is less likely that the user may alter some value and cause some other glitches on the site that you don't expect unless you are pretty strict with your unit testing.

    But if you have code content that is really never anything the client is going to have to be actively involved in, bringing stuff like that into the code side keeps down the clutter.

    Hanna code sits somewhere in the middle and I always feel like it is playing with fire but that's a pretty happy bridge between the two worlds if you want to try to give placement control to the client but want to maintain logic control.

     

    • Like 3
  18. @adrian Thanks, it does. I wasn't sure if I'd need to dig into hooks on this or not.

    @teppo Just to confirm, looking at Renderer it also seems like there isn't a method off the bat to get the paginationString from the query... just count and total.

    Looks like I'd need to hook into renderResultsListSummary with a pagination check for that? I think I could get it from the magic get method?

×
×
  • Create New...