Jump to content

virtualgadjo

Members
  • Posts

    325
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by virtualgadjo

  1. Hi, not sure i understand the question that well... but i'll try ? if what you want is to display the content of, say job 1 applications contents, its quite simple, you can use the $page->chidren() method to retreive all the children of the page you're on if the page you use to display job application is not the job page itself, just start with a method to get the job page example... you have a single page that will show all the applications for a job depending on a link from the job page itself on the job page (let's say job 1) make a link with something like job-applications/1017 on the job-application template, allow url segments and now, sure you've guessed, you can retrieve the job page children using that segment (you could use the page name instead of its id, prettier even if a little - very little - more code to retreive the page id using name and template but this is just for the example) $jobpage = pages->get(1017) $applications = $jobpage->chidren(); job done ? hope it helps have a nice day
  2. Hi, i'm not sure i understand the question that well but let me try the problem seems to be, you would like to have the localisation for each language in the url, for example as you said, xxx.com/contact xxx.com/fr/contact and this for all you pages if so, the solution is really simple provide you have installed the FieldtypeURLLanguage like Robin an kogondo said by default, the home page is the "mother" of all the other pages and, by default, the home page has no name in pw but has the name field usable then - leave it blank in the default language - in the other language(s) use whatever you want to set it's url (quite often the iso code will be the simplest) this way the home page url wil be - xxx.com in the default language - xxx.com/fr/ in french and so on for all the languages you use and the pages urls will be - xxx.com/the-page/ in the default language - xxx.com/fr/la-page in french for example this works if you have the same name in both languages too, xxx.com/contact => xxx.com/fr/contact hope this is what you were looking for ? have a nice daay
  3. Hi, sorry to come to you so late... actually, i your case i would choose a very simple solution which would be to use pw ability to fill all the languages with the default one if they are empty having worked on a website in nine languages (including russian, chinese and japanese), you can imagine that the case you describe happened quite a lot... my solution in your case would be quite simple, if the editor only has the news in the non default language, well, let them fill the... default language, pw will take care of the rest of the job then, the question will be, do you want to display all the news in both (or more) languages, no matter the language they appear in - if so, job done - if not, just add a select on the news template to choose in which language(s) it will be displayed with both/language1/language2 (for more than two languages, a multi select or checkboxes would do the job) this being done, it's easy to exclude news on the allnews template depending on their language and not to display the language switch on those that are not translated or, if more than two languages, only display in the switch the languages you want in case it helps have a nice day
  4. Hi Robin, and thanks a lot for your answer you're right, Page References is a great way to implement tags/categories, that's what i use a lot for blogs/news for example actually, Page References are not really multilingual by themselves but, as you retreive a page... reference ? thanks to pw API, it's so easy to get their local title and name plus whatever field the pages may contain and funny enough, i've been hesitating between those custom fields for images and... your image repeater ? for quite a big gallery coming from the author himself i'll follow your piece of advice and use the custom field solution even it's just for two fields actually, a legend and a category/tag actually, the Page Reference field does part of the job for me, i have both the categories titles to display on the front side and the css value using the pages names without having to sanitize the title when multiword and/or containing diacritics what i have to do when dealing with native image tags in a monolingual website... (in french, you may have guessed with my english :)) have a nice day
  5. Hi, @EricS Having the same kind of issue with a current website i'm working on, i've used this one https://github.com/jacmaes/TextformatterLiteYouTubeEmbed it works fine if you just need youtube videos to be displayed, incredibly fast and really easy to use less options than Ryan's one but videos are natively responsive and xith a few css tweaks (Paul Irish lite youtube embed css) it does all i needed in case it helps have a nice day
  6. Hi, well as processwire does nearly everything i need, even more... ? and allows me to play with my own db tables and custom admin pages, i had to think hard to find something i'd like by default, found out ? i would love to have native multilingual tags in image and file input fields (could be specific field like other inputs, images multilingual for example) it would greatly simplify isotope driven galleries i know this is somthing we can achieve with modules or tuto from Ryan but, honestly, for those who mainly work with multilingual web sites it would be one more step towards pw paradise ? have a nice day
  7. hi, same kind of issue for the image field pw 3.0.170 too have a nice day edited to say on github it's about the image field, dumb me ?
  8. Hi all, this maybe a rookie question ? but i wonder if anyone could tell me what are the files to choose and translate in the language support module for the new input tabs in pw 3.0.170 (image for example) (sorry if it is not the right forum to post that topic in but i haven't found a specific topic about translations in language packs one) thanks a lot for any advice
  9. my pleasure ?
  10. Hi, @MadeMyDay as a former modx evo user for quite a long time and now completely pwired i of course really like this "why i choose..." article of yours ? just one thing to add, maybe you may set your website config debug on false, it currently displays errors to the bottom of the article ? Have a nice day
  11. Hi, same kind of question as xportde with a little explanation why ? i'm currently working on a website in three languages (fr, en, es) but, at first, only one will be fully functional and i'm wondering it's possible to exclude, say, en and es, and then only es from the sitemap, knowing that google won't see the pages from the website itself as there won't be any language switch, then, only fr/en and, when ready, fr/en/es this would allow the customer to fill the fields in the alternate languages peacefully and only send the languages to the master of the world only when everything is ready ? thanks a lot for any advice and, of course for the module itself that i use on all my websites ?
  12. me neither and me too ? with all the funny things PW allows me to do, i was sure there was something clever somewhere deep in the API, a few tests later, it worked! my clients love PW but probably less than i do... everytime i'm wondering "can i do this"... yes i can (i sound like an american election baseline ? ) have a nice day chris
  13. found out! $p->title->setLanguageValue('default', $titre); thanks again for taking time to help, i feel great here ? have a nice day
  14. hi again, just one more funny thing, using $bool = $languages->setLanguage("default"); as shown by Ryan in the api, works fine on the front end but throws an error in a module, probably because it's conflicting with the admin language (answer to myself ? no, it's just because le $languages var is defined for the front end not for an admin custom page) still have to dig a little more i'll tell you if i find out (hope so ? )
  15. Hi Dragan, and thanks a lot for your answer the thing is it's exactly what i was trying to do but --- Undefined variable: languages in D:\wamp\www\moodforweb\champagne_day\site\modules\ValidEvents\ValidEvents.module on line 157 Uncaught Error: Call to a member function setLanguage() on null in D:\wamp\www\moodforweb\champagne_day\site\modules\ValidEvents\ValidEvents.module on line 157 --- i'm spinning around this set Language thing, deep inside the api i'll probably find something, a way to define $languages when in a module or something like that actually, i just want to avoid populating the french value, too bad as it's exactly what it does when the admin language is french ? i'll try something with data as the title table has data for english/default and date 1019 for the french one thanks again and have a nice day
  16. Hi all, i'm running into a funny little issue i'm working on a multilingual website, default is English, second language French in this website i've a form for visitors to submit an event, title, date and so on, when they submit the event, it's stored into a personnal db table i've created a module in the admin where admins (well, of course ? ) can't validate or delete the submitted events, thanks to pw, it works like breeze except for one little thing ? when an admin validate an event, i use the pw api to create a page and fill all the new page fields, among which $p = new Page(); $p->of(false); .... $p->title = $titre; $titre being the title of the event submitted and retreived from the database the thing is that depending of the language of the admin it fills the title in English/the default language or in French if the admin language is French and what i'm looking for is to always fill the default language title whatever the admin language is, guess, to take advantage of the auto filling of other languages when the default one is filled Funny enough i've solved the opposite problem with a multilingual select form field, using $filters = $fieldtypes->get('FieldtypeOptions')->getOptions('filtres'); foreach($filters as $f): ... echo $f->title; // it always echo the default language option title // using this echo $liso == 'fr' ? $f->title1019 : $f->title; // i've got the right select options titles displayed in the select // of course, $liso is defined in the _init.php $langid = $user->language->id; $langiso = array(1017 => 'en', 1019 => 'fr'); $liso = $langiso[$langid]; in case anybody has an idea about this page creation ? i keep searching have a nice day chris
  17. Hi a-ok, i often do this kind of thing for menu with section, sub sections, sub sections, and so on the simplest way to achieve this is to set your main foreach as it is different from its content ones and for all the sub foreaches, simply write a recursive function, if($foo.hasChildren) or whaterver condition you want your_function() with params or not depending on what you need, done ? have a nice day
  18. Hi Dragan, and thanks a lot for your answer ? actually, that's the kind of method i've ended with, i just found strange that the result worked for one language, the default one, and not a secondary one but thanks to you all guys here, i've learnt a lot of ways to filter results with pw options (for example excluding unpublished pages after an include=all in a foreach) and everything works fine for me, it was a little surprising when i first ran into this 0 being french i mostly make multilingual website when it comes to job ones and gosh, pw made this so easy for even complicated application that the first time it just coughed a little i had to tell my surprise ? have a nice day
  19. Hi all, first of all, as it's my first post here, thanks so much for this incredible CMS, thanks for all my question i've found answers here without even asking them and, of course, i can't say thanks enough to Ryan incredible job... i'm currently working on a bilingual website (pw 3.0.165 php 7.2), funny enough (i'm french), this time default language is english and the second one french but i think that doesn't matter... this website stores events and i have an page having itself all the events as hidden chidren pages, template for an event is... un_event with many fields, some of them bilingual as i'm supposed to display the number of events available on all the pages at different places ("see the xx events" with a link to the event page) in my _init.php file i've set a count of the one_event pages and this is where the funny thing is $nevents = $pages->count('template=un_event, include=hidden'); // in the default language see the <?php echo $nevents; ?> language works fine // in french $nevents is 0 $nevents = $pages->count('template=un_event, include=all'); // works fine in both languages but implies that even unpublished pages would be taken in account just to be complete, same behaviour with count($pages->get(1032)->children) count($pages->find('template=un_event, include=hidden')) and so on, in english, correct number as the result, in french 0 as a test, wondering if it was the fact that this was in the _init.php file, same thing if i use the same code on top of a page (all my files have the namespace processwire statement on top, i'm essentially a php guy ?) other test, i've done the same thing but setting all the one_event pages as visible (not hidden), same result is there something i haven't undestood or have forgotten with this all/hidden option when it comes to multilingual websites? probably ? have a nice day chris
×
×
  • Create New...