Jump to content

apeisa

Moderators
  • Posts

    4,632
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by apeisa

  1. Shouldn't these two API queries return same pageArray? foreach($pages->get("/")->find("limit=6, template=post, sort=-created") as $post) and... foreach($pages->find("limit=6, template=post, sort=-created") as $post) Now the first one returns only one result, and it's not even latest post, it is (I think) neares result in pagetree. Using 2.1 My intention is not get("/") but get("/some/page/deeper/")->find..., but I think this is easier to debug (if there is an error) this way.
  2. This is nice work, thanks Adam! I like to stay in edit views, but actually prefer "Redirect all breadcrumb links to list?" setting. And it might be that our clients will prefer different setting than I do, so this is great to have.
  3. Ok, this helped a lot. &modal=1 is added by AdminBar (line 280): <?php /** * Hook to take place right before a redirect occurs * * We intercept the redirect URL and modify it to add 'modal=1' to the query string * */ public function sessionRedirect($event) { if(!$this->page || $this->page->template != 'admin') return; if(!$this->input->get->modal) return; $url = $event->arguments(0); if(preg_match('/[?&]modal=/', $url)) return; $url .= (count($this->input->get) ? '&' : '?') . "modal=1"; $event->arguments(0, $url); } If I comment $url .=... line out, then it redirects to admin page, but there is "you are logged in" notification in place. Same happens if I go directly to /processwire/adminbar/ab-sitemap/. But if I go to setup -> templates and set that "adminbar" template manages it's access and set it to go 404 page when there is no access, then I go to 404 page. So this is definitely some kind of access problem. Maybe in page create? <?php // create /adminbar/ page under admin $abPage = new Page(); $abPage->template = $abTemplate; $abPage->parent = $this->pages->get($this->config->adminRootPageID); $abPage->name = $abName; $abPage->status = 1031; // hidden & locked $abPage->save(); // after that create /adminbar/sitemap/ $abSitemapPage = new Page(); $abSitemapPage->template = $abTemplate; $abSitemapPage->parent = $abPage; $abSitemapPage->name = 'ab-sitemap'; $abSitemapPage->status = 1031; return $abSitemapPage->save(); There is no view button on adminbar pages when browsing page tree, but this must be because there is no actual template file (we set that at runtime): <?php // We change the filepath of adminbar template file public function beforePageRender($event) { $page = $event->object; if($page->template == 'adminbar') { $page->template->filename = $this->config->paths->AdminBar . "templates/sitemap.php"; } } And I get this working when I copy /site/modules/AdminBar/templates/sitemap.php to /site/templates/sitemap.php and after that edit template "adminbar" and "advanced" tab, and set it to use sitemap.php template. So this is pretty minor issue, but not sure if I understand where the real problem lies?
  4. I took a look if AdminBar works with upcoming 2.1 release. It does, almost. Only thing that is not working is sitemap, and that is probably because of the changes in access management. It is strange since when you browse admin/adminbar/ and /admin/adminbar/ab-sitemap/ pages through normal admin, there is no "view" link on them. The error I got when trying to view sitemap is: Not Found The requested URL /ot/processwire/&modal=1 was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. But if I change so that adminbar-template manages access and shows 404 error when user has no access, then it actually shows 404 page in modal. I think this is probably something like "trying to use non-Process page inside Admin"? Admin-template seems to be special one, since there is less options on access tab than other templates have. Any clues Ryan where to go with this? Not in hurry with this one, no need to get this working before we have stable 2.1
  5. I couldn't agree with you more. This is actually a query builder, and pretty good one. It reminds me little bit of views in drupal, although this is something you understand right away (and there is no need for anything as massive as views in PW because of powerful and easy templating). So it makes a lot of sense that by default all the options are hidden, and then there is some "refine search" / "advanced search" / "show search options" link. Then there might be (not sure about this) quick links below options (like in my commit) - or maybe we could call them example queries (as a tutorial for user). I started to think about module, where superuser can save quick links for different roles and single users could add quick links for themselves... There is ton of possibilities, but I think this as a core module should stay pretty slim like it is now, and all this fancy stuff should be additional modules? That would be great! Also I think where this core module could improve is that it should use asmSelect in field selectors (you probably have had this one on mind already...)? That would make it easier for everyone to build more advanced search queries.
  6. Thanks for your kind words! Yeah, media queries are very powerful (and easy!) concept. It would be nice, but not very important feature in my opinion. It's not that hard to switch between different templates (renaming folder) and in real life we probably don't change admin templates that often.
  7. It works very well and is super powerful. This is probably also first steps to "another way to browse content in admin"? It actually has all the powers already, but UI is not that user friendly (yet). I just send you a pull request at the github that adds few "quick links" and also hides most advanced options to create simpler interface. Hope you like those additions (screen as an attachment).
  8. Oh boy, this is great! Downloading as we speak!
  9. Yep, that would be the case. Of course depending on your phones browser, if it supports media queries (support is pretty good). I updated the zip, there is little bit cleaner jQuery UI and some other minor polish. I made little design mistake on this: default state is fixed 1300px layout - it should probably be fluid which should fit on every desktop / laptop. But that is quick change to make.
  10. Hmm.. I think I have seen those four images somewhere before..? Looking good (despite the images)!
  11. Forget to say that I have used/tested it only in chrome. It seems to work fine in Firefox 4 and only minor issue in IE9 (you have to change background color of active nav link, forgot there old value and css3 gradient doesn't work there). Also note: I build this for upcoming version P21 (github.com/ryancramerdelsign/p21). This probably work just fine in 2.0 also. If you are wondering why there is extra functionality (like reset password, profile link etc) then those come from the upcoming 2.1 release. That latest updates block is something I put together - not sure if that is useful to use in real life... Thinking about simple "dashboard" module or something like that, where you could add widgets like that...
  12. Still very much work in progress, but thought that this might be something you guys would like to see. Still many rough edges, but I hope you guys try it and give me some feedback. It scales to different resolutions (if your browser supports media queries) - there is basically three modes: Full width (fixed layout for 1300px or over Fluid width for 900-1300px screens Fluid width for under 900px screens Here is the screencast: http://screencast.com/t/lBCfpmhuJDD There are few rough edges, but I myself are pretty happy how this is shaping up. How do you guys think? We will probably start using this admin theme at our company, but as always, open source so if anyone is intrested using this: I would be honored. This could be cleaner package (now it has everything duplicated, no includes or anything like that). But installation is simple: just unzip to /site/templates-admin/ templates-admin2.zip
  13. Can't applaud you enough for this Ryan! Thank you. I had that wrong - rendering form after that second snippet. This wasn't enough tough, since I got some minor issues left. Here is code how I got it working (form rendering & inputfields): This is before any html output: <?php // Get the page you need to edit $somepage = $pages->get('/some/page/'); // Jquery and UI is needed (though you could probably use these outside pw) $modules->get('JqueryCore'); $modules->get('JqueryUI'); $form = $modules->get('InputfieldForm'); // Add fields to the form $fields = $somepage->getInputfields(); $form->append($fields); // Add save button $field = $this->modules->get('InputfieldSubmit'); $field->attr('id+name', 'submit_save'); $field->attr('value', 'Save'); $form->append($field); // Render the form, but don't echo here $form->out = $form->render(); // Not required, but if you want get styles from normal admin... Widgets (images, AsmSelect) works nicely without default styles, so you might wanna get naked here $config->styles->prepend($config->urls->adminTemplates . "styles/main.css"); $config->styles->append($config->urls->adminTemplates . "styles/ui.css"); This code goes between <head>: // Some of the widgets use this data, so you get js errors without this <script type="text/javascript"> <?php $jsConfig = $config->js(); $jsConfig['debug'] = $config->debug; $jsConfig['urls'] = array( 'root' => $config->urls->root, 'admin' => $config->urls->admin, 'modules' => $config->urls->modules, 'core' => $config->urls->core, 'files' => $config->urls->files, 'templates' => $config->urls->templates, 'adminTemplates' => $config->urls->adminTemplates, ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> // And these outputs the .css and .js files for each module <?php foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> <?php foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?> And finally you echo the form where you need it (between your body tags, I assume): <?php echo $form->out; ?> You also might wanna debug this stuff, so set debug true on config.php and this to your template: <?php if($config->debug && $this->user->isSuperuser()) include($config->paths->adminTemplates . "debug.inc"); ?> This just renders the form and all the fancy widgets there is. I didn't get to processing the page, but with Ryan's examples it should be easy and I am looking forward to it.
  14. Ok, this gives me form easily, but it doesn't include any of the required .js or .css files: <?php $form = $this->modules->get('InputfieldForm'); $fields = $somepage->getInputfields(); $form->append($fields); echo $form->render(); I have added these lines to head: <?php foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> <?php foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?> But only thing that gets included are JQueryFancyBox.css & .js, I have images field, AsmSelect etc.
  15. Ryan: any quick tutorial how to use inputfields outside of admin? I am actually building an alternative admin view (so these won't be public forms), but need to keep current admin as it is. I have build few of these with custom forms, but now I would need so many forms that it would be great to use all the great inputfield modules. What I would like to achieve is something where I could just say that "render form for that $page and process it when it is submitted". It would then use all the inputfields that are set to those fields (like AsmSelect, radio etc). And I think sometimes I would need to process forms by myself so that is not requirement. But ability to easily render forms and their input "widgets" is what I need. I tried to figure out how the things work from current admin, but got confused at some point (I am pretty new to oo programming).
  16. There is something interesting discussion about TinyMCE & CKeditor (see the comments also - people from both products taking part): http://www.turnkeylinux.org/blog/tinymce-vs-ckeditor I do like CKeditor more, but it's just a feeling - no real life experience enough to say which is actually better on this situation.
  17. Sorting on API will work without autojoin. This sorting that your quote references is page children sorting (in admin when you edit page -> children (tab) -> sort settings. This means default sort when using admin.
  18. Hi Gena How did you deployed this live in the first place? DB-import & (s)ftp all the files?
  19. Oh, I didn't know about that one (looks great btw). It doesn't show up on my installation either.
  20. You should see it by the name "SelectMultiple". It works for me (just tested on localhost), but I never use this - I think AsmSelect is superior to this.
  21. I tested Ryan's module for this quickly with AdminBar, and there is no problems, works nicely.
  22. True. Also only one folder name need's to change if guest access changes - no moving files around etc (which would be the case if there could be private & public files on one page based on the field settings).
  23. Actually my bug - I did some checks to collapse page picker based on the info if redirect to page is pw page or not, and I assumed $page is always available (I didn't study your code above well enough & too much work on templates). Thanks for the fix (now available from github)!
  24. Sounds like a great solution. It could be setting on filefield (private or public). So usually no need for private, but if you are building intranet or something like that then this is a must.
  25. Great discussion. Little offtopic, but I think this adds to this: are files always public (accessible everyone who knows the url) or is there access control to files also?
×
×
  • Create New...