-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Timezone is in the config.php...
-
I can reproduce, but don't think you have to go save it again... it's more that when you're logged in it works because your admin user has german and when you logout you're as "guest" user looking at frontend. You could make the guest user use german and it should work. What setup have you got here? If you have only german (one frontend language) you could use the "default" as the german and drop language pack there as the default. Then no need to change anything.
-
I love pyramids!
-
If not defined it will take the default. Default is english in PW. If you set something in config.php doesn't make it the default as it doesn't have language context there, anyway it will get overwritten by the PW language functions. You can the locale in the translation file ProcessLanguage.module for the particular language, which makes sense. Thank you for updating it! Yes that should be ok.
-
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
Also wanted to add that.. When hooking after a render method of some class, $event->return returns the markup string that's getting rendered. You then can modify it in some way using string functions. But you actually don't need to do a "return $event->return;" at the end. Simply adding or modifying $event->return will do the magic. $event->return .= "som code"; //or $event->return = str_replace("</body>","<p>Hello</p></body>",$event->return); Hooking before a Page::render will give you chance to get the page object and do modifications, whatever.. but it will not have the markup yet. So $event->return is not of much use there as it will get overwritten. -
I think you understood it maybe wrong. Let's speak some code. foreach($page->children as $child) { if(!$child->viewable) continue; echo "<li><p><a href='{$child->url}'>{$child->title}</a><br /><span class='summary'>{$child->summary}</span></p></li>"; } Just spinning this further with selectors, you could even do a search for all template's that don't have a "view" and exclude them in find()/children(). Eeasiest name the templates "nofile_name". Then use this in navigation find()/children(): $tmpls = $templates->find("name^=nofile_"); foreach($page->children("template!=$tmpls") as $child) { echo "<li><p><a href='{$child->url}'>{$child->title}</a><br /><span class='summary'>{$child->summary}</span></p></li>"; } Just love to think of different ways as PW is so flexible and easy. Edit: also posting your solution, may help others too.
-
Yeah a nice copy of the ProcessWire.com About section...
-
Works perfectly fine here.
-
Which brings me to another issue I spotted. Could someone update the German Language pack and add this locale? And right above the sortable date format is wrong. To be able to sort dates in the admin, they have to be in the order Y/m/d and not d/m/Y. Thanks
-
YOu have to set it in the translation of the language for the LanguageSupport.module $this->_("C"); actually is a translatable string. Work pefect. It's already there but not filled.
-
Thanks, but we found it's the memory was to 32mb, moving up did the trick.
-
Nope. Upload would take 5-10 seconds and it's set to 30. I've set it via htaccess to 3 hours to test. It still does not work.
-
I have a problem with uploading files (not images) to a file upload with ajax. Everything below ~6mb works well, after that it doesn't complete upload. The upload max filesize and post max size is ~30mb. BUt on another hosting I have a PW that have 8mb+ files. So is there any other setting on the server that could limit this? I get this on the response header: HTTP/1.0 500 Internal Server Error Date: Wed, 05 Sep 2012 12:50:10 GMT Server: Apache/2 X-Powered-By: PHP/5.2.4-2ubuntu5.25 Content-Length: 0 Connection: close Content-Type: text/html
-
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
I think apeisa or maybe it was originally from Ryan meant $page->addHookAfter("render", $this, 'myFunc'); Will add a hook to the one $page render method. $this->addHookAfter("Page::render", $this,'myFunc'); Does add a hook to the render to ALL pages (admin, frontend...). So you would want to limit it to the context you want, using either what Page or template or path or whatever. protected function login(HookEvent $event) { ... } HookEvent is the type of the event (it's good pratice to add it) it will make sure the $event argument is of the right type. However what you get with $event depends on what you are hooking actually and how and where. What class and what method. So in this case hook after Page::render, $event->return will hold a string with the html being rendered. $event->object will be the page object that is rendered. In case of Inputfield::render, $event->return would be the string of an inputfield's html that is being rendered (all Inputfields that's gonna render in the admin for example will call render, thus also your hook). $event->object would be the current Inputfield object. There's many more but would go to far to write and list all, actually I don't know them all out of my head. EDIT: Somebody correct me if I'm wrong please -
Improvements to file uploading when file with same name is uploaded
Soma replied to apeisa's topic in Wishlist & Roadmap
+1 This has already come up at least 2 times in the forum. I think it could be nice in places. -
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
Ah there's a hookAfter Page::render!? I think you could be right. This would return the rendered page code with the hook $event. I see you're not using it at all. If a hook like this it should be protected function login(HookEvent $event) { // $event->return would be the html string rendered return $event->return; } You have to try if addHookBefore("Page::render", $this, ... ); would work in that case. Not sure what would be best in your case here. protected function login(HookEvent $event) { // $event->object would be the page object getting rendered $page = $event->object; ...do you stuff... } -
$ $template->filenameExists would be ok. or file_exists($page->template->filename); $page->viewable() does not check if there's a template file, just if the page is viewable by the user rights. If you would remove view access completly for the template it would work. If you use $page->template->filenameExists you already have them loaded, so it would be more efficient to use a selector template!=testimonials if possible, as that won't load those pages in the first place.
-
Or Just use template!=testimonials in the nav code or search to exlude them.
-
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
Have a look at the templates-admin/default.php and notices.inc $notices are the messages set with $this->message(str) and $this->error(str) I think you could use this session flash of PW for throwing messages. -
Although I already played around with it some. BUT I'M STILL AMAZED! Thanks Ryan, some more of these ingenious strokes and PW is taking over world.
-
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
OOOOOps... quite the opposite, quite a beast! Still way to go. I don't think I will install this though. Do you get any errors when using this? Debug mode? Not sure really. My bet would be to try make the login method "public function login()"? -
problem with $this->set('$key', $value); in own methode
Soma replied to Martijn Geerts's topic in Module/Plugin Development
I'm not sure without looking at examples and hard to say if there's maybe alternative or better/right ways. My guess is that the class method is static and can't use $this. Like in the getModuleConfigInputfields(). * That's what $this->message("You message"); and $this->error("Error message"); would be. This will display the messages above the content after the page is being rendered. -
NY for the win! Thanks for sharing.
-
forgot backend password, how do you reset?!
Soma replied to danielholanda's topic in Getting Started
As being said you can set a new password through a script, install the module through the php script or if nothing helps reinstall (of course only if you haven't done anything yet). So no biggy at all if you have access to your files, which I assume you should have. This would be a matter of 1 minute and no need to reinstall. So no need to going mad even if you developed for days on it. The password is something you shouldn't forget, and the forgot password module isn't installed by default for security reasons.- 18 replies