Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. I just updated the sheet to 0.3 with hooks from latest dev version. + 22 hooks registered. - added teppo's article to info section links (http://www.flamingruby.com/blog/using-hooks-to-alter-default-behavior-of-processwire/) - added link to ryan's tutorial using hook to add method to PageArray (http://processwire.com/talk/topic/4834-simple-hooks-tutorial-turn-a-pagearray-into-a-list-of-links/)
  2. I pushed an update to 1.2.2, I seem to have forgot to commit earlier. It fixes an issue with the new "selector_level[n]" option introduced previously. It wasn't working quite correctly and after lot of trying I found what was going on which was quite tricky. I'm not sure anyone was using this feature already so it might not make any difference, just wanted to make a note. The additional selector option can be used to define selector for different levels like so: "selector_level1" => "template!=news", "selector_level2" => "id!=1033|1239", ...
  3. Sorry I'm still not sure what you want to archive as everytime it's a little different. I'm a bit lost and can't say anything without knowing exactly and maybe try myself. I like to help you but can't. There seem to be multiple ways to archive what you want. I'm reading your posts again and kinda lost what the current state is. As I showed you could add a selector per page using the find: foreach($pages->find("dont_show=1") as $p) { $p->nav_selector = "parent!=$p->id"; } This should work and I don't know why it does not in your case. But after all I haven't tried so I can't really say 100%. Maybe you can tell me again if I understand correctly: You want to exclude children of a certain parent? Right? What I can say for sure is: "!parent=1034|1015" just isn't a valid selector it would have to be "parent!=1034|1015". But if you do this you can't overwrite it for a certain children to still show, as it will never get to it. Does that make sense? Maybe you can draw me a picture? Edit: corrected typo... oh dear.
  4. Then you haven't studied the HelloWorld.module that comes as example? Hmm... it was the first thing I checked out when starting looking into modules and there's all examples also adding properties and methods. It's what definately blew my mind and made me stay with PW after all Edit: I don't mean to put you down or something was just wondering and I'm glad you found out now!
  5. The answer is relatively simple and there would be different ways but best would be to: In a autoload module (HelloWorld.module) add the hook to ready() where the page being rendered is already set in $this->page So this would only add property to basic-page templates: public function ready(){ if($this->page->template == "basic-page"){ $this->page->addHookProperty('hello', $this, 'helloHook'); } } public function helloHook(HookEvent $event){ $event->return = "Hello World"; } After all I'm not sure this would make a lot of difference to just add it pages globally. But I could see this being useful for certain situations.
  6. In InputfieldWrapper.php around #302 and looks like this if(strlen($showIf)) { if(strpos($inputfield->name, "_repeater") !== false){ $rep = explode("repeater",$inputfield->name); $showif_part = explode("=",$showIf); $showIf = $showif_part[0] . "_repeater{$rep[1]}" . "=" . $showif_part[1]; } $ffAttrs['data-show-if'] = $showIf; $ffAttrs['class'] .= ' ' . $classes['item_show_if']; } I thought maybe Ryan would read this and implement support for repeaters too, but you know how it goes...
  7. @owzim see my post above where I explain this.... http://processwire.com/talk/topic/4189-flexibility-in-page-design/?p=45581 But repeaters don't support field dependencies (yet) I just hacked it into to recognize dependencies and it would work. and here I meant http://processwire.com/talk/topic/4189-flexibility-in-page-design/?p=45565
  8. You didn't knew this?! Where have you been?
  9. Go to the /wire/modules/Process/ProcessTemplate/ProcessTemplate.module #299 and replace the line with $row["{$numPages} "] = "$numPagesLink"; // space is required to make it work and you'll have the number pages count in the template table the search link. The $numPagesLink is already there but not output, maybe Ryan wanted it to add there but forgot.
  10. Ryan has pushed the limit to 350 for now. So you can now again use the master ModulesManager version and set the limit to 350 in the module setting. He also removed the readme text from the feed so this will make the data loaded a lot smaller. Regarding save_mode, this is something that is deprecated in php 5.3 and removed in php 5.4, so not positive to add additional check for it. Thanks
  11. This was in the "header" Title of the template edit screen, but since it is gone now in the new admin theme version...
  12. What I did in the past is to hook on InputfieldForm::render and check for if the form is the add page form. Works fine.
  13. LanguageLocalizedURL module isn't in active development anymore because we now have this functionality in core with LanguageSupportNames which is the way to go now. LanguageLocalizedURL was created because the lack of names per languages and created by mcmorry and me. What I meant is using a page field that uses checkboxes as input to make languages active or not for a page. The input for the page field comes directly from the language pages found in admin (each language is a page). This enables you to turn off also the default language and at a small price. This page field then can be used to not find or show pages which aren't active even the default language. It's just a matter of a few lines of code to show the 404 when a page is accessed that isn't active. I get what you're saying but thelanguage system doesn't work like this and you always have to enter default title and name when creating a page. The way it is built I think it made the most sense for most use cases and it wasn't in from the start. It's a module that came to it and the default language is required because you can install and uninstall it. So there's so many things to consider and pros and cons, no language system is perfect and may not suits your requirements. But PW is enough flexible and customizable to work around it and give waht you need even when you have to enter the default lanugage title and name I think it's a small issue considering that PW gives you in term of multilanguage features. I and my client can live with it as it's not something of a problem that big. I don't now what Ryan thinks and if it makes sense or is even easy possible to implement a "not have default" language require. Maybe it is easy and I'm not seeing it or there's a better workaround, but so far I have to use whats there and try to use it as best as possible. If the project requirements fit, still the most flexible and best way to create multilanguage sites that can differ in structure and not are based on a default language should be built using separate branches for each language and connect them using page references. There was a module in development (Oliver) that would help managing sites like this but I don't know what happend to it as it doesn't seem to be active anymore since a long time. Building it this way enables you to have each language as it's own page and can be much more flexible and practical the way you can build your site and be free from restrictions coming from a language system that assumes things you might don't want.
  14. RT @teppokoivula: My latest blog post is an introduction to hooks and hooking in #ProcessWire: http://t.co/QmYkfYliNM

  15. I bet if you open those images in photoshop the larger image would use more RAM than the smaller. With jpg's the file size can foul you.
  16. You need more memory.
  17. RT @processwire: ProcessWire hooks tutorial by @rc_d – Render any group of pages to links by adding a simple hook function – http://t.co/wb…

  18. Just be nice with PW and it will be nice to you ;
  19. There should be directors cut for websites.

  20. Soma

    Neural captcha cracker

    Funny they have a captcha on their own contact form...
  21. I use additional checkboxes for each language with a page field coming from the language pages. Then check for those in my code for navigation and init.php. works fine but agree that it would be nice feature. Although I don't know if even possible as default title and name are required when creating a page. This is by design of how language support works as its primary build for admin and not frontend where needs can vary allot and there will always be drawbacks and workarounds.
  22. RT @MadeMyDay: That is: Editorial control for Context-aware image sizing if the client wants it. #processwire(just reduced a page from 2,…

  23. Here is the pullrequest https://github.com/ryancramerdesign/ProcessWire/pull/241
  24. I implemented this about a month ag oas I need it too but Ryan hasn't yet taken it into core. Busy times I guess.
×
×
  • Create New...