-
Posts
275 -
Joined
-
Last visited
-
Days Won
2
virtualgadjo last won the day on February 8 2024
virtualgadjo had the most liked content!
Recent Profile Visitors
virtualgadjo's Achievements
Sr. Member (5/6)
159
Reputation
-
Hi all, just in case https://github.com/virtualgadjo/pw-30244-lang-fr as always, core tranclations only,, maybe one day i'll do the same for some modules, well, maybe π have a nice day
-
Best way to deal with multilingual images that are optional
virtualgadjo replied to joe_g's topic in Multi-Language Support
hi, in a two languages website, of course i would use two fields and use the specific one if filled, in your case i would probably tend to use a naming convention with _iso for each languageexecpt for the default one, this way, parsing your fields, it's easy to check if toto_pl.jpg exisits, if not, just use toto_jpg, it would work for any language number and, as it's easy to retreive the used languuages iso even if your client suddenly decides to add a new one and more, give your client the good habit to get used to naming convention π have a nice day -
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
-
virtualgadjo started following Uncheck Active without 404? Or other way to deal with languages? , List of calendar dates , TinyMCE Editor Style File and 4 others
-
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
-
-
Can anyone advise / assist with a site recovery?...
virtualgadjo replied to creativeguy's topic in General Support
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 -
Can anyone advise / assist with a site recovery?...
virtualgadjo replied to creativeguy's topic in General Support
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 -
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
-
Using different javascript for multilanguage website
virtualgadjo replied to Edward Ver's topic in General Support
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 -
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
-
Uncheck Active without 404? Or other way to deal with languages?
virtualgadjo replied to joe_g's topic in General Support
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 -
Uncheck Active without 404? Or other way to deal with languages?
virtualgadjo replied to joe_g's topic in General Support
@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 -
Uncheck Active without 404? Or other way to deal with languages?
virtualgadjo replied to joe_g's topic in General Support
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 -
Uncheck Active without 404? Or other way to deal with languages?
virtualgadjo replied to joe_g's topic in General Support
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 -
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
- 17 replies
-
- javascript
- js
-
(and 2 more)
Tagged with: