-
Posts
1,394 -
Joined
-
Last visited
-
Days Won
17
Everything posted by Juergen
-
If it doesnt work you could also try this one (not tested): $pages->addHookBefore('saveReady', function($event)
-
I can remember that this kind of field is also included in SEBLOD (Joomla) that I had used in earlier days. It was always a big easement because you had only to include one field which contains several other fields (fe. introtext, main article image and main text).
-
Where can I find the translation strings for wiredate
Juergen replied to Juergen's topic in API & Templates
Thanks! You saved me a lot of time. -
Hello @ all, I need to translate a wire date format like "2 month ago" to another language. wireDate($this->options['dateFormat']) Does anyone knows which file includes the translateable strings for wiredate. thanks in advance
-
I have added this issue to Github. https://github.com/ryancramerdesign/ProcessWire/issues/1771
-
For me too! The module is now also there, but no choice to select which version should be used. I have tested it and it seems that if the same module is available in the site/module folder it grabs this version automatically and ignores the one from the wire folder. I have added a slight markup change in the copy and it will be rendered on the frontend. I dont know if this is a bug or the usual behaviour in PW 3. Best regards
-
Hello @ all, today I have tried to copy a module from the core (fieldtype comments) to the site modules folder as described in this article: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-copies-of-the-same-module I use the latest devs and the module was not found after clicking the refresh button. Is this function not available in PW3? Best regards
-
Doesnt work with PW 3 - leads to error 500 during the installation.
-
Quick and dirty way to make email approval on custom comment markup. If you are using a custom markup for your comment list like Ryan describes in this post (https://processwire.com/talk/topic/696-quick-guide-to-the-comments-system/?p=386) the email approval wont work any longer. You can use your own markup and then you have to include the standard markup up too. Standard markup to render comments: <?php echo $page->comments->render(); Wrap this line of code inside a div and set the visibility of this div with CSS to hidden. Now only your custom markup is visible, but the email approval works (if you are logged in or not). At the moment I havent found another solution which works well in all cases, but if anyone has a better solution please post it here.
-
How to output multilanguage string inside a multiline variable?
Juergen replied to Juergen's topic in General Support
Yep. Example was not the correct syntax. I have corrected it and I have tested it. I got the correct output. -
How to output multilanguage string inside a multiline variable?
Juergen replied to Juergen's topic in General Support
OK, I understand. So there is no other way. I have to put the translateable string function into a variable and put this variable into the multiline variable. Thanks for you help!! -
How to output multilanguage string inside a multiline variable?
Juergen replied to Juergen's topic in General Support
Unfortunately this leads to error 500 in my case. Instead of the standard syntax for translateable strings I use a function: //Global translation function function _t($text, $context, $textdomain = '/site/templates/_strings.php') { return _x($text, $context, $textdomain); } and then I call the string like this: $namelabel = _t('Your name', 'Form'); Maybe this could be a reason for the error message. -
Hello @ all, PW offers the opportunity to use multilanguage translateable string. $text = _x('text', 'noun'); With echoing the text variable you can get the different language translations - so far so good. But how can I use such a language string inside a multiline variable? THIS WORKS $name = _x('Your name', 'Form'); $summary = <<<EOT My $name is nobody. This is a text over multiple lines. EOT; echo $summary; THIS DOESN´T WORK $summary = <<<EOT My _x('Your name', 'Form') is nobody. This is a text over multiple lines. EOT; echo $summary; I have also tried it with ${_x('text', 'noun')} and other combinations but I cannot get it to work. Does anyone know how to use translateable strings inside multiline variables? Best regards
-
Unfortunately the code above works only if you are logged in and click the email approval link Mabe someone knows a possible solution for this.
-
Answering field for site owner for the comments
Juergen replied to Juergen's topic in Wishlist & Roadmap
Maybe you are right @ LostKobraKai. I have created an "Amazon-like" rating to the product pages and for this special case it would be nice to have this feature. The Idea to highlight the owner is a less complex solution that will also work. -
Answering field for site owner for the comments
Juergen replied to Juergen's topic in Wishlist & Roadmap
Mhhh. My thought was to add a new textarea field to the comments array. In the backend the site ower can fill out this field and it will be displayed directly under the comment. -
Answering field for site owner for the comments
Juergen replied to Juergen's topic in Wishlist & Roadmap
You can make it with nested comments, but I dont want to use them. Nested comments are also separate comments. What I prefer is not creating an extra comment and to add the statement to the same comment. But maybe I will think over -
It would be great if there will be a possibility to add an answere or a additional comment of the site owner to each comment that was taken. Fe. a person gives a bad rating for a product on a page. You have 2 possibilities: dont make this rating public or make it public. It is not always realistic that there are only good ratings. Otherwise bad rating can influence your selling success. So it would be great if the site owner can post a statement directly under the bad rating (not a new comment) where he can write his own opinion or apology. This makes bad ratings more acceptable for other users. This is for good ratings too. Fe to thank the person for the comment.
-
I have found a working solution. Here is the code for others who are interested in. //check for email approval GET variables $cpageid = isset($_GET['page_id']) ? $_GET['page_id'] : ''; $ccode = isset($_GET['code']) ? $_GET['code'] : ''; $capprove = isset($_GET['comment_success']) ? $_GET['comment_success'] : ''; foreach($page->comments as $c) { if((($page->id) == $cpageid) AND (($c->code) == $ccode) AND ($capprove == "approve")){ $page->setOutputFormatting(false); $c->status = 1; $page->save('comments'); } } Best regards
-
No one an idea? I have the code to check for the email approval so far. //check for email approval GET variables $cpageid = isset($_GET['page_id']) ? $_GET['page_id'] : ''; $ccode = isset($_GET['code']) ? $_GET['code'] : ''; $capprove = isset($_GET['comment_success']) ? $_GET['comment_success'] : ''; foreach($page->comments as $c) { if((($page->id) == $cpageid) AND (($c->code) == $ccode) AND ($capprove == "approve")){ //$c->setOutputFormatting(false); //$c->status = 1; //$c->save(); echo "approved"; } else { echo "not approved"; } } The checking works and it shows me "approved" if anything is ok, but I am not able to store the new status value in the db. As far as I know comments are pages. Therefore I have tried to save it as a page, but this code doesnt work. $c->setOutputFormatting(false); $c->status = 1; $c->save(); Has anyone an idea how to save a specific comment to update the status? Best regards
-
Copy childpage leads always to a failure message
Juergen replied to Juergen's topic in General Support
Yes exactly. I will take a look next week. -
Copy childpage leads always to a failure message
Juergen replied to Juergen's topic in General Support
Strange behaviour. The copy function works if the page the should be copied is unpublished. If the page is published the duplication fails. Maybe it has something to do with the publish from date field. My setting is that the current date will be filled in if nothing is entered in the publish from field. If I copy this page maybe the publish date will also be copied and then it will be in the past. Could this be a reason? -
Copy childpage leads always to a failure message
Juergen replied to Juergen's topic in General Support
Quite good idea! Unfortunately always the loading spinner is beside the title and I get no errors from Tracy. I have tried it with the parent page and I get an error form the Page rename module. But the parent page copy function works. Maybe it has something to do with this module. I use the latest devs (3.0.12) -
Copy childpage leads always to a failure message
Juergen replied to Juergen's topic in General Support
From the UI in the backend -
Hello @ all, I want to copy a childpage in the page tree and I always get this error message: Can't save field from a new page - please save the entire page first Saving the entire page doesnt solve the problem. Has anyone an idea why this message appear on the screen. Copying the parent page works quite well. The problem is only at the children. Best regards Jürgen