Jump to content

joe_g

Members
  • Posts

    415
  • Joined

  • Last visited

Everything posted by joe_g

  1. Hey all, My projects involves more and more video. For a couple of years I've been self hosting mp4's. It works okay but it's always a hassle with determining the bitrate and getting the clients to understand that kind of thing. I don't want to go back to the bad old days of embedding. Mux.com looks good, but then all video material is locked up in their servers and it's hard to move. I don't love the idea to be tied to them forever. My dream would be to have something similar to image->width(500), such as video->bitrate(3000) for 3mb per second, for example. So that the editors can upload whatever video file. I think this would be not that hard to achieve with ffmpeg? I've been toying with the idea to do something like this myself. Anyone else? J
  2. yes, you made me understand 'viewable', that's great. But i can't control internal links done in ckedit (for example). Maybe ckedit is linked to /es/page and that doesn't yet exist (but perhaps a week later someone makes a spanish translation). It should work both now and later.
  3. i use hetzner for everything since some years
  4. @gebeer Is what you describe some native setting or is it part of your module?
  5. The problem is not the language switch, it's everywhere else the page is linked. It wouldn't be enough to check if it's 'viewable' in the language switch - it would have to happen everywhere. That would be hard. But the 302 redirect setting makes this a non-problem
  6. Thank you both. @virtualgadjo I would love to stick to the native "active" if i can, however it's a bit cumbersome to check if a page is "viewable" *everywhere* when its being linked to. It could be in the language switch, but it is linked in lots of places. I Example: /es/hola-amigo (spanish page) /about (default about) /nl/about (dutch about) /es/about (NOT ACTIVE, DOESN'T EXIST) If i link from /es/hola-amigo to /es/about (without checking if it's viewable) i get a 404. What I like it to do is to instead go to /about .........Aaaaaaaaaaaaaaaaaaand after looking around a bit, there it is. This is what I didn't know existed because I didn't look hard enough 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️ thanks for the help! J
  7. Yes thank you. I don't think I explained myself very well. So I have a website with 13 potential languages, not all of them are used everywhere. Most pages have 2-3 languages out of these 13. I would like to show a language switch for the languages that has been translated (in most cases 2-3 languages). The problem is that there is no easy way for me to know what languages has actually been translated. I can't go through all the fields and compare them to the default language because it's tons of repeaters with text fields with footnotes and whatnot. It would easily be over 20-30 textfields to compare so this would be inefficient. So, I would need some kind of mechanism or switch that the editor can use to say "this language is in use". I can't use the "active" switch because if i switch it off the page gives a 404. Ideally, active=off would mean "return the page with the default language", but that's not how it works. I would like to add my own checkbox called "use this language", but I don't think there is anything like a "Multilingual Checkbox"? What i do now is that i compare the title with default, if it's different then I assume the page is translated. This does't work very well since the title sometimes stays the same. The client is not so happy with this solution. The only way to achieve this that I can think of is to have a text field called "is this page translated" that the editor would fill in with anything (such as "yes"). But that feels soo hacky and weird. Is there a better way?
  8. I posted this as a joke, but that sounds like a good idea. I'm not sure I have permissions to change the title?
  9. Hey hello, So i've got a site with no less than 13 languages. Not everything exists in all languages. The way "active" works is that if it's unchecked, then that particular language-version of a page gives a 404. What I'd like it to do instead is to still show the page, but with the content from the default language instead of throwing a 404. Ideally no page should ever give a 404. However, I suppose that's not so easy to accomplish? The plan B would be for me to implement my own "active" switch. But I don't think there is such a thing as a multilingual checkbox (that can be checked individually per language). Or is there? Maybe there is a third way I don't see right now?
  10. Hello, I get these emails "did this get resolved, please mark the answer as resolved" but ..i cant find the "mark answer as solution" button. does it exist?
  11. Thanks! That sounds great, I'll try that. I think i just graduated to yellow belt in hooks
  12. aha, this code (in admin.php) seems to be the culprit: Leaving this code and saving many times (it will fail to save every 2-5 times) and then eventually the mysql install dies entirely. I think it's the first time I managed to truly crash a PW install. You think I might be doing something verboten in the code below? $pages->addHookAfter('saveReady', function($event) { //the following code borks the database! if($p->template->name == 'event') { $home = wire('pages')->get('/'); if(!$p->onfrontpage) { $home->of(false); $home->home->remove($p); $home->save(); } if($p->enddate>time() && $p->onfrontpage) { if(!$home->home->has($p)) { $home->of(false); $home->home->add($p); wire('pages')->message('Added ' . $p->title . ' to the homepage'); $home->of(false); $home->save(); } $p->of(false); $p->onfrontpage = 0; } } }
  13. aha thank you! In the mean time the server crashed, pdo_mysql disappeared somehow. If i try to make a new PW install i get "PDO (pdo_mysql) is required (for MySQL database)". So I moved the site to a new server and to my surprise the sometimes-not-saving bug is still happening on the new server. It almost feels like i have two unrelated problems. In any case, when saving it looks normal - changes are listed (below) it's just that it doesn't actually save anything. I'll try a site-export-import next, to see if i that can clear some database problems...
  14. Hey there, I run into a strange problem with a live site that's been running okay for quite some time. I installed sury so it runs the latest php always (this was before debian shipped with php 8). So the only thing that could have changed is the php version... I think. Its on php 8.3.13 and PW 3.0.229. Anyway, if i create a page with some text field it saves ..sometimes. On average every second time. I press save and the page reloads, but then sometimes without the latest update. There is nothing in the PW error log, nothing in the apache error log, also no console errors. To make things weirder, I have another test version of the same site running on the same server and that one is working great. So it might actually be that something is up with this particular install... I'm totally stumped. If you got any ideas i'd love to hear them!
  15. Hey solved it like this, a bit more low-tech: Added the $page-id != 0 check And this is FANTASTIC. Having to choose between image upload (with drag and drop) and the flexibility of the repeater matrix have been my #1 annoyance for a decade!! $wire->addHookBefore('Pages::saveReady', function(HookEvent $event) { /** @var Page $page */ $page = $event->arguments(0); if($page->template == 'fragments') { if($page->id != 0) { foreach($page->upload_files_to_matrix as $pagefile) { if($pagefile->ext == 'mp4') { $item = $page->fragments->getNewItem(); $item->save(); $item->setMatrixType('mp4_block'); $item->mp4->add($pagefile->filename); } if($pagefile->ext == 'jpg' || $pagefile->ext == 'jpeg') { $item = $page->fragments->getNewItem(); $item->save(); $item->setMatrixType('image_block'); $item->image->add($pagefile->filename); } $item->save(); } $page->upload_files_to_matrix->removeAll(); } } });
  16. I'm trying this now but running into ..you wouldn't happen to know why this happens?
  17. Hey there, So I'm trying to update a checkbox in the admin depending on a condition (if the current page exist in a PageArray elsewhere). I'm not sure how to navigate the hooks to achieve this. I suppose I'm trying to do "before render, check if this page exist in the PageArray, if yes, set checkbox to checked, otherwise leave unchecked". many thanks!
  18. this still works in 2024 :) (answering my own question from 2013 haha)
  19. Thanks, i sort of imagined that elasticsearch would be the solution. My case is a bit different I've got both misspelled words but also a mix of languages. A word can be very similar in another language but not directly misspelled. Interesting suggestions, nevertheless, thanks!
  20. Hi there, I've got a question I suspect there might not be an easy answer for: Is there a way to do fuzzy search to allow for spelling mistakes? For example, showing results with 1 or 2 characters wrong or missing, or similar? thanks, j
  21. Hello, It is for a page. Not sure I expressed myself clear enough. So if i do a new "author" with new: The resulting author has all languages checked per default, great! : However, if i create an author through a page field: All languages are turned off by default:
×
×
  • Create New...