Search the Community

Showing results for tags 'multi language'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 12 results

  1. Hello if have a few article pages that have a multi-page reference field with tags about the content of the article. All tags of a given page are displayed and link to a tag-overview page. Every link has a query string added with the tag name like &tag=cars so that I know which articles have to be displayed on the tag-overview page, The tag name is created using $tag->name. Since the website is multi language using German (default) and English, I use $page->localName($language) to get the localized page name . The code looks like this: foreach($tags as $tag) { $tagsMarkup .= "<a href='" . wire('pages')->get('/tags-overview/')->url . "?tag=" . $tag->localName(wire('user')->language) . "'>" . $tag->title . "</a>, "; } The code works mostly fine, but when a page has the same name in both languages, the query string will have no value just ?tag=. Why? A second problem that might be tied to the first: Once on that tags-overview page, I check if the tag actually exists using: $allTags = $pages->get("/tags/")->children); if($allTags->has("name=$tag") {...} But as I read on the forum ( that only checks for name in the default language. It was suggested to use $page->parent->path . "pageNameEnglish" but I'm not sure where and how to use it in my case. Any help?
  2. Hi all! I have a problem with selecting default language in frontend. I tried to set default language from admin panel in Access->Users for guests and admin to another language, but it changed only backend language. I read a lot of topics about this problem and i didn't find any normal solution.
  3. I've had this happen before, but now I got this problem again and I'm wondering what it's about. I use the basic <?= __('Contacte-nos') ?> method for adding translatable text to templates. Some of these are not appearing on the form when I edit the file's translations in PW. Take this line of code: <?= __('1 ou +7 pessoas?') ?> <a href="#" class="contactsMenu"><?= __('Contacte-nos') ?></a> The first string "1 ou +7 pessoas?" appears when I edit the translations, but the second one doesn't. Eventually I figured out I can only have one of these per line of code. Adding a line break somewhere somewhere between them was enough to make both translations show up in the form. Problem solved, but curiosity remains. What is the reason for this?
  4. Hi, I am creating Multilanguage site for my customer. One of the languge is Arabic. What should i do for arabic language support? i installed multilanguage profile but when i type arabic language characters its not seen in url part. Its empty and when i hit the save button it become default url (english) I tried to modify inputfieldpagename.module file but its not working. It only translating the foreign character to latin character
  5. Hello, I am building a dynamic frontend form from fields of a page, following Soma's great gist example. The form is working fine, except for multi language values. After this part of the code $form->processInput($this->input->post) when I loop over the form fields, I don't know how to access the multi language values of a field foreach($form as $field) { // how to get multi lang values here } What I tried is not working foreach($form as $field) { if($field->type instanceof FieldtypeLanguageInterface) { foreach ($languages as $lang) { $langval = $editpage->$field->getLanguageValue($lang); $editpage->$field->setLanguageValue($lang, $langval); } } else { $editpage->set($field->name, $field->value); } } Actually the $field->type returns just "text" for a PageTitleLanguage field. var_dumping the $field reveals that the language values are stored deep inside the object like 'value1023' => string 'Testworkshop2' (length=13) 'value1032' => string 'Testworkshop2 Englisch' (length=22) So how would I access those other than pulling them directly from $this->input->post?
  6. Hello, I would like to find all fields that are multi-language. My code $langFields = new FieldsArray; foreach ($fields as $f) { if($f->type instanceof FieldtypePageTitleLanguage || $f->type instanceof FieldtypeTextareaLanguage || $f->type instanceof FieldtypeTextLanguage) { $langFields->add($f); } } Is there a more generic way of how I can determine whether a field is multi language, other than checking "$f->type instanceof" for all three fieldtypes?
  7. This is my first project in ProcessWire. I am quite familiar with Joomla and WordPress. In this case i wanted more control over my content and the template. Here i am using MaterializeCSS, a lovely, rich responsive framework. I am impressed by the sheer endless possibilities of ProcessWire and i am sure that this project won't be my last. Especially the SEO and multi-language-options are great.
  8. Hello everyone, I'm working with ProcessWire now for more than two years and I'm verry verry satisfied with it! Currently I'm working on a project with integrated "Frontend CRM" and more functions for frontend-user-interaction. The Contacts for the CRM are Users with an alternate parent (as introduced in 2.5.14). Almost everything is working perfect so, but now I have one Problem: When a new user is created via the Frontend (via the great PW Api) it's parent has an name like "/en/crm/contacts/maxmustermann/" In this case the new created contact is only visible, if the Editor has "english" as language actived. In other languages (currently only German) the new Contact isn't shown. Here's the codepart, where the page is created: $c_template = $templates->get("contact"); $c_parent = $pages->get(1018); $c_name = $sanitizer->pageName($c_forname) . $sanitizer->PageName($c_lastname); if ($pages->get("name=$c_name")) { $date = date("ymdhis"); $c_name = $c_name .$date; } $nc = new Page(); $nc->template = $c_template; $nc->parent = $c_parent; $nc->name = $c_name; $nc->language = $user->language; $nc->contact_forname = $c_forname; $nc->contact_lastname = $c_lastname; $nc->contact_company = $c_company; $nc->contact_website = $c_website; $nc->contact_email = $c_email; $nc->contact_phone = $c_phone; $nc->contact_street = $c_street; $nc->contact_plz = $c_plz; $nc->contact_town = $c_town; $nc->contact_country = $c_country; $nc->email = $c_email; $nc->save(); The input values are validated before this part. I want the contact to be visible in all languages. How can I solve this problem? Many thanks in advance! Greets, Josh
  9. Hi, I need to use URL that has a segment in Hebrew, like:עברית I commented out this line in .htaccess: #RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$" var_dump($input->urlSegments) returns: string(4) "post" string(0) ""דש var_dump($input->urlSegments) returns: string(4) "post" string(3) "AAA" Does url segments support only latin characters?
  10. Hi, I'm new to PW and try to set up a multilingual website with "Language Support Page Names". Basically everything is working but I have 2 Problems: (x) The "Active?" Checkboxes don't show up which means that I can't deactivate pages which are not translated yet. (x) 404 Page. I added the language switcher solution of the above mentioned article. However this code doesn't work on 404 Pages. Is there a way to fix that? Thank you
  11. Hi Everone - I'm still a quite new to PW (currently using mostly CMS Made Simple) and loving it due to amazing flexibility it offers! My case is a little weird and despite being quite simple, I haven't quite yet figured out the best way to achieve this with PW. I have a simple website (6 pages only), that needs to offer content in two languages. The two versions have a similar sitemap, but not quite the same. In one of the languages there won't be the news section, the rest will be the same - but we would like to keep the structure independent from each other, so other pages can be added on each separately. Taking this in consideration, the "two roots" approach would probably the best one and I've been looking on how to do that in the last couple of days and found a lot of scattered information in the forums, for example: Using two separate roots: Multi language Page names/URLS: etc... Can someone help by pointing me out to one doc that has it all - if there is one? I've also looked around on the tutorials section, but wasn't too lucky. In my opinion, this doc should be something like this, should live withing Tutorials and stay fresh as Ryan develops new modules: =========================================================== Approach 1) Multilingual website with Same Pagetree a) How to install: this would be a great example b) Language Switcher code examples: Some code examples on how to do that c) Conditional static elements (for templating purposes): If en then -> ... show this else -> show this... d) Special Cases: Hide page from tree in specific language (hide from menu and backend if possible) Remember what language user chose (cookie?) Static content blocks that are diferent based on language and aren't based on templates (ie: editable footers) Real examples: Approach 2) Multilingual website with Separate Pagetrees a) How to install: this would be a great example (haven't found any reference in PW's forums) and it would be good to have an example that doens't need YAML. b) Language Switcher code examples: Some code examples on how to do that c) Conditional static elements (for templating purposes): If "en" then -> ... show this else -> show this.. d) Special Cases: Hide root reference form urls (en/about-us --> /about-us) Remember what language user chose (cookie?) Static content blocks that are diferent based on language and aren't based on templates (ie: editable footers) Real examples: ?=========================================================== Could somene help me getting this doc together to publich it in the tutorials section? I appologize if this got a little confusing. Thanks! jw
  12. Hi everyone, Sometime since I posted something here, but I can't seem to be able to surpass this problem on my own. I've read a bunch of topics that relate to this problem but nevertheless, I fail to fix this pagination display. Let me explain and hope someone help me out. This is my current structure: Home CatalogCatalog (subpage, same type)Product 1 Product 2 ... Product N The script is triggered in the first 'Catalog' in the tree above. The template of this script is similar to the default search.php, where the results are packed into the $out variable and dumped at the end. I don't believe this has anything to do with my problem. At the beginning I have: $query = "limit=3"; $products = $page->get("name=produtos")->children($query); $count = count($products); It returns the correct number of items, and displays the first 3. At the end, I have the pager rendering: echo $jogadores->renderPager(); And it displays the correct number of pages. However, clicking one of the links, the page refreshes with a new URL, but with the same three results. The URL looks like this example for page 3: /path/to/url/page3 I have turned the "Allow Page Numbers?" on the 'catalog' template, so it should work. Thanks in advance!