Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Why is there no women composer?
  2. I'm not sure. It's strange indeed. I tested a little and it seems if the user is "guest" (not logged in) it fails to get the persmission check, but ONLY if checked in the hook function. In the init function the check works. Could be a bug. However I recommend to do a $user->isLoggedin() check to see if user is logged in at all first, and also user $page->editable(); to determine if user has edit right on the requested page. Also my suggestion is to use the logged in check in the init, so the hook doesn't get executed on guest users int he first place. Right now this hook is executed on every request. So it would look like this: ... public function init() { if($this->user->isLoggedin()){ $this->addHookAfter('Page::loaded', $this, 'changeView'); } } public function changeView($event){ $page = $event->object; if("admin" == $page->template) return; if(!$page->editable()) return; $view = $this->input->get->view; ...
  3. Hey nice start! Thanks for posting. I see where you're going with this, and maybe it can be of use for people. Some feedback: You extend class "Process" here, and I'm not sure that's the right one in this case. Process modules are meant for admin pages that are associated with a page in the admin like the page tree or editor. You assign it to it if you create a new page with the template "admin". The execute method is then the default process that's called when you look at the admin page you created. Process modules are usually also not autoloaded because of that reason. I know it works, but it's not meant to be used for hooks and such, as far as I know. Not sure this is intended but maybe it makes sense for some other module you will want to create in correlation to this. So you'd extend Wire or WireData. See the wiki artikel by Ryan about modules, that will tell you a lot! http://wiki.processwire.com/index.php/Module_Creation I'm not sure but I thought you'd have to use addHookAfter to make it work, not sure what addHook really does... not sure on that one atm. Some syntax you used is a bit strange and to make it short ("fuel") isn't official, and kinda old. It still appears in the core and modules and is a relict. The right and simple way to use API in modules is using $this->pages or wire("pages"). As for the module, I copied and cleaned it up a bit (removed comments for better overview), that will maybe help you out some to see how someone experience would do it. You see some that could help not executing the hook at all if you do some checks in the init() already. You can already check if a GET var is set or permission are correct. That's all for now, I'll let you figure the rest <?php class Views extends Wire implements Module{ public static function getModuleInfo() { return array( 'title' => 'Views', 'version' => 90, 'summary' => 'Add the selection of the view of a specific page', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { if(!$this->user->hasPermission('page-edit')) return; //if($this->input->get->view){ $this->addHookAfter('Page::loaded', $this, 'changeView'); //} } public function changeView($event){ $page = $event->object; if("admin" == $page->template) return; $view = $this->input->get->view; $view = $view ? $this->sanitizer->name($view) : $page->view; if($view): $tname = $page->template->name; $page->template->filename = str_replace($tname, $view . "-" . $tname, $page->template->filename); endif; } }
  4. I somehow wanted to write about the documentation part but left it out in hope it will come up naturally. Thanks for bringing this up again Joss! Exactly sums up what I think about the subject. A software raises and falls with its documentation and support (and some other factors as well). There's a good bit documentation Ryan put together. For people like me it's enough to get started quickly and hardly have to ask questions. This seems not true to most of the audience that ProcessWire seems to attract now which are more design orientated never had to code PHP until now. I'm almost surprised that it really is a good main audience. Though one could arque there's a lot of advanced technical user that haven't even joined the forum yet, but use to search for answers or figure them out them self. Reflecting back the year and a half on this forum, it showed clearly where people are having problems understand the basic principals, and although there's already some documentation there, they don't seem to find it as they don't know how to look for. I always feel a little bad to see so many good threads and QA are hidden in this forum that are hard to find (though with google it is possible) and most of them should be just collected, prepared and put into a place where it can be sorted and searched and listed in a easy way. There's TONS of snippets and code examples! Some are really great information you can't find elsewhere in documentation. I would have started any day building something and only the fact it would take a lot of time is why I haven't started yet. And I'm surprised nobody has yet started something more serious apart from the wiki (which obviously involves some problems). So and you guys tell me you have something on your own! Damnit, then why wait and not make it a movement people who are willing to help and dedicate some free time to the project. I don't think making it wiki style for writing for everyone is a good idea, but make it with a small group of people who have access. ProcessWire can be used to build something easily! But I see it just takes time and the right people to join to get this rolling. I'm happy to see that there's people like Joss understanding this fact and take initiative without even asking them! Thanks to all who decide to help and join the lonely nut to make him the leader.
  5. I noticed on some installs I sometimes get this a lot: Unknown User:/?/:ProcessWire Error:Exception: (in /home/aoccons/www/aoc/wire/core/Database.php line 72) , and have no idea what is causing it. Since it's not happening on other hosts I guess it has to do with the server and mysql. It simply can't connect. I remember this has come up in the forums some, and I thought it has nothing to do with PW so I don't know if it's possible to do what you suggest.
  6. I'm not sure what you mean by "does it now exist?". This Profile Exporter module exists since a long time. People are using to export a basic setup, this start with that on a new project. Some people are building a shop site profile and so on. Ryan has for example done a great Blog profile ready to install and use.
  7. Thanks a lot for sharing this neildaemond! Great resource indeed this plugin. Now only accessibility could be improved and with some jquery validate this is great.
  8. Maybe also want to read this thread about uploading images via front end form.
  9. I want to say thanks to all people in the forums for being here and make this place so special and a great place to be. There's some spirit and drive going, I think many other CMS forums can only dream of. It's still small and the quality of people and their support to help in the forums always amazes me. Even newcomers help other newcomers in a manner it's quite unique I think. Not saying there's might other places that are the same, but I don't know of any. Thanks for the nice experience to all of you! Then the biggest thanks would go to Ryan our "Man on the Wire", always sharp and considered helpful, with brilliant ideas and execution. You build something very special here and while maybe some think it's not "sexy" enough, they don't know what's under the hood. I think people are really excited to get direct responses from you and this is what makes them feel at home, which ignited some friendly fire and spread all over the place. Quo vadis? This is for now and I really wonder how it will be when the forums grows to a place, where I hardly will be able to catch up with new posts. Every other day I wonder how long Ryan will still be able to do so for every question in the forum. Don't know how you do it but you do. So then where will ProcessWire be in a couple years from now? How far will this forum grow? Will there be lot's of PW sites spreading across the web and sharing places as with other big CMS'? Hardly think about it but I think it could very well happen. What could the PW web be? How many modules will there be and quantity > quality... While at it, Clouds! I can't hear stand it anymore, STILL we have moving clouds in the new ProcessWire website!!! Hope people don't think we go PW Cloud? Also I would love a horde of crazy new core php developers that help making crazy new stuff with this CMS/CMF. No I'm not drunk but after that post I'm wired. Keep it up, stay healthy and spread the word "ProcessWire". Peace. ( Ahhh, I reached 2000 posts and I didn't even notice yet! Well never used to post that much in a forum ever. Well mostly just BS nobody wants to hear heh )
  10. What error? I tested it and works fine. This is in upload class: public function setMaxFileSize($bytes) { $this->maxFileSize = (int) $bytes; return $this; }
  11. Not sure what you're about. But this should give a select menu dropdown $treeMenu = $modules->get("MarkupSimpleNavigation"); echo $treeMenu->render( array( 'collapsed' => true, 'max_levels' => 1, 'outer_tpl' => "<select>||</select>", 'list_tpl' => "||", 'item_tpl' => "<option value='{url}'>{title}</option>" ) );
  12. Some common problem I think is that people forget to enable urlSegments on the gateway templates /en/ /it/. Only thing I can think for now.
  13. moreweb, I don't know since I don't see how you set everything up. And without specific errors or more details what doesn't work I can't help. I can't do much with things like: "example.com/en/ -> en, not works, not ok" All I can say for now is it works fine, as it should. I can switch it on and off and everything works.
  14. Page field is a page relation and stored as every field in PW in a own table. Dont worry about performance. How many pages are we talking about if you say lots?
  15. Cool thanks for writing. Extending "Process" in a module is meant for admin pages. Each admin page has the admin template and a process attached. For normal modules you extend "Wire" or "WireData", if you want to create hooks and all sort of helper modules. For more infos look at what Ryan wrote here: http://wiki.processwire.com/index.php/Module_Creation
  16. On the page with the page field, output all references foreach($page->yourpagefield as $pr){ echo "<a href='{$pr->url}'>$pr->title</a>"; } On another page that is referenced, search all pages that have "me" referenced: $pa = $pages->find("yourpagefield=$page"); // $page is the current page foreach($pa as $p){ echo "<a href='{$p->url}'>$p->title</a>"; }
  17. Great module! Thanks Adam for doing it, great job. 1. I enabled invis and everytime I save the page there's some chars appended in the editor like -> -> -> I use MD textformatter, and have use focus mode on. Not sure what's happening. 3. Also I get some warning when debug mode on in admin: "Notice: Trying to get property of non-object in /xxx/site/modules/InputfieldAceEditor/InputfieldAceEditor.module on line 125 Changing it to "if($field && $field->textformatters)" removes it. 2. Don't know if it's possible anway, but would be maybe nice if the "editor" area would be drag sizable in height like textareas. Keep up the good work.
  18. Don't use images in text wysiwag. Seriously. I think u can avoid a lot of issues. Think if you replace img with a different size and ratio. I stoped doing it and use other ways a long time ago. You just give away control, and editors start to think they need to do design. All websites we done with free images in text are horrible after 1 month in hand of a client and lots of maintenance needed. Use repeater to make blocks with images and a option to align or size. Or intext tags where to put image. Theres even a module. And your back in control. And other nice effect.
  19. fmgujju, Can you check on processwire.net? I just made it a little larger, which can't hurt. Well thinking about it, it looks really strange on your computer, as if font smothing isn't on for your browser under a certain fon size (i'm sure it's this).
  20. Thanks much for the feedback. That's nice of you. Well Chrome != Chrome, looks like you're on Windows? It looks top sharp on Chrome OSX. That's how it looks for me. So changing it to other font-weight will make it look to bold here . But I'm sure we can look into it, but have to say it's the usual webfont != webfont != browser != os. Never can get it perfect for all except chosing Arial or Verdana. I'm sure you know already. Well, maybe just a tin larger will make it look better.
  21. Maybe you could provide the full code of your module? $this->fuel->set("bla", $this); works fine.
  22. Isn't good for search-engine ranking? Really? Don't think so. You would never give or render a url "/about-us" anyway in your site, so what is the problem again? Google won't ever think there's "/about-us" and in case someone enters a link like this it will get redirected (301) to the one with slash. There's not 2 urls that work, only one. The one without get's redirected. Never ever seen or heard or experienced any issue with such things regarding search engines or SEO. Once you start messing around with it, like some with and some without and some that have children have one and pages without don't, will make things difficult changing it will give maybe some problems with search engines. IMHO this discussion about trailing slash is far from being relevant at all. So I don't need an answer or think there's none. Personal taste and influenced by how you think it should be
  23. Error Call to a member function get_apikey() on a non-object in this case $mailchimp isn't an object. Maybe you have set autload to true after installing module? Try reinstall it, as it won't change it if youc hange the code solely. This is if you call $this inside an static method.
  24. A quick look on the cheat sheet with "status" would have revealed it: http://processwire.com/api/cheatsheet/?advanced=true&filter=status
×
×
  • Create New...