Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by lloop

  1. Oops I added a message to the callback and when I saw that it sent on the confirm I assumed that it stopped there. Thanks for the fast reply!!! l
  2. I found 'ProcessTemplate::executeRename' but that is called before the rename confirm. 'Pages::saveReady' seems a bit too generic for a template rename. Is there something more like a 'templateRenamed'?
  3. I temporarily fixed it by adding this to wire/modules/Inputfield/InputfieldPage/InputfieldPage.module On line 505, in ___processInputAddPages, I added : // ====================================================== $trimmed_title = trim($title); $languages = wire("languages"); foreach($languages as $lang) { $page->title->setLanguageValue($lang, $trimmed_title); $page->set("status$lang", 1); } // ====================================================== For future reference this is in PW 2.5.2. I attempted to create a temporary module that replaces ___processInputAddPages by using "$event->replace = true;" but replacing the method entirely has issues with the reference to $this. I hate to edit the PW-wire code. If someone can clue me in on how to deal with the $this reference when replacing a method entirely, I would be forever grateful. l
  4. If I enable the addable field (create new) on a page field, and the client works in a non-default language. When the new page is saved, it only has a value in the clients language for the title field. The default language value is blank and shows a date for the title when I see the page in the admin lists from my account which is in english/default. Also the title is treated as blank when traversing an array of pages. Is there some way to either copy a non-default language value into default on a page save ( I actually have a module in development to try to do this but don't have the time at the moment and my module development skills are primitive at best) when the default is blank, or , use another language when the default value is blank? Maybe designate language priorities for usage? tia lloop
  5. Is it possible to use something like "template.data.altFilename=" in a selector? I could write a long selector with all the template names and alot of ORs but it would be nice to not have to edit the selector when I assign the alternate template file to another template. I am using the All In One Minify module to conditionally load scripts and the condition is a PW selector. But I have a pretty good amount of templates with a single alternate template file. TIA lloop
  6. Yeah , for now I will go with the foreach. The question essentially applies to both childTemplates and parentTemplates, no? I was just wondering if it was possible to use the selectors like that.
  7. OK More specifics. I think my main problem is that I am starting from the scenario that only a template is chosen. So if I had a tree that represented a catalog of furniture. With each level of the tree having it's own template. (page_title - template_name) Catalog - catalog Furniture - item_head Chairs - item_subhead Mahogany Chair - item_info Tables - item_subhead Oak Table - item_info Glassware - item_head Vases - item_subhead Bowls - item_subhead Crystal Bowl - item_info Painting and Sculpture - item_head Now if I wanted to generate random pages with the item_info template, I would be looking for an array of pages that have the item_info template as a possible child. So starting from a selected template I am looking for an array of templates that have the possibility of children with my chosen template. The foreach loop works, so for now I am going with that. I threw in a todo to try to directly access the db with a pdo statement eventually. I have to research how to effectively search the json encoding in the data column in the templates table. Not sure if that's good to do with a mysql text search or not. I was thinking at the beginning of this thread that maybe .... because the PW selectors do work with mysql searches (and this is something I am not very strong with, so forgive my ignorance) that maybe it could dip into the json encoded array in the db data column as a selector. And also maybe my tree structure is just fundamentally wrong. and just to add an oops ... my first post asked about parentTemplates when I am actually using childTemplates.
  8. Thanks adrian, If only for confirming that I am not overlooking something simple. Ultimately, it will be installed during site dev only, so a little slow is not so much of a problem. But it's also a big learning experience for me, so I'm also looking for the most solid approach.
  9. I'm writing a module that generates random pages with random content. I have adopted the interface that PW uses for selectable pages in a inputfieldPage edit. That is ... the ability to choose a parent page and/or a template. Down the line I will incorporate the selector and php code inputs. I can't get my brain around a way to find templates that allow another certain template as a child. I would then find the pages and use one as a randomly selected parent page. So the question is ... is it possible to use the template object childTemplates property, somehow in a selector? Being an array, it doesn't seem so. But I'm hoping maybe I'm overlooking something, or approaching it from the wrong angle. Don't really want to foreach through templates or anything like that.
  10. I am writing a module for personal use that generates pages with randomly generated content such as text and images. It's an exercise in module writing as much as it is practical. I am generating the pages specified by a template successfully but, for each page generated, I get several of the green messages in the header. Specifically for repeater fields. It's a bit inconvenient when I generate 50 pages. So, since I'm putting it into a module finally, I thought I would before-hook into Page::render and alter the $notices object. $this->addHookBefore('Page::render', $this, 'suppressMessages'); public function suppressMessages(HookEvent $event) { if($event->object->name !== 'generate-pages') return $event; $new_messages = wire('notices')->not('class=FieldtypeRepeater'); var_dump($new_messages); var_dump($this->wire->notices); // $this->wire()->set('notices', $new_messages); return $event; } The two var_dumps print the same thing which is the a $notices array without the offending messages. But the messages are still showing up in the page header. Is the $notices variable used before Page::render? The commented out '$this->wire()->set' didn't do anything. TIA
  11. Now it works fine except for a page array on the home page in the default language, but not the secondary one. In the clean install, clicking on the "page 2" link produces a URL with two slashes between the address and the last segment (the page 2 segment). Likewise, when it is typed into the address bar. I changed the "should URLS end with a slash?" setting, cleared caches, and tried different names for the languages on the home page (blank, or an entry like "en" and "de" for each). No change. Something to note is that , in the secondary language the two slashes appear but it doesn't seem to interfere with the pagination. In my dev install when I click on the "page 2" link on the home page the URL becomes "page2" only . It removes the root URL. I have a feeling that might have something to do with my settings because I tweaked alot before I moved to the clean install in order to check this and have been using it since. Similarly, when I click the "page 2" link from within the secondary language, it works fine on this install also.
  12. When I have LanguageSupportPageNames and MarkupPagerNav installed together I get only the first set of results returned from a page array. When I type the URL into the address bar with an added "page2" segment, the segment is removed also. The pagination works fine without LanguageSupportPageNames. I tested in a clean install of PW. I'm using the dev version. Possibly I'm doing something silly? If not I would love to help fix this. I realize that LanguageSupportPageNames is in it's early stages. Although I'm admittedly on the newbish side, I do like to jump into the deep end of the pool. As long as the adults are "keeping an eye out". Translate that to "please point me in the right direction".
  13. Thanks Ryan!! The advice was perfect.
  14. but ... in the renderHeader function in the module when I add the actual url to my css file ( without any variables ) and concat it to $out ( so ... no "if($this->css)" ) I still get no css requests showing up in the firebug net tab. Wouldn't, at that point, a failed request be showing up if it was just that the url was wrong?
  15. I did try that . First I tried the "module's configuration options". Then tried it in "$defaultConfigData" in the module, and then tried replacing "$this->css" in the function "renderHeader" in the module. I tried every $config variable that I thought applied and then with the full local url to the style folder. Nothing. It's the first time I have opened up a module and wondering if I'm missing something basic. Thanks again all. Aahh ... but here in Vienna it's been like spring in Greenland ... a rainy Porto is still better to me.
  16. I tried that. I'm on the dev branch. Maybe it's a bug. Thanks for the quick attention. Being stuck is torture. I dream of Porto.
  17. First let me say that PW is like a breath of fresh air. I'm hooked. Maybe a very noob question but, I have copied into the site modules folder and modified this (RSS Feed) module in order to include more fields in the description. That worked like a charm but now I want to add a stylesheet to it. The path never seems to work. Relative, absolute, all types of $config variables and "hard codes". I added it to the $defaultConfigData array and tried editing line 90 to create the '<?xml-stylesheet' element with a hard coded 'href='. Is there maybe something I'm missing ?
  • Create New...