Jump to content

bernhard

Members
  • Posts

    6,676
  • Joined

  • Last visited

  • Days Won

    367

Everything posted by bernhard

  1. Same idea, but personally I've never used it or seen anybody using it here on the forum ?
  2. So I recall, and still waiting ? It was on top of his list but... EDIT: https://processwire.com/blog/posts/roadmap-2017/#whats-in-store-for-processwire-in-2017 To quote ryan (4. Jan 2022): https://processwire.com/talk/topic/24876-pw-30170-– core-updates/?do=findComment&comment=209625
  3. I also prefer to use foreach + endforeach or if + else + endif when working in markup. It's a lot cleaner to read than single brackets being somewhere in the file within <?php and ?> You can get rid of the if/else though because you are outputting the wrapping div of $date anyhow. This is how I would format your code: <?php $items = $pages->find("homepage_item=1"); $date = $item->arbitrary_publish_date; ?> <div class="row mb-2"> <?php foreach($items as $item): ?> <div class='col-md-6'> <div class='row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative'> <div class='col p-4 d-flex flex-column position-static'>"; <h3 class='mb-0'><?= $item->title ?></h3> <div class='mb-1 text-muted'><?= $date ?></div> <p class='card-text mb-auto'><?= $item->summary; ?></p> <a href='<?= $item->url ?>' class='stretched-link'>Continue reading</a> </div> <div class='col-auto d-none d-lg-block'> <svg class='bd-placeholder-img' width='200' height='250' xmlns='http://www.w3.org/2000/svg' role='img' aria-label='Placeholder: Thumbnail' preserveAspectRatio='xMidYMid slice' focusable='false'> <title>Placeholder</title> <rect width='100%' height='100%' fill='#55595c' /> <text x='50%' y='50%' fill='#eceeef' dy='.3em'>Check it out!</text> </svg> </div> </div> </div> <?php endforeach; ?> </div> @taotoo you have some missing echo statements in your code Note that I'm also wrapping code after 80chars usually, see https://stackoverflow.com/questions/578059/studies-on-optimal-code-width
  4. I'd use Nette then: https://doc.nette.org/en/utils/images
  5. thx @szabesz I checked back and I'm also on 7.4 - sorry for the confusion ? Ok thx then the error is annoying but no issue. Thx for your help!
  6. Counter question... are you sure it's a good idea to do that in memory for every request? Wouldn't it be better to do it once, save the result and then just return the results from the saved page rather than recreating it on every request?
  7. Thx @horst for having a look, I'll check that tomorrow on my side! I'm on PHP 8.1.2 so it's a little strange ?
  8. @horst could you please have a look at this issue? https://www.php.net/manual/en/function.get-magic-quotes-runtime.php Thx!
  9. I think I was just missing a modules refresh when it did not work. I updated another version today and was wondering why it did not work. Modules refresh helped ?
  10. Just got bit by this as well... I realized that there was a massive increase in db rows (from 11k to 19k) so I checked the DB and saw the big sessions table. Found this thread, visited admin > access > session-db and boom - shrink from 19k to 8k rows: What are you guys doing about this? I'm also on ubuntu and have to update several installations I guess... What settings do you use? Wouldn't it be the best if ProcessWire did automatically clear up old sessions on its own independently from the server config?
  11. Works great, thank you very much!!
  12. Weird... it does also work now on my end! I'm not aware of any changes, but I had to copy over the new method from my previous post. Maybe I was in the wrong file or whatever on my first try... Ok that means we can simply use my modified method without the bd() ? ?
  13. It sounds correct but I'm not sure if that works. On my end it does not. Not sure if I did anything wrong though. I set this: $config->tracy = [ 'outputMode' => 'development', 'guestForceDevelopmentLocal' => true, 'forceIsLocal' => true, 'localRootPath' => '/foo/bar', ]; And I modified createEditorLink: public static function createEditorLink($file, $line, $linkText, $title = null) { bd(self::getDataValue('localRootPath')); if(strpos($file, '..') !== false) return; $file = str_replace("%file", $file, str_replace("%line", $line, Debugger::$editor)); $file = static::forwardSlashPath($file); if(static::$useOnlineEditor) $file = str_replace(static::$onlineFileEditorDirPath, '', $file); elseif(self::getDataValue('localRootPath') != '') $file = str_replace(wire('config')->paths->root, self::getDataValue('localRootPath'), $file); return '<a '.($title ? 'title="'.$title.'"' : '').' href="'.$file.'">'.$linkText.'</a>'; } But the localRootPath is empty unless I type something in the tracy config inputfield and save that. Thx for your help, it will be another little detail that will make me faster and happier every day ?
  14. I tried to explain before that this would not work for me (us). At work we work on the same project with the same users but on different machines (meaning also on different disk paths). That means one developer needs to set the path to /Users/one/project and the other developer needs to set it to /Users/two/project and maybe another dev on windows would set it to c:/laragon/www/project We can't put that into a textarea of tracy because we are all logged in as "admin" (or whatever). We have one config that we all share and that is checked into git that lives in /site/config.php; This config then loads a local config that is not part of git and that is where we could add user-specific settings like the path to the docroot. I hope it's now better to understand and I'm looking forward to hearing what teppo thinks ?
  15. I'm using DDEV now for my local development and there's one thing that I'm missing: I can't click on links on error screens or in the dump bar, because the files live inside docker ( /var/www/html/... ) whereas I have them in my IDE (on my host) at ~/foo/bar While looking for a solution I saw in the code that there's already the localRootPath config setting, but this does not solve the problem I think. The reason is that it seems to work only on live systems? Why? First, I have to force tracy into DEV locally due to the issue we talked about lately (on DDEV the detection does not work). Second, we work in a team and everybody has a different local root path. That means we'd need to put that in a config file that is custom for each user. Or maybe you have an idea for a better solution? The thing is we can't even define something like this: [ 'bernhard' => '/Users/bernhard/siteX/', 'adrian' => '/Users/adrian/siteX/', ] because we all use the same admin user on local dev... That's why I think it would be best to have a config setting that we can all put in our config-local.php which is not shared via GIT Thx!
  16. I'm not sure if I understand everything 100% but as I was mentioned here (seems to be removed now) I read the thread and it reminds me a bit of a problem we had recently when using SVGs on one of our websites. SVGs didn't show up on the frontend and also the PW backend had problems (it showed them in the small preview but not when viewed via the lightbox). The problem was that the SVGs did not have dimensions specified, so I'm wondering if that could be related? Could maybe PW check SVGs on upload and add with and height automatically if they are not present? Would that also fix your issue? Please ignore if that is not related or nonsense ?
  17. no, you dont need quotes here ?
  18. Yes. You can modify every inputfield in the PW backend via hooks: $wire->addHookAfter("Inputfield(name=link_page_file)::render", function($event) { $html = $event->return; $html .= " hooked"; $event->return = $html; });
  19. I'd start debugging by adding bd($page) from tracy debugger in this hook so that you see when and which page is saved. It seems that this hook somehow fires for all pages and therefore renames all those pages where it should only fire once. Not sure why this should be the case. Any other hooks involved?
  20. hi @adrian thx for the quick update! Seems to work great now after some reloads! Initially I had little problems, but the seem to be gone now, I'll share them FYI: - updated tracy - changed file (to trigger migrations) - tree was red, not orange (why?) I thought maybe there's something left somewhere... - delete all logs - change file (to trigger migrations) - tree is gray, but new logs sow up Ok one more... - changed file (to trigger migrations) - tree is orange, logs show up Now everything works nicely!
  21. any idea how this is done? This is one that I found while researching and is also stunning https://www.airforce.com/intothestorm/
  22. Ok great! Yeah it felt like there was some kind of delay kicking in and that explains what I was observing. Thx a lot ?
  23. Hey @adrian I'm working on a new version of RockMigrations that triggers migrations automatically whenever a file changed. I'm using logs to echo some information about the migrations. Thats nice because when I change a file and reload the page I see that the migrations have run which is indicated by new logs which makes the tree icon orange. What I noticed today is that sometimes this tree stays orange for additional 1-2 reloads... First I thought I might have some bugs in my change detection but the timestamps of the logs say there's been no change (no new log) but the icon indicates something different. Does that make sense? How does the tree icon detect if it should be gray or orang? Thx!
  24. Thx, I understand now. Well you can always fork, but if you find time to provide a PR that would be great, so everybody can benefit ? Great! Happy to hear that the module is useful for you ?
×
×
  • Create New...