Jump to content

gornycreative

Members
  • Posts

    385
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by gornycreative

  1. I think the main change that would help is the autoload function - this hardcode in module.php: /** * Autoload scripts and styles */ public function autoload($page) { $styles = $this->styles(); $scripts = $this->scripts(); if ($page->template != 'admin') { // frontend if ($styles->opt('autoload')) { $styles->addAll('/site/templates/layouts'); $styles->addAll('/site/templates/sections'); $styles->addAll('/site/templates/partials'); $styles->addAll('/site/assets/RockMatrix'); $styles->addAll('/site/assets/RockPageBuilder'); // add the webfonts.css file if it exists $styles->add('/site/templates/fonts/webfonts.css'); } } } Maybe concat $this->wire->config->paths->root? Sorry I don't have this pulled down in git. Looks like a Latte cache check is also hardcoded to /site/ in __render(): // if render() was called from within a latte file we return a HTML object // so that we dont need to use the |noescape filter if ( // this works for $rockfrontend->render() strpos(Debug::backtrace()[0]['file'], "/site/assets/cache/Latte/") === 0 // this works for $rockfrontend->renderIf() or strpos(Debug::backtrace()[1]['file'], "/site/assets/cache/Latte/") === 0 ) { return $this->html($html); } In createCssSuggestion(): // see https://css-tricks.com/snippets/css/using-font-face-in-css/#practical-level-of-browser-support foreach ($files->find("format=woff|woff2") as $file) { $comment = self::webfont_comments[$file->format]; // comment needs to be first! // last comma will be trimmed and css render() will add ; at the end! $src .= "\n $comment\n url('/site/templates/fonts/{$file->name}') format('{$file->format}'),"; } //... and later // see https://css-tricks.com/snippets/css/using-font-face-in-css/#practical-level-of-browser-support $eot = $files->get("format=eot"); if ($eot) { $src .= "url('/site/templates/fonts/{$eot->name}'); /* IE9 Compat Modes */\n "; $src .= "src: url('/site/templates/fonts/{$eot->name}?#iefix') format('embedded-opentype'), /* IE6-IE8 */\n "; } foreach ($files->find("format!=eot") as $file) { $format = $file->format; if ($format == 'ttf') $format = 'truetype'; $comment = self::webfont_comments[$file->format]; // comment needs to be first! // last comma will be trimmed and css render() will add ; at the end! $src .= "\n $comment\n url('/site/templates/fonts/{$file->name}') format('{$file->format}'),"; } $src = trim($src, ",\n "); I think the rest is just cosmetic hardcode /site/ in notes provided to the admin UI for the settings page. I realize for the typical site user these issues should never arise as the module is currently written. I'm sortof in the middle of cleaning up my dev setup here, but I'll do some pull reqs from now on if I find anything else interesting.
  2. @bernhard Hi on the site directory templates topic, I think it is just a matter of detecting the template root across the board in terms of /site/templates or /site-subsite/templates... If I download uikit from the RFE module settings, for example, it does get saved in the site-subsite/templates/ directory. If I download a webfont, the same - a fonts directory is creates in site-subsite/templates/ and font files are brought over. However, the sample CSS provided on the backend assumes /site/templates/fonts/ as the root for font files. Likewise, the injected CSS assumes /site/templates/ instead of grabbing the site root directory. <!-- rockfrontend-styles-head --> <link href='/site/templates/bundle/head.css?m=1666711953' rel='stylesheet'> <link href='/site/templates/fonts/webfonts.css' rel='stylesheet'> The actual site root for this site is site-mgtc - so /site-mgtc/templates should be detected. I hope that makes sense. The uikit styling issues were an unrelated VPN issue caused locally - ignore that piece. Lots of convenient stuff here - really liking the operation so far. This is with v 2.1.11 BTW - I upgraded and cache cleared to be safe.
  3. Hi @bernhard - a few small things I have noticed. The site assumes a 'site' root for the site directory, but on multi-site this is often not the case. Is there a technical reason why you are forcing a base uikit head.css to be injected? Again, this is pulling from the site directory which creates a little confusion on multi-site. I could shuffle around things with my other stylesheet loads and/or eventually add them to the scripts method, but I am wondering if this is due to a backend switch being flipped or is the default behavior. If I already build from LESS with uikit it seems redundant to load head.css again?
  4. @bernhard Curious, do you still use this module/function? Is it something you plan on submitting as a module to the directory?
  5. Oh I see. Never mind. The password manager I am using in my browser decided that one of the configuration fields in the Session Login Throttle configuration page is where a username should go. Thus I accidentally saved a text value into the maximum number of seconds a user would ever have to wait field. Thanks autofill! Shouldn't this form field be constrained to an integer, or does it allow relative time entry?
  6. Running on 7.4, the same trace appears but with a warning... under 8.0 it is fatal. The line in question is the line that expires past login attempts using a time calculation $expired = $time - $this->maxSeconds; Hey now… Fatal Error: Uncaught TypeError: Unsupported operand types: int - string in wire/modules/Session/SessionLoginThrottle/SessionLoginThrottle.module:183 #0 wire/modules/Session/SessionLoginThrottle/SessionLoginThrottle.module (91): SessionLoginThrottle->allowLogin('admin') #1 wire/core/WireHooks.php (1060): SessionLoginThrottle->hookSessionAllowLoginAttempt(Object(HookEvent)) #2 wire/core/Wire.php (484): WireHooks->runHooks(Object(Session), 'allowLoginAttem...', Array) #3 wire/core/Session.php (996): Wire->__call('allowLoginAttem...', Array) #4 wire/core/Wire.php (419): Session->___login('admin', '!plDA#6c*H1$g0') #5 wire/core/WireHooks.php (952): Wire->_callMethod('___login', Array) #6 wire/core/Wire.php (484): WireHooks->runHooks(Object(Session), 'login', Array) #7 wire/modules/Process/ProcessLogin/ProcessLogin.module (546): Wire->__call('login', Array) #8 wire/core/Wire.php (419): ProcessLogin->___login('admin', '!plDA#6c*H1$g0') #9 wire/core/WireHooks.php (952): Wire->_callMethod('___login', Array) #10 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessLogin), 'login', Array) #11 wire/modules/Process/ProcessLogin/ProcessLogin.module (385): Wire->__call('login', Array) #12 wire/core/Wire.php (413): ProcessLogin->___execute() #13 wire/core/WireHooks.php (952): Wire->_callMethod('___execute', Array) #14 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessLogin), 'execute', Array) #15 wire/core/ProcessController.php (350): Wire->__call('execute', Array) #16 wire/core/Wire.php (413): ProcessController->___execute() #17 wire/core/WireHooks.php (952): Wire->_callMethod('___execute', Array) #18 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessController), 'execute', Array) #19 wire/core/admin.php (160): Wire->__call('execute', Array) #20 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('/home/gornycre/...') #21 site-solon/templates/admin.php (34): require('/home/gornycre/...') #22 wire/core/TemplateFile.php (328): require('/home/gornycre/...') #23 wire/core/Wire.php (413): TemplateFile->___render() #24 wire/core/WireHooks.php (952): Wire->_callMethod('___render', Array) #25 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #26 wire/modules/PageRender.module (575): Wire->__call('render', Array) #27 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent)) #28 wire/core/WireHooks.php (952): Wire->_callMethod('___renderPage', Array) #29 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #30 wire/core/WireHooks.php (1060): Wire->__call('renderPage', Array) #31 wire/core/Wire.php (484): WireHooks->runHooks(Object(Page), 'render', Array) #32 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array) #33 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest)) #34 wire/core/Wire.php (416): ProcessPageView->___execute(true) #35 wire/core/WireHooks.php (952): Wire->_callMethod('___execute', Array) #36 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array) #37 index.php (55): Wire->__call('execute', Array) #38 {main} thrown (line 183 of wire/modules/Session/SessionLoginThrottle/SessionLoginThrottle.module) This error message was shown because: site is in debug mode. ($config->debug = true; => site/config.php). Error has been logged. For some reason I only have one site that causes this error on login in PHP8 - the rest login just fine. This is a multisite installation and they all share /wire. I'm stumped.
  7. Might be worth adding a prerequisite to the module requirements - I still had a few sites on PHP 7 and the version of composer you include expects PHP 8 at minimum. Just letting you know.
  8. 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.
  9. 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!
  10. 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
  11. I just ran into this issue - changing from brackets to parenthesis solved the issue, but I am curious which module was trying to do the substitution/replacement and returning nothing?
  12. 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.
  13. Brilliant. Thanks! I had a feeling something like that was going on. I usually use incognito when testing anyway - not sure why I didn't this time. That's a very practical reason for doing so. ?
  14. 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.
  15. 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...
  16. How can I turn off these notices? Even when debug mode is disabled, they appear for any custom render files replaced every time the page is loaded.
  17. @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.
  18. I'm also really looking forward to seeing this in action as a middle tier alternative/woocommerce alternative. Hopefully the testing will go well.
  19. Yes I see your point. Because the slug in pw comes from the page name, not the template name. I'm getting my systems confused over here - with another popular system. Ugh. Thanks for making the change anyway.
  20. 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.
  21. 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.
  22. 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.
  23. 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?
  24. Yes that's what I figured. Looking at it more closely, I think if I bring in the HTML.AdminThemeUikit class in rulesets for those modules I can guarantee more specific rules.
  25. 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: 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.
×
×
  • Create New...