Jump to content

virtualgadjo

Members
  • Posts

    273
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by virtualgadjo

  1. Hello again, be careful, you may end with a fky rink like me on top of your head ? being intrigued by your issue, i've had a look at this https://processwire.com/api/ref/pages/uncache-all/ and it sounds like an explanation that's good to know (i often use pagination without having ran into the same issue as yours... so far) have a nice day bye
  2. Hi, great news! ? have you looked at your template cache settings (or procache if you use it) some pages containing dynamic content, pagination, forms, and so on are better not to be cached sometimes, depending on what you cache or not the main thing is now you'll stop loosing your hair ? and my pleasure have a nice day (better now :))
  3. Hi again ? wow, funny behavior you describe here!!! in this kind of situation, first thing i would check is if this $teamPlayers var doesn't appear in another place it should not and where it stores something causing this surprising thing... of course, be sure not to use any cache as it could be your enemy here ? hope you'll figure this out have a nice day
  4. Hi, if you have chosen the multiple select option for the field, it acts like a native html multiple select, click on the first one, hold the shift key and click on, the last one, job done if instead of a select you've... selected the checboxes option, well, personally i would go for another toggle/checkbox or else field saying all the pages and if checked, in the template i would use the same selection as the one you've set for the reference field with a $pages->find(...) in case it helps have a nice day
  5. hi, hard to answer without testing completely but i think the problem stays the same as above, you first define $teamplayer and then apply a foreach to it and then again a filter to it keeping the same var name honestly, just php thinking, pw or not, what i would do for debug purpose in your case woud be a print_r of $teamplayer just after its first setting, one more after the foreach, nbot sure it would be any difference... and, again, use a new var name for your last call, something like this $teamPlayers = $pages->find("parent.name=players, team=$team"); //first one print_r($teamPlayers); bd($monster->name.':'.$teamPlayers->count()); // There should be 24 players in my team (which is the case on first call) foreach ($teamPlayers as $p) { $result = $p->child("name=tmp")->tmpMonstersActivity->get("monster=$monster, bestTime>0"); if ($result) { $p->bestTime = $result->bestTime; } else { $p->bestTime = 0; } } //second one, not sure it will different from the first one as you don't seem to replace the value in $teamPlayers print_r($teamPlayers); // and here, what seems the most logical way to do it imho would be $teammates = $teamPlayers->filter("bestTime>0")->sort("bestTime"); // I want to return only the list of players having a best time on this monster return $teammates; // a print_r($teammates); would also be a good way to see if anything happens but honestly, without kowing exactly the page structure, i just try to guess what those $p->child are... and i must say, usually when using a foreach i first set an empty var and feed it with the first array elements including those i've modified afterwards you can play with ne new array knowing you haven't modified the base one hope it helps in terms of debugging path ? have a nice day
  6. Hi, i think you should have a closer look at how pw works as i would strlongly advise you not to use aliases (slugs) in the nav as they may change nor to use templates of course have a look at a simple, very simple nav <!-- link to the home page if your website is not multilingual you can simply use <a href="/"> --> <a href="<?php echo $pages->get(1)->url; ?>"><?php echo $pages->get(1)->title; ?></a> <!-- and then a simple list of the other pages of course, you can exclude some pages ids and put the wole stuff inside an ul or whatever you want going a little further, i let you guess how to deal with sub menu, easy as soon as you've understood how it works --> <?php $pgs = $pages->get(1)->children; foreach ( $pgs as $p ): $activ = $page->id == $p->id ? ' class="active"' : ''; ?> <a href="<?php echo $p->url; ?>"<?php echo $activ; ?>><?php echo $p->title; ?></a> <?php endforeach; ?> you could also have a look at the menu modules and either use one or understand how they work to make your own https://processwire.com/modules/process-menu-builder/ or https://processwire.com/modules/markup-menu/ they offer different way of building menu and can be a good starting point for your own hope it helps have a nice day
  7. sorry too big fingers... let's resume ? there you assign a value to $teamPlayers when afterwards you apply a method to this var, well, you apply a method but don't store the result of this method in a var which is exactly what you eventually do with your $teamMates = $teamPlayers->find("bestTime>0")->sort("bestTime"); return $teamMates; there you apply a method on $teamPlayers and store the result in $teamMates ? hope it helps have a nice day
  8. Hi, actually, this is not a pw filter problem but a php one, well, not a problem, just a syntax rule when in your first line you write $teamPlayers = $pages->find("parent.name=players, team=$team");
  9. Hi, i may be wrong but the image you show doesn't look at all like PW CKeditor even when i add a lot of plugins and/or functionnalities... (not the case here but adding font-size, colors, background-colors, and so on doesn't change the display except for some more buttons ? ) and, by default, the text is wrapped inside the source view, at least when using the pw default sourcedialog extension checked, what i alwasy do are you sure you're using the default pw ckeditor? have a nice day
  10. ? there are so many coming with PW... i nearly always use this one ablility to add default attributes to external links as clients tend to forget those good SEO practices and, thanks to this module, they always act as pros ? Coming to this attributes thing, this night i had an idea when having to deal with modale videos using a library needing attributes instead of a simple class The solution may be to create a repeater field, each element containing an image (screenshot for example), the video url and... a field using your FiledtypeRuntimeMarkup module displaying the HannaCode to be used in ckeditor i have done this kind of trick for images carrousels that a client may use wherever she wanted in a content and she appeared to like it and used it a lot ? Thanks a lot for coming and brainstroming with me + for this module i like to couple with HannaCode as for many people, writing a simple snippet of code is a bit freaky when copying/pasting sounds like a daily usage ? have a nice day
  11. Hi @kongondo, and thank you for taking time to read my post ? i'm speaking about the native ProcessPageEditLink module where we can store a few classes, rels and target for the end user to use when adding a link in ckeditor (and even add them, or not, by default, to external links, a very clever and useful feature...) i'm just wondering if it would be a good idea to modify it to deal with dynamic data-attributes or if it is again one of my savage ideas :D have a nice day chris
  12. Hi all, i'm wondering what would be the best way to add custom data attributes in pw link edition in order to get something like <a href="https://foo.com" data-src="https://foo.com" data-width="800" data-type="iframe">xxx</a> and so on would you advise to use a hook? a custom text formatter? extend pw native module? i would like to be the less savage i can be (and usually am ?) hence the question ? (i know there are two different things here, using the href as a data-src would be quite easy with js but adding whatever other data-attibute, depending on the link is something else) of course, i'm thinking making that easy for final users as personally i would write this directly in the source code but this is a migraine source for non coders... ? any advice would be very welcome have a nice day
  13. Hi, i don't know if it's what you are looking for but in pw, you have a setting tab for each page where you can set whatever name you want, even completely different from the page title a little trick that may help, when creating a page pw auto fill the name field based on the title you choose, what i do when i want them different, i first fill the name and the title afterwards ? have a nice day
  14. Hi all, new post instead of updating again and again the previous one... here we are, the translation is now complete, yes, i know i said yesterday "in a few days" but i forgot the kind of crazy guy i am ? no more abandoned/unused string/phase no more empty string/phrase no more files in the "no translation file exists" list which means some never translated files are now... translated ? and those that were translated but didn't exist anymore for completely revamped modules/filetypes are now translated again https://github.com/virtualgadjo/pw30184-lang-fr hope it will help, promise, i won't flood this post again before the next PW master release ?
  15. Hi, depending on why and/or where those pieces of code are displayed or not, it could be easy to do this with php for example, if one of these piece of code is displayed when/if the page is a child of some page or template, easy to have a php if based on the parent template or id another way to do this, safe if it is your website, meaning some education if it is a client's one... would be to use toggles for the template "display this... yes/no", once more a simple check on the toggle value with php, job done (i've used this solution for a client who wanted some pages to be published, not hidden => in the sitemap but not always in the menu pw and php are great friends ? have a nice day
  16. Hi, i have some bad news that i personally consider as good news ? the short answer is... no well, i could quote one on sell at codecanyon, the seavuel hotel but, honestly i would strongly advise you not to use it even if you could want to buy it, install it and have a look at how things are done PW gives you exactly the opposite way of working than wordpress, you just install sort of a frameworks with a fantastic CRUD admin even this admin, you'll have to build the one you need with the fields you need and only those, the templates you create and pages to which you'll attibute those template, and so on this makes you think the right way, you website is unique and so will be its back-end i have made two restaurants websites with PW (https://www.restaurantilgrano.com/, https://www.restaurantlafamiglia.com/ ) for the same company/owner but starting each time with a blank site helped me not to try adapting the website to the CMS and a theme but adapting the CMS to what i needed and that is all PW is about i understand that, at first, it may sound like more work to do but, soon, you'll find out it's far less heartburns to come ? do have a try at it, you won't regret it ? have a nice day
  17. Hi, sorry to be so late to see your question... but, just in case it can still help this is something you could solve with htaccess rules but get params are nearby devs security nightmares because visible and a black hat temptation instead of params, you may use pw url segments, allowing them for the relevant templates, they act like get params but in a far more discreet and configurable way ? have a nice day
  18. Hi all, i'm currently working on a full translation of pw admin in French, slowly but surely, to be used in pw 3.0.184 two and a half main steps - first, as advised in pw translation tool, deleting all unused phrases, checked ? - and now, progressively, translate the phrases that are empty, well, most of them... - in the meantime, i add the files in the "no translation files exist" list, beginning with, to my mind, the most useful ones, the fields that have changed so much they are not translated anymore, files, images, datetime... both those last two steps in slow progress but in progress anyway in case it could be useful for anyone other than my non english speaking clients ? i update the zip file frequently here https://github.com/virtualgadjo/pw30184-lang-fr have a nice day ----- a little update no more unused strings/sentences: done no more empty strings/sentences: done a few lost translations (gone to the no translation file exists list, not in the middle of the ocean) back, images, files, datetime, toggle: done i will continue creating those missing translation files to end with a fully translated admin, it will probably take a few days but even now the admin is really close to being frenchies friendly as always, in case it may help have a nice day (and sorry if i do not sound serious enough but i can't ? )
  19. Hi, very nice cheatsheet, i use markup regions for all my websites ? i hope @franciccio-ITALIANO will have a look at your post and fall in love with them too ? have a nice day
  20. Hi, as shown by jacmaes, there are great docs about those markup regions but in case they looked a bit hard to dive in at first sight, do not hesitate to tell me, i would write some simple examples for you to see how great and simple they actually are and what you can easily do with them, as usual with pw, from the simple replacement of header and footer by one single file to more "funny" things ? have a nice day
  21. hi, i'm probably a bit late... but i would have suggested to use markup regions which is imho the king of easy ways to do what you are looking for ? have a nice day
  22. hi, honestly, i doubt anything in the index.php file will change anything as in the case you describe you don't get the right one... instead i would try something in the htaccess file, something like <IfModule mod_headers.c> Header set Cache-Control "no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires 0 </IfModule> but even this, i'm not sure it will work for a client browser cached file as it will even not have a look at what happens server side before serving the page... have a nice day
  23. Hi, huh, this is really weird, first thing that i can say for sure, the htaccess line you quote has nothing to do with this, i have many pw websites and the 404 page works fine without touching anything in the htaccess file, even changing its slug (http404) for something a little less geeky and a little more frenchy ? (and quite often with a custom template file too) the only case i can imagine in the htaccess file would be a multilingual website with multilingual slugs for this page, some containing non ascii characters, if using point 14 in the htaccess file after having changed the default slug, you may need to change it in this section too except for this really particular case, i can't see where the problem could be without having a close look at your own code, if i were you i would start with - _init.php, init.php, ready.php files if you use any of those, do you use any regex, hook, custom redirection or else that could cause an issue for pages that don't need any - header or _main.php (i'm a great fan of markup regions :)), same reasons etc, actually, any kind of code you've written, php or js, that is supposed to work on every page. if you have any, exclude the 404 page from its execution and see if it changes something hope you'll find something out... have a nice day
  24. Hi, maybe you could try the htaccess directive on top of your root htaccess file php_value date.timezone 'America/Chicago' some servers may sometimes be php resistant ? in case it helps have a nice day
×
×
  • Create New...