Jump to content

dreerr

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by dreerr

  1. Dear @kixe thanks a lot for this approach! Sorry to correct you, but in your code the config variable differs, it should be $config->editablePageLanguages in config.php I wrote a small module for this, please feel free to use it! LanguagesHideInput.module.php <?php namespace ProcessWire; class LanguagesHideInput extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hide Languages Input', 'version' => 1, 'singular' => true, 'autoload' => 'template=admin', 'requires' => 'ProcessWire>=3.0.0', ); } public function init() { $this->addHookBefore('ProcessPageEdit::execute', function($event) { $this->message=$this->allLanguagesPages; $page = $event->object->getPage(); if (!$page->id || $page->id==1 || $page->template->flags == Template::flagSystem) return; if (array_key_exists($page->id, $this->allLanguagesPages)) return; foreach ($this->wire('languages') as $lang) { if ($lang->isDefault() || in_array($lang->id, $this->defaultLanguages)) continue; $lang = $this->wire('languages')->get($lang->id); $lang->status = Page::statusHidden; } $this->wire('languages')->reloadLanguages(); }); } } LanguagesHideInput.config.php <?php namespace ProcessWire; class LanguagesHideInputConfig extends ModuleConfig { public function __construct() { $langs = []; foreach (wire('languages') as $language) { if ($language->name == "default") continue; $langs[$language->id] = ($language->title); } $this->add(array( 'defaultLanguages' => array( 'label' => __('Default Languages'), 'type' => 'Checkboxes', 'options' => $langs, 'value' => [], 'description' => __('Select the languages you want to show, others are hidden.'), ), 'allLanguagesPages' => array( 'type' => 'PageListSelectMultiple', 'label' => __('Exclusions'), 'description' => __('On these pages all the langauges will appear.'), ), )); } }
  2. Dear forumreaders, I'm currently developing a big site for a museum. All pages of the site are available in DE and EN but there are general infos available in FR, IT, CZ, CN & JP. As these less important languages only populate one page, where as the two main languages populate approximately hundreds of pages it is probably not a good idea to setup all the languages in the backend, because most of the fields would be empty most of the time. Does anyone have an idea how to solve this? All the best, dreerr
  3. I hook into Pages::saved to detect field changes, but this Fieldtype never comes up in the $changes = $event->arguments[1] array. Any idea? This should behave like any other field, so if you move the marker it is a change, right?
  4. This is embarrassing , but I can't seem to find the answer: I'm quering Repeater Items like $all_date_entries = $pages->find("template=repeater_dates,include=all") when looping over the results I want to get to the page they were created. `$item->parent` is not the right result here. How do I query the originating page?
  5. Sorry for the late reply: you cn do so by using the Factorys method: $view->set('globalVar', $someVariable);
  6. The MapMarker field does not seem to work properly in the following situations: * In a Repeater in PW 3.0 with dynamic content loading. Only way here is to disable it completely so you have to save before every new item ;( * With FieldsetTab if the field is not on the first page of adminpage ;( Any chance of fixing this? All the best, D
  7. When trying to add a new field with this fieldtype I get the following error: [RED] DB connect error 2006 - MySQL server has gone away [GREEN] Geocode OK APPROXIMATE: 'Decatur, Georgia' [GREEN] Geocoded your default address. Please hit save once again to commit the new default latitude and longitude. after that in the admin it only states The process returned no content. Any idea how to fix this? Using 3.0.18…
  8. Changed the git so that jade-php is included in a normal download. Version 1.0.2 brings also some additional settings for stream and a problem we experienced with Suhosin
  9. My bad, thought I already tried that, did the trick!
  10. No it also shows up on the follow-up page where all content is entered. Any clue how to get it working?
  11. Dear Community, I have an odd behavior on one of my projects: when creating a new page (template does not matter) in the first step when setting title and name there is only the name field shown. In all other installations both title and name (one filling the other) are available. How can I establish the desired behavior? Maybe this has something to do with the fact that this used to be a PW2.2.9 installation?
  12. Hi there, when I try to override the default Format menu in CKEditor for a specific field or also for all fields according to docs creating a file at: site/modules/InputfieldCKEditor/config-biography.js with contents CKEDITOR.editorConfig = function( config ) { config.format_tags = 'p;h2;h3;Heading'; }; the changes are not reflected. Other config item like config.uiColor are working. Any solution? For now I moved everything to the style menu... EDIT: sorry, I oversaw the field
  13. Thanks! Looking forward working with it myself!
  14. TemplateEnginePug (formally TemplateEngineJade) This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates. doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug Project in modules directory: modules.processwire.com/modules/template-engine-pug/ For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
  15. Thanks for your help Horst, the problem was that an _init.php file already existed so the layout was nowhere set and the default name for it is of course not one-column, but default.php Working like a charm now!
  16. Oh yes, wrong version, still with 2.6.1 no luck here, still getting Compile Error: require(): Failed opening required '/customers/c/c/1/traumawien.at/httpd.www/site/templates/layouts/default.php' (include_path='.:/usr/share/php') (line 186 of /customers/c/c/1/traumawien.at/httpd.www/site/modules/Spex/Spex.module) running on PHP 5.6 only with JqueryDataTables, ModulesManager, ProcessBatcher, TextformatterHannaCode, LoginPersist, MarkupSitemapXML, ProcessRedirects, TextformatterVideoEmbed, InputfieldChosenSelect, ProcessWireUpgrade installed. Any idea?
  17. Anyone having troubles with Spex 0.9.9 and Processwire 2.6.10 like addressed here https://processwire.com/talk/topic/8444-modules-crashing-processwire-sites-and-having-other-problems/
  18. Dear Communiy, My template basic-page does have URL segments activated. The segments are used to handle a different URL for the files attached. If a file is not found a Wire404Exception() is thrown. Sadly PagePathHistory does not handle it correctly (in my opinion) and old URLs no longer are redirected to the new ones. wire/modules/PagePathHistory.module:117 /** * Hook called upon 404 from ProcessPageView::pageNotFound * */ public function hookPageNotFound(HookEvent $event) { $page = $event->arguments[0]; // If there is a page object set, then it means the 404 was triggered // by the user not having access to it, or by the $page's template // throwing a 404 exception. In either case, we don't want to do a // redirect if there is a $page since any 404 is intentional there. if($page && $page->id) return; [...] The documentation makes sense here but is the opposite of the desired effect. Only solution for my problem was to disable the if-Statement, is there a better way to do this?
  19. Hi there! I have an odd problem with a processwire installation, have been doing quite a lot of migrations, but this is a new kind of error. My installation is at http://subdomain.name.tld/ any attempt to move to http://subdomain.name.tld/subdirectory/ or to http://othersubdomain.name.tld/ results in a blank page with header error code 500, even with debugging turned on no messages are displayed, notihng is written in errors.txt and on apace access.log I only get 500, not any more info. I'm hosting at Gandi with simple hosting. installed modules include: ProcessWire master 2.5.3 EmailObfuscation 1.0.3 ProcessWireUpgrade 0.0.2 ModulesManager 2.1.6 Spex 0.9.9 ProcessRedirects 1.0.0 Minify 1.0.3 ProcessBatcher 1.0.4 JqueryDataTables 1.9.4 any clue on whare to start analyzing?
  20. Any Info when support for 2.5 is coming? Just tried to update but no luck… i will not write any dumb post, i will not write any dumb post, i will not write any dumb post
  21. Yes for me it makes the most sense to send at template level, looking forward to the solution you will publish
  22. Sorry in advance for "abusing" this thread for my question, but I thought this is the most official thread about Shop-for-ProcessWire I want to develop a mail confirmation for the order placed. This should go to the customer, as well as to the admin of the site. I'm not quite sure what is the best practice for that. I'm using the InvoicePayment, so I could just fork that module, but it seems inconsistent as payment methods may change or be extended. Where would be the best place to put this? Thanks, Julian.
  23. In my timezone UTC+1 (also set in $config) the value of the $page->created field is always one hour early, so a newly created page is already one hour old. How can I correct this? Do I need to add the hour manually, this would be somehow inconvenient and unclean. I need to query last post and see how old they are in comparison to the actual time. Thanks, so long, Julian.
  24. Thanks for your answers! As the auction is only for one month I think I can safely use the pages for what I intended. Will post it in the showcase when it's done
×
×
  • Create New...