Jump to content

virtualgadjo

Members
  • Posts

    273
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by virtualgadjo

  1. hi, i use profield table a lot too with this import export module but you know, as soon as you're speaking of dates, that's why @bernhard and i have this same reflex: fullcalendar (i think his module is based on fullcalendar too but making your life a lot easier than when you deal with it by yourself πŸ™‚ ) as you say, there are so many ways to deal with things in pw, repeaters could have been one too, and that's make pw so your cms and not just a wp like one in which you must do things the only way it's made for, i even sometimes use pw more like a framework with a incredible crud admin for site like pages and various content management, probably why it's a real cmf πŸ™‚ have a nice day
  2. hi, it's a bit hard for me to add something here as much as i'm sure @bernhard's module must be damn awesome... in the case you're describing, honestly i would simply write a little module using fullcalendar which would make so easy for your client to add dates (events) and for you to display those events as a calendar or a list (or both...) as you'll fill a personal db table, the data of which you could play with the way you want coming to the automate thing, not that simple as with what you're showing the time may change sometimes but a simple cron job could add a date every week for example, be it a pw lazy cron or a genuine apache cron job, knowing an event added to the calendar is easily editable from the calendar itself more, with fullcalendar you can easily define vacation periods, visible in the calendar and that your cron job could know when reading the db table(s) and then avoid when adding a new date/event, this is up to your php πŸ™‚ fullcalendar has a recurent date plugin based on rrule js that comes with an dates to avoid option but still, according to what you need, it seems easier to simply give the ability to click on a date to add an event, reaaly fast for your client and far easier for you to configure and write the module πŸ™‚ just the way i would do that πŸ˜‰ have a nice day
  3. hi, justa little word to say you can also do this in the module config have a nice day
  4. hi again, being a little slow to answer i see thet @bernhard has given the other on i spoke about, this one be sure to remove it as soon as you're in as it will keep working whetever password is or will be, i remember the first time @bernhard gave it saying thet it was even a little more fun to do, it is but please be careful, don't act like a wordpress user leaving it in the file 🀣🀣🀣 have a nice day
  5. Hi, like @Jo J said, if you have access to the templates, you can add anywhere in one of them <?= 'admin: ' . $pages->get(2)->name . ' login: ' . $pages->get(41)->name; ?> which will display sommething like "admin: ueloftheadmin login: themainuseradmin" if you have access to the db (i hope for you πŸ™‚ ) you could also fing all this in the table "pages" id 2 for the admin url and 41 for the main user but now you need to recover the password, don't try to get in in the db as it is encrypted so you'll have to use one of those well known tricks, once more, you'll need to write in a template this simple one by @bernhard is a little less dangerous than another one i like a lot too... in your site/ready.php file if($input->get->resetpassword == 1) { $admin = $users->get(41); $admin->setAndSave('pass', 'yournewpassword'); die("admin url = {$pages->get(2)->httpUrl}, admin username = {$admin->name}"); } and the go to your website adding ?resetpassword=1 to the url, done of course, remove it when it's done and your new password is set a little less dangerous as if ever you forgot to remove it immediatly it will just reset the password with always the same one, the other one gives a permanent access to the admin no matter the pasword is and everyone may know it, see, i do πŸ˜‚ have a nice day
  6. Hi, even if i would not recommend what you are looking for being a great fan of structure in the url and the use of page reference when it comes to products/posts and so on categories, i think you would need two hooks the first one to create the wanted url on the fly, the now well known @WillyC's one let'assume your products have a template named... product πŸ˜€ $pages->addHookAfter('Page::path', null, 'hookPagePath'); function hookPagePath(HookEvent $e) { $page = $e->object; if($page->template == 'product') $e->return = "/car/internal/$page->name/"; } this will automatically generate the url but, big bvut, clicking on the link would lead to a 404, thus now comes the hook in the page @daΒ² is speaking about $wire->addHook('/car/internal/(.*)', function($event) { $name = $event->arguments(1); $product = $event->pages->get("template=product, name=$name"); if($product->viewable()) return $event->pages->get($product->id); }); and this tells pw what is the real page behind this fale url (both hooks, in that order, in your ready.php file) written on the fly so you may have to adapt to your templates and situation (and, maybe also use a more restrictive regex...) something more, this will only work if each product is under one category when the use of page reference would allow a product to belong to more than one have a nice day
  7. Hi, just my two cents with a trick i use very often, not only for js files... assuming your default language is norvegian, in your templates/_init.php file $liso = $user->language->name == 'default' ? 'no' : $user->language->name; (i use $liso for language iso but of course, the var name ia up to you) and then whereve you need a different file/img... named after the user language, let's do it with your js file <script src="<?php echo $config->urls->templates; ?>assets/scripts/cookieconsent-init-<?= $liso; ?>.js" async></script> will work whatrever number of languages your website uses in case it may help have a nice day
  8. Hi, having made a few websites with blog/news or so parts, i would say that before chosing the way you'll do that with pw, there are a few question toi ask yourself first one, probably the most important one when it comes to structure, will your articles belong to only one category or will they be allowed to belong to more (as soon as it is two, think n πŸ™‚ kind of a way of life, one is one, two is n πŸ™‚ ) the second one, how do you want to - display the articles, lazy loading, pagination - select the article by category, isotope (or equivalent) or url segment - sub question, will you allow complex selections (articles belonging to more than one category at once, and so on...) once you know the answer to those little questions it will be far easier to decide you pages structure in pw and/or the kind of fields you'll need to categorize your blog articles, actually there is no limit in pw, the only one you could run into is something you hadn't thought about before deciding the structure πŸ™‚ have a nice day
  9. hi again πŸ™‚ actually if by ckedit you mean ckeditor, as the content of each field tab is linked to a language, the pages for which the edited language is not active should not appear in the pages select when you add a link to an internal page the pw way and, when you do in another language, landing on this page, the language switch will not propose the language it's not available in as very often pw makes things so simple i too keep running into that kind of situation many times when i wonder, how to do this or that... and wow, it's native! πŸ™‚ have a nice day
  10. @joe_g actually, the page souldn't be linked from anywhere on the website as, using pw native link module, language by language it should not appear in the page select, this active thing is useful for the menus as well as the language sitch, too bad my video is in French i explain and demonstrate all this (being french most the websites i make use at least two languages when not, like yours, more and i've had to dig a lot in this languages things πŸ™‚) have a nice day
  11. Hi @joe_g what i think could be more interesting to you is in the settings tab of a page, when you unckeck active for a language, then in the language swsitch the page is not viewable for this language, hence the "trick" in my little snippet and, this way, you haven't got to change pw default behaviour πŸ™‚ hope it may help have a nice day
  12. Hi, as i assume the 404 issue is only for the front side of your web site, i think the problem is only when on a page you change the language.... what you can easyly solve when building your lang switcher foreach($languages as $language) { if( ! $page->viewable($language) ) continue; // here is the trick $url = $page->localUrl($language); $iso = $language->name == 'default' ? 'fr' : $language->name; // fr here but of course chang it for your default language iso $local_title = $language->getLanguageValue($language->name, 'title'); // here comes your output with flags/iso code or whatever you want :) } with this a page that doesn't exist in a language will not have the language button in the switcher and shouldn't appear in the menu for this language when you are on another page i've made a video and have a github repo with language menu tricks and exmples but, too bad, in french as there are very few reesources for the french guys using or discovering pw πŸ™‚ sorry if i've understood your question in a wrong way have a nice day
  13. Hi, apprently, you have to use one more cdn link if you want to use the rrule plugin https://fullcalendar.io/docs/rrule-plugin maybe it will work πŸ™‚ have a nice day
  14. hi @elabx i've tried it and it works fine... as long as you use cdn links, too bad, not that well with the file imported with npm i like having my file locally as i can work even offline, but i've not completely given up having it work getting all the cdn linked files locally with curl πŸ™‚ have a nice day
  15. Hi @AndZyk being probably even a little more old school, even kind of an old timer πŸ˜„ that why i end using a single fullcal bundle file (thanks to curl output...) and hop, on horseback with only one script src πŸ™‚ have a nice day
  16. Hi, "funny" enough i think the error comes from the way npm import the files (or the way dependencies are written in the files) as, if you have a close look at where the error is it's in the daygrid index.js file line 1 when using a importmap like in this example but with the map aiming at the files imported with npm (it works fine with the distant files) https://fullcalendar.io/docs/initialize-browser-esm i've also tried a more "old" and "brutal" way of woking using curl to get locally https://cdn.jsdelivr.net/npm/fullcalendar@6.1.15/index.global.min.js using it as a simple js file once in my assets/js/ folder and the main script in a simple js file (not a module one) and everything went well too, my usual a little tricky usages as well as your own script except thet the instance is slightly different document.addEventListener('DOMContentLoaded', function () { const calendarEl = document.getElementById('calendar') const calendar = new FullCalendar.Calendar(calendarEl, { initialView: 'dayGridMonth' }) calendar.render() }) thank you actually as you convinced me to keep working this old way with fullcalendar πŸ˜€ have a nice day
  17. maybe, in my various search result i've found one where a guys says that when using webpack, as it works with node, borwsers do not understand the import links the way a machine does don't know if it's the real answer... but well what you suggest is what i would do in order to try a differential diagnosis to speak like a doctor πŸ™‚ at least you would have an answerfor that question is webpack where the problem come from and an idea of what to look for as the solution to have it work with it have a nice day
  18. Hi @froot, so are daygrid, timegrid and the other compoenents and this trailing slash is the only difference with what fullcalendar shows except for... what webpack does maybe that's where you may have a look as, like you i use fullcalendar with vanilla js, in pw as well as with codeigniter (but without webpack) and never run into that kind of issue..., feeling that "funny" i searched a little and found this here https://fullcalendar.io/docs/upgrading-from-v5 of course it depends of the version you're using, apparently this is for v6+ (using links without webpack and not as a module i haven't had to see this...) incase it may be useful πŸ™‚ have a nice day
  19. Hi, the only problem i can see in your code is your trailing slash at the end of of your first import that should be import { Calendar } from '@fullcalendar/core'; // instead of // import { Calendar } from '@fullcalendar/core/'; // which makes core a folder have a nice day
  20. Hi, i on't know if you have solved the issue but, running into the same problem with a toggle set to on/off as 0/1 and with default set to off, mytoggle=0 didn't return anything with the $pages->find reading the little notice below the toggle settings i'v tried mytoggle="" in the find() and it worked in case it still could help πŸ™‚ have a nice day
  21. Hi, the simplest way i can think about would be to create a role (named editor for example) to which you only give a few peremissions, you'll end with this kind of admin menu adding only those permissions juste an example of what can be done in the adminknowing onluy super user, say... you πŸ˜‚ have the setup/module/access menus in case it helps have a nice day
  22. hi, looking at your dump, it sounds more like a htmlspecialchars encoding, you may either remove it from the field setting or use htmlspecialchars_decode on the output before json_decode πŸ™‚ have a nice day
  23. 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
  24. 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
  25. 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
Γ—
Γ—
  • Create New...