Jump to content

MichaMichaMicha

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by MichaMichaMicha

  1. Well, i'm using PageFrontEdit to edit repeater fields, so that might also have to do with it. Doing something like this: <div edit="{$block->id}.body,block_type" id="text-{$block->id}" class="prose"> {$block->body|noescape}</div> </div>
  2. Doesn't seem like the changes made using PageFrontEdit are tracked. Is there a chance this can be added?
  3. I have stored a lot of users with their birthdate. Now I'm trying to find the birthdays for the next 7 days but without succes. Already tried things like: template=user,birthdate$=02-26 but without success. It can be done with a raw MySQL-query, but I would like to prevent anything like that. One thing that I've thought of was imploding the current day for the last 100 years, (birthdate=2016-09-26|2015-09-26|2014-09-26,etc) but that would result in a 1100 chars long selector.... Anyone has an idea?
  4. Have not checked out the module yet, but seems like a very nice addition. The JSON+LD Schema is really something Google will be using a lot in the future. Mark my words!
  5. Thanks. However I would like the editor to achieve something like: <p>Lorem</p> <div class='gallery'> <img src='1.jpg' /> <img src='2.jpg' /> <img src='3.jpg' /> </div> <p>Lorem ipsum</p> <div class='gallery'> <img src='4.jpg' /> <img src='5.jpg' /> <img src='6.jpg' /> </div> <p>Lorem ipsum dolor sit</p> Also I would like to prevent the editor to make use of hannacode because it's not that user friendly. Anyone got another suggestion?
  6. I have a content field (CKeditor) where I want the editor to be able to insert galleries with photo's anywhere in the content. Like the image insert functionality already present but with the option to add multiple images and have them transform into a gallery using Javascript. The javascript is not an issue but I'm not sure how to get the images nicely in the CKeditor field. I kind of like the solution Wordpress has for galleries... Any module like that available for Processwire?
  7. Agreed, but I guess PW has never had this many tweets about it as in the last two hours: https://twitter.com/search?f=tweets&vertical=default&q=processwire
  8. Not sure if it's been posted yet, but there is an article on: http://code.tutsplus.com/articles/introduction-to-processwire--cms-22624
  9. Thanks. I ended up just manually constructing the needed url in the template. Wasn't used as much as I thought so it beats the performance impact the Hook would have.
  10. Hmm, sorry. That doesn't work. This still returns the User. To be clear: I'm echoing $someUser->url on a 'normal' page/template. I want the hook to return the url from the 'normal' page appended with the name field for the user. I'm using urlSegments on the 'normal' template to receive the users name. There are multiple 'normal' pages that can have the same user as a urlSegment (having them in a Page selecting field on the 'normal' template) These are the some example values that I would like to return in the hook. /just-a-page/john-doe/ (when the calling Page is "just-a-page") /just-a-page/jane-doe/ (when the calling Page is "just-a-page") /another-page/jane-doe/ (when the calling Page is "another-page") /yet-another-page/lorem-subpage/john-doe/ (when the calling Page is "yet-another-page/lorem-subpage/") Of course I could just use this in my 'normal' template: echo $page->url.$theUser->name; but I'm always trying to learn, so would like to use the Hook
  11. I'm trying to modify the property 'path' for a specific Page (User, actually) using the following code: $this->addHookAfter("Page::path",$this,"modifyUserPagePath"); AND public function modifyUserPagePath(HookEvent $event){ $p = $event->object; if($p->template == "user" && $p->hasRole("ambassador")){ die("MODIFY THE PATH HERE WITH PREFIX FOR THE CURRENT VIEWING PAGE"); } } But i'm not able to retrieve the page that is currently running (as in, the page in the browser url). Please note I'm also using the render() method to render subpages content. I don't need the subpages url but only the original $page requested. Is there a pretty way to do this (besides looking it up via $_SERVER['REQUEST_URI'] )?
  12. Pretty old topic, maybe you figured it out already, but: You always need a wrapping class row when you use columns. You code should be: <div class='row'> <div class='medium-3 columns'> <div class='row'> <div class='small-12 columns'>content</div> <div class='small-12 columns'>content</div> <div class='small-12 columns'>content</div> </div> </div> </div>
  13. Finally got a workaround for this. Simply added $this->pages->uncache($repeaterParent); after https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module#L556 When debugging is on in config.php you see the message twice: Session: Created Repeater Page Parent: /admin/repeaters/for-field-140/for-page-24397/ Not the prettiest solution but at least the client can add pages again.
  14. Works, and the following code should set the label in different languages (in combination with the code kongondo posted). $english = $languages->get("english")->id; $f->set("label{$english}","Date");
  15. I've stumbled upon a weird issue with repeaters. I've created a repeaterfield with only a title field and assigned it to a template. When I create the first page everything goes well, but then when I'm creating additional pages I'm getting this error: ProcessPageAdd: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'for-page-23947-23799' for key 'name_parent_id' I'm not getting redirected (probably because of the error, but the page does get created with the RepeaterField correctly). The problem seems to exist in the file FieldtypeRepeater.module in the function 'getRepeaterPageParent'. I've modified the file to see what actually happens and it looks like the function doesn't find the required page of saves the page correctly. protected function getRepeaterPageParent(Page $page, Field $field) { $repeaterParent = $this->getRepeaterParent($field); $parent = $repeaterParent->child('name=' . self::repeaterPageNamePrefix . $page->id . ', include=all'); $this->message("L".__LINE__." | selectorresult: ".$parent->id); if($parent->id) return $parent; $parent = new Page(); $parent->template = $repeaterParent->template; $this->message("L".__LINE__." | template: ".$repeaterParent->template); $this->message("L".__LINE__." | parent: ".$repeaterParent->path); $parent->parent = $repeaterParent->id; $parent->name = self::repeaterPageNamePrefix . $page->id; $parent->title = $page->name; $parent->addStatus(Page::statusSystem); // exit early if a field is in the process of being deleted // so that a repeater page parent doesn't get automatically re-created if($this->deletePageField === $field->parent_id){ return $parent; } $parent->save(); $this->message("L".__LINE__." | looking for: ".self::repeaterPageNamePrefix . $page->id); $this->message("L".__LINE__." | current for: ".$parent->name); $this->message("L".__LINE__." | Created Repeater Page Parent: NAME={$parent->name} a " . $parent->path, Notice::debug); return $parent; } See the attachment for the output. IMO the second time FieldtypeRepeater: L574 | should output the previously created page... Anyone has an idea what's going wrong? I'm on the latest master branch.
  16. Thanks. Have not had the time to check it, but it already looks good! Edit: Ryan quickly fixing things? https://github.com/ryancramerdesign/ProcessWire/commit/705de9e44ca76c03b1a1b0f5d39f7ef6b665cba8
  17. I've really tried my best but seems like I'm not able to change a fields description text in context of a template via the api. $template->fieldgroup->title->description = "This should be the description"; $template->fieldgroup->title->save(); $template->fieldgroup->save(); Anybody having the same problem? Note: if that works I also want to change the description in different languages, but that should not be a problem.
  18. Well, that's weird. The issue I had was definitely not a css issue.
  19. Seems like you need Edit permissions on the 'user' template. Kind of weird since you can already edit a user when it has user edit permissions. Ryan?
  20. For some reason when a non-superuser has access to modify users it does not show the Content and Delete buttons (tabs) when editing a user. Is this intended? And what would be the easiest way to re-enable this? Thanks
  21. I've a site with different sections. Each user is assigned to a section and each section has an editor. I want those editors to be able to modify the users that are assigned to their section. I tried hooking into ProcessUser::execute but I'm not sure how to filter the 'pages'. $this->addHookBefore('ProcessUser::execute', $this, 'modifyuserpagelist'); In what way am I able to modify the User List?
  22. First the structure (offtopic, Structure reminds me of EE ) Home -Company Page --Section (template: container) ---Child page 1 (template: content) ---Child page 2 (template: content) ---etc. I have editors that can add pages to template container, but not edit the page. Problem is that they can not sort the child pages (template:content) by default. Solved it by adding a 'move-children' role that has move-pages and sort-pages permissions. The problem lies in setting that role and permissions to the template 'container'. You cannot select the 'Create Pages' checkbox for role 'move-children' unless you also give the 'move-children' role the 'edit-page' permission. (It's disabled) (I'm not sure if I'm using the correct terms...) Eventually I solved it by setting the 'edit-pages' permission to the 'move-children' role, checking all the boxes for the template access, and then removing the 'edit-pages' permission. I don't know if this is the intented behaviour but I thought I'd share it with you to see what you've experienced. Thanks
  23. Hi Peter, I tested the minifier on two sites using IE8, but both of them were showing the styles. I used Unsemantic Site Profile for Processwire and the default PW Profile. My IE8 version is 8.0.6001.18702 If you've got a minute to spare, can you check the default PW profile with the minifer using your version of IE8. What version do you use? If anyone else already knows what's wrong, please let me know. Thanks.
  24. I'm sorry, it indeed has been reported a while ago. Let me take a look later this day.
×
×
  • Create New...