-
Posts
17 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
mds's Achievements
Jr. Member (3/6)
4
Reputation
-
@dragan Thanks! That was easy. It worked.
-
mds started following Server error getLanguageValue , Module: Currency Conversion Service , Module: XML Sitemap and 2 others
-
I'm using this piece of code from the convert.php demo page $cc = $modules->get('ServiceCurrencyConversion'); $names = $cc->getNames(); // names of currencies, indexed by 3-digit codes $amount = ''; $options = ''; foreach($names as $code => $name) { $options .= "<option value='$code'>$code: $name</option>"; } $optionsTo = $options; … echo "<select name='to' onchange='this.form.submit()'>"; echo "<option>Select currency</option>"; echo $optionsTo; echo "</select><input type='submit' name='submit' value='Convert' /></p>"; I'm getting all possible currencies as a dropdown. How do I limit the choices of the options to my selection of relevant currencies (e.g. EUR, USD, GBP)?
-
@kixe It doesn't seem to work for me on PW 3.0.47 This is the error I get: Error: Uncaught Error: Call to undefined function wire() in […]/www/site/templates/multilang-sitemap-xml.php:116
-
When adding a caption to an image, the image width and the caption itself get as small as possible in the editor. In the frontend everything looks ok. Is it a known bug? Where do I have to look for an answer?
-
Thanks, Adrian. Very grateful. That version doesn't spit out the error I mentioned. I get another error now: the Home-page gets added as a new page on import, but that's something I can manually adjust. Looking forward to updates on exporting/importing/migrating. Loving Processwire so far, and it's only early days!
-
I did some further testing. When I choose Replace instead of Overwrite, all texts with multi-language input are deleted, including default language. I even tested with exporting to a zip, and then importing that same zip. Same errors. So, it's not related to what the translator could have done with the files.
-
I'm trying to use this module to get pages to an external translation agency, that uses a translation memory. The multilanguage modules are in use and working fine. [Added English manually to the Dutch (default) site, trying to add French and German automatically.] What worked fine: Export of all pages as a json file Import of that json file in their translation software Inspection of their translated json file in Atom - looks fine Then I tried to import their file, and that failed. Append: nothing changed — expected behaviour Overwrite/Replace: shows me this error Error: Uncaught Error: Call to a member function setLanguageValue() on null in /Applications/MAMP/htdocs/site/modules/ProcessMigrator/ProcessMigrator.module:1441 Stack trace: #0 /Applications/MAMP/htdocs/site/modules/ProcessMigrator/ProcessMigrator.module(161): ProcessMigrator->processImportForm2(Object(ProcessWire\InputfieldForm)) #1 /Applications/MAMP/htdocs/wire/core/Wire.php(374): ProcessMigrator->___executeImport() #2 /Applications/MAMP/htdocs/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___executeImpor...', Array) #3 /Applications/MAMP/htdocs/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessMigrator), 'executeImport', Array) #4 /Applications/MAMP/htdocs/wire/core/ProcessController.php(244): ProcessWire\Wire->__call('executeImport', Array) #5 /Applications/MAMP/htdocs/wire/core/Wire.php(374): ProcessWire\ProcessController->___execute() #6 /Applications/MAMP/htdocs/wire/core/WireHooks.php(698): ProcessWire\Wire->_ (line 1441 of /Applications/MAMP/htdocs/site/modules/ProcessMigrator/ProcessMigrator.module)
-
I must have made a typo somewhere. Reading the tag trace again, I discovered it was quite easy… It said <html lang="<?php echo _x('en', 'HTML language code'); ?>"> instead of <html lang="<?php echo __('en', 'HTML language code'); ?>"> Thanks for helping out.
-
So, I created the website and published it on a subsite of the web hosting. For the final version, I installed a new version, used the profile exporter to get a new one started. The first error was something with (wire) in the Module AllInOneMinify. I was unable to get access to Processwire Admin. By renaming the file that caused the problem, I managed to enter. Everything looks OK in admin, but when I want to look at the site, I get a blank page. In the source code is this error. Who can help? <b>Fatal error</b>: Uncaught Error: Call to undefined function _x() in /data/sites/web/huskymarketingplannercom3143/www/site/assets/cache/FileCompiler/site/templates/_head.php:2 Stack trace: #0 /data/sites/web/huskymarketingplannercom3143/www/site/assets/cache/FileCompiler/site/templates/home.php(1): include_once() #1 /data/sites/web/huskymarketingplannercom3143/www/wire/core/TemplateFile.php(268): require('/data/sites/web...') #2 /data/sites/web/huskymarketingplannercom3143/www/wire/core/Wire.php(374): ProcessWire\TemplateFile->___render() #3 /data/sites/web/huskymarketingplannercom3143/www/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #4 /data/sites/web/huskymarketingplannercom3143/www/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #5 /data/sites/web/huskymarketingplannercom3143/www/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #6 [internal function]: ProcessWire\PageRender->___renderPage(Object(Proce in <b>/data/sites/web/huskymarketingplannercom3143/www/site/assets/cache/FileCompiler/site/templates/_head.php</b> on line <b>2</b><br />
-
I have a website in two languages: nl and en, using the Languages and AutoDetect Languages modules for it. There are two links on the page that lead to an external website which needs a lang parameter in the url "https://www.example.com/accounts/create/?lang=nl". The strange thing is that on the live website in Dutch (nl) the lang parameter is changed to 'en'. In English it's the other way around. <?php echo "<a class='login' href='https://example.com/accounts/create/?lang=" . "$hreflang" . "&?utm_source=corporate_site&utm_medium=redirect&utm_campaign=redirect-corporate_site-start'>" ?> I have also put the url without $hreflang (href="https//example.com/accounts/create/?lang=nl&?utm_source=corporate_site…") in a textarea field and it is also changed. The $hreflang is defined before <?php // handle output of 'hreflang' link tags for multi-language // this is good to do for SEO in helping search engines understand // what languages your site is presented in foreach($languages as $language) { // if this page is not viewable in the language, skip it if(!$page->viewable($language)) continue; // get the http URL for this page in the given language $url = $page->localHttpUrl($language); // hreflang code for language uses language name from homepage $hreflang = $homepage->getLanguageValue($language, 'name'); // output the <link> tag: note that this assumes your language names are the same as required by hreflang. echo "\n\t<link rel='alternate' hreflang='$hreflang' href='$url' />"; } And after that mention in the php-file <?php foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { echo ""; } else { $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); echo "<a hreflang='$hreflang' class='languagetoggle' href='$url'>$language->title</a"; } } ?> </nav>
-
In a previous version, the _init.php was automatically added unless otherwise selected in template - files tab. That's what caused my troubles. Thanks for directing me to the solution!
-
I'm getting this error. Error: Uncaught Error: Call to a member function getLanguageValue() on null in /Applications/MAMP/htdocs/site/templates/_head.php:36 Stack trace: #0 /Applications/MAMP/htdocs/site/templates/home.php(1): include_once() #1 /Applications/MAMP/htdocs/wire/core/TemplateFile.php(268): require('/Applications/M...') #2 /Applications/MAMP/htdocs/wire/core/Wire.php(374): ProcessWire\TemplateFile->___render() #3 /Applications/MAMP/htdocs/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #4 /Applications/MAMP/htdocs/wire/core/Wire.php(402): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #5 /Applications/MAMP/htdocs/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #6 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #7 /Applications/MAMP/htdocs/wire/core/Wire.php(376): call_user_func_array(Array, Array) #8 /Applications/MAMP/htdocs/wi (line 36 of /Applications/MAMP/htdocs/site/templates/_head.php) This error message was shown because: you are logged in as a Superuser. Error has been logged. I got the error after installing the module ProcessWireUpgrade and upgrading ProcessWire Core Dev to 3.0.46. This is what is in the _head.php file (standard form multi-language setup. The line with the error starts with $hreflang <?php // handle output of 'hreflang' link tags for multi-language // this is good to do for SEO in helping search engines understand // what languages your site is presented in foreach($languages as $language) { // if this page is not viewable in the language, skip it if(!$page->viewable($language)) continue; // get the http URL for this page in the given language $url = $page->localHttpUrl($language); // hreflang code for language uses language name from homepage $hreflang = $homepage->getLanguageValue($language, 'name'); // output the <link> tag: note that this assumes your language names are the same as required by hreflang. echo "\n\t<link rel='alternate' hreflang='$hreflang' href='$url' />"; } ?> How do I begin to fix this error?
-
That works. Thanks!
-
Getting started with ProcessWire and not much off PHP experience … I've set up a field with authors, which shows a dropdown select of users on my blog entry page. So, in the admin everything works fine. Now I want to show the author on my blog entry page/ php-template. But in the output it only shows the page id, when I use <?php echo $page->author ?> How do I show a different field from that page, for instance the full name or how do I use the URL of the first image on that User page? I thought it would as simple as <?php echo $page->author->fullname ?>
-
mds changed their profile photo
-
Thanks! That was something that I was looking for. Wasn't clear for me, also because you already set the language code as the name for the language.