Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Have you been able to look at this again? My experience is somehow outdated of these both, haven't used FCK fo a long time. I'm asking also because clients tend to be on IE 80% of the time (it's a shame) and definately would be great to may have an alternative if TinyMCE is that buggy on IE.
  2. Thanks Ryan. It's in all IE and not sure whats causing, definately not cache... http://www.peterbe.com/plog/button-tag-in-IE I think its beacuse its twice, or a button and not an input... If you read this Link... Its first post is from 2005, last from 2011. And yet MS has done nothing to fix it. :/ EDIT: Strange thing is when saving with top button, it reloads page and says "Session: Changed Title" ... but it's not saved. I think easiest would be to just leave out top button on IE, until we fixed it. It's not very nice, since it will lose content entered... EDIT: I've temporarely put a if(!$.browser.msie){ ... } in the templates-admin main.js around the top button duplication on line 21. So nothing can happen, and IE won't have that button on top.
  3. Just had a message from a client. They found teh top save button doesn't work. I tested in IE since they use IE. And it does not save content, although the page reloads normal like when saving.. but no change/save message. It works when using bottom save button.
  4. I'm not sure about your code, it wouldn't work for me... Right approach would be $news = $pages->get('/news/')->find('sort=-created, limit=6'); or $news = $pages->get('/news/')->children('sort=-created, limit=6');
  5. That would be great if you try to implement this. I'm happy if it could help out with this issue.
  6. Awesome Ryan. Now it's working fine! ;D
  7. After desperately searching for what the problem is, I resign as I don't know the core system that well let alone understand it all yet. But found that it works well if you don't try to do any of these -> wire("pages")->get()... wire("templates")->get(...); after template and pages are created saved, and just use the objects you create. So removing the last listPages, the script works. So the listPages at the end also does not work cause it iterates through wire pages array, and somehow it doesn't work cause there is no template-/page id found. But I'm sure Ryan will find the problem and may able to solve it.
  8. Already tried uncacheAll, but doesn't help. wire("templates")->get("mytemplate"); returns NULL after template is saved. Parent page gets created. But... wire("pages")->get("/holding-page/"); returns WireDB mysql error after parent page is saved. So the page and template is saved and there, but not really somehow to continue creating sub pages. 1136 is the parent page id.
  9. here the code: <?php include('index.php'); print '<body style="font-family: Verdana; font-size:12px">'; function listPage($page, $level = 0) { echo str_repeat(" ", $level) . $page->title . "\n"; foreach ($page->children as $child) listPage($child, $level + 1); } function listPages() { print "<pre>"; listPage(wire('pages')->get("/")); // start at homepage print "</pre>"; } listPages(); $tmpl = wire('templates')->get('mytemplate'); if (is_null($tmpl)) { $fieldgroup = new Fieldgroup(); $fieldgroup->name = "mytemplate"; $fieldgroup->add("title"); // add some fields $fieldgroup->add("body"); $fieldgroup->save(); $tmpl = new Template(); $tmpl->name = 'mytemplate'; $tmpl->fieldgroup = $fieldgroup; $tmpl->save(); print "template created: " . $tmpl . "\n"; } $parent = wire('pages')->get('/holding-page'); if ($parent instanceof NullPage) { // Create a new Parent page $parent = new Page(); $parent->template = $tmpl; $parent->name = 'holding-page'; $parent->title = 'Holding Page'; $parent->body = 'This is a parent holding page'; $parent->parent = wire('pages')->get('/'); $parent->save(); print "Created 'Holding Page'<br>"; // If the following line is enabled then execution fails here // Reloading the page that has just been created therefore doesn't work //$parent = wire('pages')->get("name=holding-page"); } $data = array( array('testpage', 'This is test page'), array('testpage', 'This is test page (duplicate of first one)'), array('testpagea', 'This is test page A'), array('testpageb', 'This is test page B'), ); foreach ($data as $d) { $page = new Page(); $page->template = $tmpl; $page->parent = $parent; $page->name = $d[0]; $page->title = $d[0]; $page->body = $d[1]; try { print "Saving {$page->name}<br>"; $page->save(); } catch (Exception $e) { $n = 0; $pageName = $page->name; do { $testName = $pageName . "-" . (++$n); print "Checking for {$testName}<br>"; $test = $parent->child("name=$testName, include=all"); } while ($test->id); $page->name = $testName; $page->save(); print "Successful: {$testName}<br>"; } print "(parent now has {$parent->numChildren} children)<br><br>"; $page = null; } listPages(); print "</body>"; I was kinda wrong before. The "holding-page" creation is done, but it's not callable with using wire('pages'), thus subpage creation fails. I will test Ryan suggestion...
  10. Problem is it fails creating the parent page because the template newly created isn't accessible through wire (so error is shown "Invalid value..." first time running the script). So page creation fails. After that, the template is already there, and thus works.
  11. just tested it on my local testversion. I experience the same effect with lates commit. It seems the template isn't applicable. It's possible to output name and fieldgroup "$template->name" ... but a wire("templates")->get("mytemplate") seems to return NULL. Don't know what's happening and how to fix this right now. Ryan would certainly now.
  12. There's no radio field type. You can choose radio boxes as an inputfield for page reference field. If you create pages as categories for example you can make them selectable, and use a select or radiobox,checkbox as inputfield type. There's actually a "select (aka drop down)" custom fieldtype by hani see "download section" or here direct link: http://processwire.com/talk/index.php/topic,245.0.html it creates select list from a string like "1:=Poor, 2:=Excellent" . It would be easy to create a custom radio field that does the same. Depending on what you want to archive, it could make sense to do it with the page reference field as it will give you great additional posibilities.
  13. Ryan is right. Here's a little module I'm using. I will maybe consider make it official module, but then I would like to have it with some configuration and this would take some time to consider. You would need to add a page reference field with inputfield asmselect or multiple select and add it to the user template (use filter at top of template overview page to show system templates). In this case it called "editable_pages". Following code does recursive check for editable pages. This works with adminbar in frontend too. If you like only 1 page you could also check only for those explicit. Have fun <?php /* * Page access control on user level * Allows to add pages on to user page to restrict editable workspaces * */ class AccessPageEdit extends WireData implements Module, ConfigurableModule{ public static function getModuleInfo() { return array( 'title' => 'Access Control Page Edit', 'summary' => 'Control who can edit what page. Create "editable_pages" page field (asmSelect) and add it to user template. Select pages to allow edit and add access.', 'version' => 001, 'permanent' => false, 'autoload' => true, 'singular' => true, ); } public function init() { if($this->user->hasRole("editor")) $this->addHookAfter("Page::editable", $this, 'checkpermission'); if($this->user->hasRole("editor")) $this->addHookAfter("Page::addable", $this, 'checkpermission'); } public function checkpermission(HookEvent $event) { // if it was already determined they don't have access, then abort if(!$event->return) return; $page = $event->object; $parents = $page->parents; // run check for parent pages and allow recursive inherit access foreach($parents as $p){ if($this->user->editable_pages->has($p)) return true; } // then run check on selected single pages if(!$this->user->editable_pages->has($page)) $event->return = false; } }
  14. Well I'm already used to it, but now it works without doing something... tested again in FF and it works now. Oh well. Thanks Ryan for the suggestions, I implemented your suggestions. And have adjusted the config times to be both in seconds. I commited the new version to github. Thanks!
  15. Thanks a lot Ryan, this would have taken me ages to find out! Lovely It works now again. Only problem I noticed now in Firefox it doesn't seem to work at all, my module. Even with the fix. I got tested now with all except FF, I got latest. Anyone experience the same? Stupid me, I logged in with same user... But still I think the pining window.setInterval doesn't work in my FF. Will test now some more. EDIT: There's something strange going on in FF, no errors and it doesn't seem to work at all... Confused...
  16. I have installed it on some projects and now I noticed a problem with the file upload. It doesn't update upload status and doesn't finish it, but after refresh the image is uploaded. I'm sure it has to do with this module, but not sure what's causing it. Any suggestions appreciated! Thanks
  17. Nice consideration. Not sure how easy this all would be. Sure a big task to build something up. Of course it would help people migrating and this can be a plus on the feature list. Not sure about what version I would go for. Are you planning on doing this, or do you want someone to do it? Either of the two ways would be possible and wouldn't require much work on PW side. Though I'm not sure what is planned by Ryan in this area. I'm sure he will make the CSV importer much more clever and versatile. Maybe there could be some collaboration taking place. Since I barely used WordPress and the other system (don't like them at all) I can't really help on this, as I will also spend my spare time on other helpful modules.
  18. Nice sites thanks for sharing. 8) I didn't notice any slow downs. Both are fast. I'm located in switzerland.
  19. Thanks apeisa. Just released first version. See first post for link and infos.
  20. Amamzing stuff, can't wait when I got time to try this out! Thanks apeisa for sharing this!
  21. Hi and welcome Steve! I'm busy but will give short answer: Offices would be pages too that's separate in a branch so you can edit them within PW admin, or alternatively you could using search in admin or create a bootstrap php somwhere outside and build a data table for easy finding and editing and use the excellent PW API, you're not bound to use PW admin. In your "skyscraper" template you would have a page reference field to select one or multiple offices. You could also create them all using simple script through API. Finally you can build all sort of lists and searches whether from offices view or skyscapers using the powerful selectors. You can easily relate them using the page reference field. The setup can vary to your needs. So you can also use PW only for presentation and connect it easily with your master application. See bootstraping. This enables you to build an easy maintain script synching or whatever using the excellent PW API. Finally PW supports urls segments up to 4 or more (not sure atm) if this is what you mean. It has to be enabled on PW template setup. After you can use segments to give it to the php template. So kinda yes, yes, and yes Have fun!
  22. PageEditSoftLock ProcessWire2+ Module There was a request for a page lock feature in PW2.1 for pages being edited by an other user already, it would lock or throw a message of along the line of: "This page is currently being edited by "username'." Thanks to Ryan for helping getting this done quickly! Download: https://github.com/s...ageEditSoftLock How it works Only the module "PageEditSoftLock" needs to be installed/uninstalled, the "ProcessPageEditSoftLock" Module will install/uninstall itself. The module creates a table and a hidden admin page under /page/edit/ for pinging in the background while editing a page. You can configure the ping interval and expiration timeout to what you think is good. Defaults - 20 seconds for pinging, - 60 seconds for expiration time (all entries in the table older than this will get deleted). ---- 27-02-2012 update https://github.com/s...1f204bc1b6c740a Fix for new repeater field throwing the lock message because of the way repeater work and this module. Thanks to Ryan for finding a quick fix.
  23. Hi sev and welcome! You could do the following and strip the last char from the string after the loop. <?php // if there's any images if(count($page->images)){ $out = ''; foreach($page->images as $image) { $large = $image->size(1200, 795); $out .= "{$large->url},"; } echo substr($out, 0, -1); }
  24. No problem Nico!
  25. Hi Nico This has been discussed several time already. Please try to use search before posting. I know I have to remind myself too everytime I'm in a rush to post something...
×
×
  • Create New...