Jump to content

virtualgadjo

Members
  • Posts

    251
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by virtualgadjo

  1. Hi; honestly, i would do this kind of thing in the template file wrapping the display of the link with a simple if user is logged... better SEO and UX than a 404 πŸ™‚ have a nice day
  2. Hi again @adrian i had a little respite this morning and couldn't help having a closer look at your module eventually, i ended up with this https://waitandcie.com/down/ProcessCustomUploadNames.zip that fits my needs, one more input to fill with comma separated strings if needes, if the filename doesn't contain one of them, i do not rename, if it does, i rename according to the rule in the filenameFormat input this will avoid those screenshot_date..., captrure_decran_date... and the names straight out from the camera that make my eyes bleed πŸ™‚ Edited to say, i forgot to add this... screenshot πŸ˜„ of course it works on adding a new rule too thanks a lot again for your time and for this great module i will probably use even more to persecute friends and customers πŸ˜„ have a nice day
  3. Hi @adrian thanks a lot for your answer i think that in the case i'm on iwill go for the simple solution but as soon as i've got a little more time to dive into the code and add a field, sort of a "replace incase the name contains" array field, if ever i do it clean, i'll of course get back to you with what i will have done πŸ™‚ have a nice day
  4. hi again, i've seen that i could easily add some conditions to this function customRenameUploads(HookEvent $event) but maybe there is a cleaner way to do this πŸ™‚ have a nice day
  5. Hi @TomPich i've often to do this kind of thing, typical example is a password reset link, in this case i usually create a personal db table with, worse than the case you describe, this page is limited to be viewed only one time... - auto increment id of course - user email - uid - creation date - used default 0 - used date (not necessary but i like to keep track of what happens) the page contains obviously a field to get the user email as soon as it is displayed - i check if the uid is in the db,, if not > die() and if the used field still contains 0 - the used field is set to one and it will not usable again (you may not need this limitation) the uid if of course a long (64char min) string easy to handle with pw url segments and a regex to define what you accept i've done this a lot, be it in pw but also in the old modx evo i used a long time ago as in all my framework based tools, pw just, as usual, makes it even easier to set up πŸ™‚ of course, this is fully adaptable for any other need than password reset adding a user id field if you want to check the user email and password as well as what follows if the user is successfully logged in case it could be useful have a nice day
  6. Hi, i'm wondering, it may seem a curious question.. but is it possible with this module to condition the renaming of an image to its original name? for exemple, rename only if the name contains seom strings like screenshot (or capture_decran for frenchies :)) or dcsc and so on, you know those image not renamed from the cameras sd cards or screenshot tools this only to help some lazy customers or friends not to ruin their SEO forgetting the good practices they have been told because even if it is in my nature i feel a bit harsh renaming images even if they have made some namig effort, some of them do πŸ˜„ just a funny idea πŸ™‚ have a nice day
  7. Hi @FireWire, before @Teppo gives you the right answer and trick ? i can already answer, yes it is possible i have a website that uses a lot data coming from a totally different db for some pages and i wanted those contents and pages to be indexed as well, here is the trick - i've created a field (textarea) named extcont (for external content but of course, name it as you want ? ) and added this field to the indexable fields for the template that have it - and then, i used a hook in the ready.php file to fill the module index field this way $this->addHookAfter('Pages::saveReady', function(HookEvent $event) { $page = $event->arguments(0); $template = $page->get('template'); require_once('templates/_dbc.php'); // my connectionh to the external db needed by the class method i use below require_once('templates/_func.php'); // same thing for some functions i need in that same method if ( $template == 'an_edition' ) { require_once('classes/myVictimPage.php'); $id_ed = $page->id_ed; // a "normal" field in the page to get the... edition id :) $ext = $page->get_ext($id_ed); // a method in the template class that returns all the content i need to index in raw form $page->extcont = $ext[0]; // for the default language $page->extcont->setLanguageValue('en', $ext[1]); // guess, it's a multilingual website :) and here i add data to the field } //... and some more for the other templates that need it } and it works like a charm for many different templates, a program, history, etc;, in your case i think you may just have to add RockPageBuilder returned content but here is the kind of hook you can use to add some extra content to the the field indexed by the module little piece of advcie is add only raw text content without any html hope it may help have a nice day
  8. Hi @Christophe you know, there must be far more sentences that are not translated, if you go to the language translations tab in french and search for "vide", you'll see, there is no remaining empty sentence, vide/empty meaning not yet translated, in the core translations part but, huge but, if now you click on this button you'll sse a lot of files to translate, some concerning your templates maybe, some the modules and some others a few parts of pw that are not in the core translation files now coming to your "Show this field only if" looking for it using the serach field, funny enough, it's in the file you see in the image, it is translated but... wow ? ? ? thank you, as i say on my github repos, i started from en existing pack and just updated the new missing sentences from 3.0.184 but, honestly, apart from some typos here and there, i never thought there were such mistakes, thanks to you this one will be corrected on the next master release french pack (Afficher ce champ... of course) ? Have a nice day
  9. Hi, just my two cents ? to do all of this i simply use the tinytmce module config abilities and then in this css file i simply import my fonts.css or, depending of their number define my fontfaces as in the font side afterwards, il can, exactly like on the front end, set all the rules i want to be applied in tinymce for the h, the classes and so on have a nice day
  10. Hi, not sure i understand completely the whole story but, i may be wrong, it seems to me that you are using this page reference field to organize your backend structure when it's designed more to be sort a predefined $pages->find you'll retreive on the font end which as @daΒ² says, is more the role of the family tab of the templates where you can define which template can have as children pages and what parent template can be the parent of a defined page/template more, when defining those relations between template the add new button to the top right of the admin let you add a new page chosing its template and it will automatically added to its correct parent the new button of each page will also automatically be added with the correct template sorry if i've completely misunderstood your problem... have a nice day
  11. Hi, there is something i do not understand... when using the page reference field, once you've defined a parent page, the dropdown will show all its children but, the data returned to your template/frontend will only be the one(s) you've chosen, how will you choose those ones without seeing them in the dropdown backend wise? if you choose the pageArray option and the texttags type of field, the reference field will act as a selectize like field, allowing you to chose, order and delete your chosen items frontend wise, only an array of this choice will be returned and not all the children of the parent page published or not... hope it helps have a nice day
  12. Hi, sorry it that sounds like a silly question, but have you tried the simple <iframe src='<?=$page->landing_page_html->url>' width='100%' height='600px'></iframe> as files work like images, you don't just echo the field name but its attributes, url, description (that you can use as you iframe title ""if"" accessibility matters) just in case ? have a nice day
  13. @dan222 coming to the htaccess file you just have to use pw one and uncommenting the lines you need about those www (section 13 of the file) an https (section 9) things, evyting thing is very well commented in the file it self have a nice day
  14. sorry, hi again ? just to say, in your config file, don't forget this line $config->httpHosts = array('www.yourdomain.com'); as it's important for a lot of things, beginning with preview pages clicking on wiew buttons in the admin have a nice day
  15. Hi, just a few words to say don't forget the .htaccess file at the site root that may need to be changed - to force with or without the www - probably to force https too - and, something if nearly always do in the htaccess, to add some headers, pw default ones in the htaccess are <IfModule mod_headers.c> # prevent site from being loaded in an iframe on another site # you will need to remove this one if you want to allow external iframes Header always append X-Frame-Options SAMEORIGIN # To prevent cross site scripting (IE8+ proprietary) Header set X-XSS-Protection "1; mode=block" # Optionally (O) prevent mime-based attacks via content sniffing (IE+Chrome) # Header set X-Content-Type-Options "nosniff" </IfModule> and i often end with something like that <IfModule mod_headers.c> # prevent site from being loaded in an iframe on another site # you will need to remove this one if you want to allow external iframes Header always append X-Frame-Options SAMEORIGIN # To prevent cross site scripting (IE8+ proprietary) Header set X-XSS-Protection "1; mode=block" # Optionally (O) prevent mime-based attacks via content sniffing (IE+Chrome) Header set X-Content-Type-Options "nosniff" Header set Content-Security-Policy "frame-ancestors 'self' https://www.helloasso.com" Header set Access-Control-Allow-Origin "*" Header set Referrer-Policy "no-referrer" Header set Permissions-Policy "geolocation=(), camera=(), microphone=()" Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains" </IfModule> of course, just an exemple as helloasso is just here to say i allow iframes from this url (a french asso donation website) but you may need extra iframes, some of those can be more complex depending on your website needs more infos on those curious things here https://securityheaders.com/ ? have a nice day
  16. hi, i'd like to add another "little" argument i often use to convince clients/agencies/bosses and so on, this exact forum... a client could rightly be concerned about something that happens quite often,: if ever, for any reason we had to stop working together, will another dev be able to take care of our website? of course, all the reasons i've seen here will help with yes, pw is not that hard to learn, they are other devs working with it... but, and that's my point here, a dev who is not (yet) pw addict and will start working with will find a very good and friendly place to get help, a place where beginners are never scornfully sent to go and see elsewhere with a harsh "rtfm", this could add a comfortng reason to say, ok, let's go with it ? have a nice day
  17. Hi, just in case but i'm quite sure you've already checked this... have those users this checked in their role(s) ? if yes, i'm as stuck as you are ? have a nice day
  18. Hi @adrian i'm happy to "hear" my little post was at least useful for something ? i thought the issue i ran into was due to those pages with the same title and no names for 5 out of 6 languages but couldn't really understand where to dig more... i'll update the module in the website but you know, i'll keep my custom admin action as for the client, he won't have to wonder about all the other columns meaning and will continue to use the batch child editor he really likes to export a csv of all those pages and keep track of its events historry ? this way, whatever he does with those "pages", targeting their ids won't be impacted i'm must say those pages are a little special as i don't need a name for each language, they are pages as everything in pw but actually mode data sets i use to fill a json where to get a leaflet map markers position and popup big content and even if i create those page with a really unique name, if ever he changes their title and, why not, names afterwards even if not useful, it may generate the problem you've just fixed thanks again and a lot for your time and help (and of course modules ? ) have a nice day
  19. Hi again @adrian, just tested it, i restored the db, unchecked this overwrite names checkbox and... it worked! it was looking at the snippet you pointed me to that i had this idea, thanks again ? ? have a nice day
  20. Hi @adrian thanks a lot for the tip; i'll have a close look at this piece of code but right now, having a look at this name/title thing i may have an idea those page are created by the api when validating an event and each one has a different name but ha has used the same title for many events and it looks like language names, well, the default language one in fact, in changed after the page title and the creating duplicates before running the action i will try restoring the original db but unchecking the overwrte page name checkbox to see if it changes something that's where the admin custom action doesn't run into any issue as it just targets the template, no matter the names, titles or whatever else... have a nice day
  21. Hi @adrian it happens every time i tried (actually, the first time, it was my client who ran into the error and called me asking what he could have done wrong ? ) even both ways, publishing and unpublishing, after having added my custom admin action and i tried many times before and after "weekendatbinnys-champagne-tasting" is a page name name1019 the default language name of the page (website with six languages...) i've tried changing the name in english but, same result of course every child page has a different name but the name is only set in the default one (english), running select count(name1019) as dups, name1019 from pages group by name1019 having count(name1019) > 1 returns an empty result what's funny is that the website is now 5 years old and the client has already used the batch child 4 times without any alert (i've tried with the last release of your module but it didn't change anything) what was interesting to me was that once i've unpublished all the children with my action, trying to publish them back, i only worked with the hidden one, no displayed error but funny result... and it's the first time the client hid some pages during the events announcement without unpublishing them, up to this year he just unpublished the events before launching the next harvest ? have a nice day
  22. Hi, here again ? i'm running into a funny little issue on a website that has a page with many children (714 so far), some of them hidden, some not, some of them already unpublished, some not, if i try to unpublish all the children i get this error -- ProcessPageEdit: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicata du champ 'weekendatbinnys-champagne-tasting-1021' pour la clef 'name1019_parent_id' -- the funny thing being that using your admin actions module, i've created my own action to unpublish all those pages (that have the same template), just adding include=all to my find protected function executeAction() { $ps = $this->wire('pages')->find('template=un_event, include=all'); foreach($ps as $p) { $p->addStatus(Page::statusUnpublished); $p->save(); } return true; } it works like a breeze ? so, actually not really a problem for me but just for you to know ? the other funny thing is if i try to "repuiblish" all of them using the batch child editor i get this error again and... it only "republishes" the pages that were hidden at the beginning of the loop (it's a real life website and the client often "plays" with the page status along the events validation) this tends to make me think it's an include thing somewhere this makes me think too that i may go a little further with this custom action to let choose the pages to unpublish/publish by their template, parent, and so on and, of course, thanks again for those modules i really like playing with ? have a nice day
  23. @Nicolas you're right and it's one of those things that makes it so great without speaking of all those crazy guys here who never stop helping while writing great addons ?
  24. Hi, honestly for this kind of thing i use one of those two modules ? https://processwire.com/search/?q=runtime&t=Modules Robin's one is a little more recent but both work fine have a nice day
Γ—
Γ—
  • Create New...