Jump to content

Zeka

Members
  • Posts

    1,065
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zeka

  1. Hi @Klenkes I can't reproduce it with https://ckeditor.com/ckeditor-4/ and Firefox Quantum. Maybe it worth to raise an issue here https://github.com/ckeditor/ckeditor-dev
  2. @taoguang It depends on your Page Refference field settings. If you have set 'Multiple pages', so to output author names foreach($page->authors as $author) { echo $author->title; } If 'Single page' echo $page->author->title;
  3. Hi @taoguang Lest assume that you have this structure Books ( template: books ) - Book ( template: book ) - Book 1 ( template: book ) Authors ( template: authors ) - Author ( template: author) - Author 1 ( template: author) So to link author page to its books you have to create two page-reference fields: books and authors. The 'books' fields should use 'book' template as the selector and 'authors' field should use 'author' template as the selector. Then add 'books' field to 'author' template and 'authors' field to 'book' template'. Also, you can use this module https://modules.processwire.com/modules/connect-page-fields/ You can find why it would be helpful for your purpose by reading the description on its page.
  4. @Sergio Thanks, I have tried all from that thread, but it also doesn't work. $this->wire("user")->language->name always returns 'default', but in ready.php or ready modules method it works as expected, so it seems that user language is determined and set on ready stage here. The issue that I'm trying to solve: I'm using Padloper and by accessing 'padloper/ajaxViewCart/' I can get the view of the cart for ajax requests. It works as expected for default language, but not for non-default languages. So, I was trying to find a way how to get current language, but now I assume that it's not going to help as on init stage there is no page object and I actually can't get non-default lang values of fields. Here the code which responsible for that. public function init() { ..... $this->addHookBefore('ProcessPageView::execute', $this, 'runPadloper'); .... } public function runPadloper($event) { $it = isset($_GET['it']) ? $_GET['it'] : ""; if (substr($it, 0, 1) === '/') $it = ltrim($it, "/"); // We only allow urls like /padloper/ and /d/ here if(strpos($it, "padloper/") !== false || strpos($it, "d/") !== false) { // Do nothing } else { return; } switch ($it) { ..... case 'padloper/ajaxViewCart/': echo $this->modules->get("PadRender")->viewCart(); exit(); break;
  5. @Sergio Thanks, but not in templates/_init.php, but site/init.php
  6. Hi! Just curious is it possible to get current language in init.php or init method of modules?
  7. @bernhard Have you seen this https://www.ag-grid.com/javascript-grid-reference-overview/#listening-to-events?
  8. @synapse To not log out you can test such things in the incognito mode
  9. It is visible only for superuser, for the guest user you should get 404 error by visiting links of diactivated languages
  10. @gebeer Take a look at Ryan comment at this issue https://github.com/processwire/processwire-issues/issues/538
  11. @MSP01 You can create endpoint (template and page) where you can catch get parameters like ?unsubscribe=140530045 or ?disable=140530045 then do something like if($input->get->unsubscribe || $input->get->disable) { $subscription = $pages->get($sanitizer->pageName($input->get->unsubscribe)); if($subscription->id && $input->get->unsubscribe) { $pages->trash($subscription); } elseif ($subscription->id && $input->get->disable) { ... logic for disabling user subscription } }
  12. Actually, I think that is a great idea to track interest for modules, but it would be nice to have this feature and tracked information more centrally and open, so a potential user can see 'popularity' of modules that it gonna use.
  13. @DV-JF If you are looking for this functionality take a look at this blog post https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings
  14. From https://processwire.com/api/selectors/https://processwire.com/api/selectors/https://processwire.com/api/selectors/
  15. Hi @DV-JF It's not possible to deactivate the default language in PW. You can create custom inputs (checkboxes) to enable/disable specific language for page and then in your template check whether this page is viewable for this language and if not throw 404. In that way, you will rely on custom inputs for languages, so default language checkboxes should be checked for languages. You can use this hook for that $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); }); One drawback that I'm thinking about is that in your find() methods you have also check if this page viewable for this language. This is not tested but may work. Also, take a look at this module, you may find it useful in some cases
  16. As far as I know, there is no way to change created and modified date in the admin area. The best way is to create custom publish_date or craeate_date fields or use this module http://modules.processwire.com/modules/schedule-pages/
  17. @MilenKo There are two routes how you can achieve ML menus with MB. 1. Create separate menu for every language and depending on user language pass different pages for menu render method. 2. Enable additional language for the menu ( Settings tab -> Other active languages for this menu) I think that it is what you are looking for.
  18. Hi @neosin Are there errors in PW and server logs? There is the similar thread
  19. There is an option in template settings (Advanced tab -> Template toggles -> Allow the 'created user' to be changed on pages ) Is that what you are looking for?
  20. @clickpass You can use array_chunk, or use hook to add similar method to WireArray object. Take a look at this post
  21. @yinken Does it work for you?
  22. @theo I think that is something that should be reported. Could you open an issue on Github, so Ryan could comment is it intended behavior or a bug?
×
×
  • Create New...