Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Thanks Ryan! About the defaults. How can I get the defaults in the getModuleConfigInputfields function? I wasn't able to access them from there. How is the simplest way to handle it?
  2. You could also create various templates for the sections, and create them as pages underneath your parent/home. The php template would be just the section html markup with some content from the page. <section> <h2><?php echo $page->title; ?></h2> <?php echo $page->body ?> <img src="<?php echo $page->image->size(100,100)->url; ?>"/>; </section> Then in your top page (home) php template you'll be able to render them out simply with something like: foreach($page->children() as $p){ echo $p->render(); // will render the above }
  3. Hey smd, glad it works well for you. I just pushed an update. Fixed border and removed comma after thumbnail.
  4. Here it is a first test version. Got it working with regular image fields, or thumbnail cropimages fields. You can specify any image field using the image field name in the advanced template setting for page label. To output an thumbnail (from the Thumbnail module) just use the dot notation. fieldname.thumbnailname (as specified in the thumbnail field settings) There's some option on this module for controlling the size of image and the container size, padding, colors. https://github.com/s...eListImageLabel Edit: Added support for multiple image fields. It will always take the first image.
  5. Shouldn't a module add a .css or .js named same as the module automaticly? It strikes me again, that I added a ModuleName.css to the module folder assuming it get's added automaticly, but it does not. Not first time I struggle with something that should be simple. Edit: The module is autoload and is extends WireData implements Module. (of course in the admin, not frontend. In case anyone wondering)
  6. Oh, I remember another case where there was a similar behavior. It was when our designer created images saved as png but named as .jpg ... or vice versa. If it's always the same images that fail, make sure the images are really correct.
  7. Well I remember when testing locally and once on a developement server, that uploaded image doesn't resize, but will show up in fullsize after uploading. I couldn't figure out, as it only happened 1-2 times and with only 1-2 images. It might be something else, but it could be that it is the image itself, (CMYK, header bug, compression bug, etc...) fail to resize on the server. If I remember correctly even the image generated had like 0.0.jpg but showed in fullsize in the admin even though thumbnails are checked.
  8. If having this large images, you need lots of php memory to resize them. I experienced similar issue once.
  9. Now I could reproduce it, thanks to Ryan. The trick was to add a file field to the template too. Display thumbnails option doesn't change anything.
  10. I tried on different computers and different browsers and installs. I'm still not able to reproduce this.
  11. I can't reproduce this. Latest PW. Normal image field. Upload 1 or 2 images, no luck.
  12. I think , since I'm the orginator of this, I'll give it a try to make something with a module.
  13. While testing this module with the ProcessPageList rendering a part of the page tree, I recognized a strange behaviour. When I enter the get "open=" (processwire/test/?open=1008) to the url it adds another set of childs (duplicate) but opens the page correctly (the one in the get / which are now doubled too).
  14. Hey rob. What diogo said. You can create a admin page using the "admin" template. It would be placed under the locked "admin" page tree. The admin template has a field "Process". After creating the page you'll see it under tab "content". Now you have to create a process module to serve functionality for the newly created admin page. Once installed it can be selected from the field "Process". I did a quick example that shows such a module, and even how to use the ProcessPageList module of processwire to create a tree. The id set will be the parent page (your Architects) for example. ProcessPageListCustom.module create the module under /site/modules/ and install it. <?php class ProcessPageListCustom extends Process{ public static function getModuleInfo() { return array( 'title' => 'Custom Page List', 'summary' => 'List pages in a hierarchal tree structure', 'version' => 100, 'permission' => 'page-edit' ); } public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); } } You can, of course, use any code to generate a list of pages.
  15. I went into the realms of logins and found it isn't possible like this. It's strange even if I change the core ProcessLogin module ___afterLoginRedirect to somthing else, it does nothing. Seems this like it is never used. Though there a redirect in the module that does the redirect after login and appends an id if one found with get input. So after getting into the logic somehow, I found there's a ProcessHome.module that does only that: redirect to the /page/ when calling /processwire/ login. Though I still don't get it fully, nor do I understand why it is so complicated Ryan? So hooking the ProcessHome.module does work, though if you click the "Admin" breadcrumb it also redirects to the changed page. class LoginRedirect extends Wire implements Module { public static function getModuleInfo() { return array( 'title' => 'After Login Redirect', 'summary' => 'Redirect after login', 'version' => 100, 'autoload' => true, 'permission' => 'page-view' ); } public function init() { $this->addHookBefore('ProcessHome::execute', $this, 'redirect'); } public function redirect($event){ $event->replace = true; // replace hooked function completely if($this->user->hasRole('editor')){ $this->session->redirect($this->pages->get(1186)->url); } else { $this->session->redirect("page/"); } } }
  16. Sorry I meant #306. It has to be like this: public function ___getPageLabel(Page $page) { $value = ''; // if the page's template specifies a pageLabelField, use that $pageLabelField = trim($page->template->pageLabelField); // otherwise use the one specified with this instance if(!strlen($pageLabelField)) $pageLabelField = $this->pageLabelField; // convert to array if(strpos($pageLabelField, ' ')) $fields = explode(' ', $pageLabelField); else $fields = array($pageLabelField); foreach($fields as $field) { if(strpos($field, ".")) { list($field, $subfield) = explode(".", $field); } else $subfield = ''; if($field == 'image') $v = '<img style="display:inline;" src="'.$page->image->size(0,30)->url.'"/>'; else $v = $page->get($field); //$v = $page->get($field); if($subfield && is_object($v)) { if($v instanceof WireArray && count($v)) $v = $v->first(); $v = $v->get($subfield); } else if(($field == 'created' || $field == 'modified') && ctype_digit("$v")) { $v = date($this->fuel('config')->dateFormat, (int) $v); } if($v) $value .= ($value ? ', ' : '') . "$v"; } if(!strlen($value)) $value = $page->get("name"); $value = strip_tags($value); $value = htmlspecialchars($value, ENT_QUOTES, "UTF-8", false); return $value; } Yes, I wonder what Ryan thinks
  17. I think you can hook with a module the "___afterLoginRedirect" in the ProcessLogin.module. Haven't tried but it should be possible.
  18. You see the code in my first post. It's around #360 in ProcessPageList.module.
  19. When I add "span[style|title]" in the valid_elements of the fields tinymce advanced settings it works.
  20. hey smd There's no plans currently. I even don't know if it would be possible by a module to add this feature to the page list tree.
  21. Ryan, yeah codemagic has some hard reference that makes it impossible to put it outside :/. Thought there's not much translation that we could add. I don't know if there might be other third party plugin that does the same. Regarding the "bramus_cssextras", I would like to have that being able to integrate it without touching the core every update, and I use it in many installations meanwhile. - Either add it to the core like codemagic plugin. - or adding my version here from this test version, by adding another config textarea "third plugins". ( I added the module and the js code) Let me know what you need.
  22. This had been brought up somewhere but can't find it anymore. Ok, here it goes. When I make two fields (body,sidebar) like 60% - 30% at the end of the template, so they're floated. All works well, the following save button stays in position, so the float is cleared. BUT when I add a field tab right after the floated fields it breaks the clear float, the save button get into the float of the two fields. When I remove the tab right after the two fields it works fine again.
  23. I just found what I think caught me once and it seems to be only happen in Chrome. When you open a template in admin, then leave the edit screen and go to a different page. Now when I hit "back" in browser, the fields attached to the template are changing, it add various fields like email* randomly. I once didn't really recognize and hit save too fast. Then I couldn't remove one of the fields because it was a system "non-deletable" field. I mentioned it somewhere in a thread but couldn't really see what was causing it.
  24. That would be cool to have a "core" package as a default package containing all the files. When dealing with it, I thought it would be great to have an overview (list) of all the files that can be translated. What about a git repository?
  25. Great to have this. Thanks guys. Just to verify, it will "group" and sort by template name? So the problem of having a specific order would only be able with naming the templates according 01-tplx, 02-tply, 03-tplz? Since templates can also have labels this won't be much of a problem I guess.
×
×
  • Create New...