Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. I can't reproduce this. Latest PW. Normal image field. Upload 1 or 2 images, no luck.
  2. I think , since I'm the orginator of this, I'll give it a try to make something with a module.
  3. 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).
  4. 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.
  5. 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/"); } } }
  6. 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
  7. I think you can hook with a module the "___afterLoginRedirect" in the ProcessLogin.module. Haven't tried but it should be possible.
  8. You see the code in my first post. It's around #360 in ProcessPageList.module.
  9. When I add "span[style|title]" in the valid_elements of the fields tinymce advanced settings it works.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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?
  15. 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.
  16. If you would show us some code, we would be able to help much easier.
  17. it does only show up in top navigation when on the forum pages.
  18. charliez, do you mean the board? Here? http://processwire.com/talk/forum/15-processwire-language-packs/
  19. It's hard to tell from here. There's a request being made but no data returned in the response? I think you need to make sure the fiel(cols) you make sortable can really be sorted using PW fields. Also it can be really hard to find problems, since only 1 little thing wrong and the whole breaks. What I did often was to output some debug info in getdata function (print_r or echo vars). If you inspect the returned data by the ajax request, you'll be able to see it or spot errors. One thing there's still left in the code (commented) is echo $selector; exit(); This will let you see the PW selector generated, make sure it is correct.
  20. I don't know if you know that variables/namings in php can't contain a dash "-". So also this is true to a field name in PW. So things like: $page->my-repeater-area doesn't work. I'm sure you know it, but typed it wrong in your post.
  21. Hmm, make sure everything is loaded. And check if there's any js error's or any ajax request's being made. Or try to put alert("hello"); at certain points in the /DataTable/DataTable.js to see if it gets there. If you can't figure it out send me your files and I'll work it out.
  22. I assume that my module is working out of the box? Just to make sure.
  23. Are you trying to use it on frontend or is it still in the admin?
  24. The DataTable.js contains the initialize script. There's an option "sAjaxSource": "getdata", which defines the ajax url. This is called automaticly by DataTable plugin when page is loaded. But I can't see why it wouldn't work, even if you renamed the module it should still work. It just calls "/page-you-are-on/getdata". I wonder if you're using this on frontend or in admin? Edit: Or have you renamed the table class? It is initialized in DataTable.js using var datatable = $('.dataTable').dataTable({ ...}); So if you renamed the class on the empty table output you need to rename it here too.
  25. You can try something like this: $parents = $page->parents->slice(2); foreach($parents as $parent) { echo "<li><a href='{$parent->url}'>{$parent->title}</a>"; // only output ">" if not the last entry echo $parent->id != $parents->last()->id ? " > " : ""; echo "</li>"; }
×
×
  • Create New...