-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
There's no support for team_1|team_2=1011|1014|
-
I often use open in new tab to have a page, template or field screen open. Not trying to convience you, I think you know that
-
I build a tool for page mass creation: And a tool to list pages and data in a table and have an edit link that opens in a modal: Tool like this are great and easy to implement to one needs.
-
Did you know the cheatsheet already: http://processwire.com/api/cheatsheet Not in relation to your question, just so. What apeisa said. Also the statuses is a bitmask, not that I understand it well, but it's like making visible and hidden both a status, which doesn't make sense it's either hidden or not, then it's visible. I'm not sure this makes sense. And only Ryan would be able to share some light, why it is how it is.
-
I don't like to change the way it is, because I like it the way it is. But that's ofc only me. Something that may take alternative routes with modules or custom admin template makes sense. Look at my teflon theme that does some things like dropdowns. Or my shortcut module, which makes "alt+q" and opens an autocomple dialog to search for pages, click enter and you're tehre, without even leaving and not matter where you are in the admin. I like the flow and all possible things that can be built on top of the simple approach. I wouldn't like if we change the admin to a state where it's assuming too much things that may not useful for all, or to their likings, and make it hard to change it from there with modules. For example build bustom admin pages and widgets that could help doing stuff like popups. Instead of changing the current admin flow. I'm not saying it's all bad (maybe I didn't understand all), but think about it a second. Just my 2 cents
-
Feel free to take it and improve it. Make it your own whatever and be sure to submit it to modulers page. You're welcome. Glad if it helps people.
- 67 replies
-
- 4
-
- Inputfield
- UI
-
(and 2 more)
Tagged with:
-
Updatery I just pushed v 1.0.3. to the master to https://github.com/s...nic/ColorPicker added support for default value added reset link to set back to default color some cleanup and added readme finally updated first post
-
Ok fixad tha issue, damn no off to some relaxing
- 67 replies
-
- 3
-
- Inputfield
- UI
-
(and 2 more)
Tagged with:
-
Nice idea, I was also thinking about some time ago. One way is to not extend the InputfieldTextarea, and make a new Inputfield type, but Hook into the necessary methods to extend the config and rendering. Since this made me wonder how it would go, I gave it a try. It's a nice example showing how to archive it using hooks only. It will give you a extra Input setting "Max length" in the field setup. And a counter for all InputfieldTextarea (not tinymce fields) and add a attribute "data-maxlength" to the one that have a max length value. I had to use "maxchars" as the setting field name as there's already this attribute, but not used in the context of page edit. The script js is also added via a hook, and is a basic example of the script that counts backward while typing. Since I was already that far it was easy to add, but you might want to modify it and add features if you like. This took me roughly 30min, and little more to add the js. I think a year ago I wouldn't knew how and would have taken ages to figure out. But it grows on you after so many modules and insight. This module shows you some good practices and maybe helps understanding modules. If you have questions please bring them in. Module code: https://gist.github.com/4252958 JScript code: https://gist.github.com/4252962 Put them in a folder /site/modules/TextAreaCounter/.. Install, enjoy. Edit: just found an issue... will take a look again
- 67 replies
-
- 8
-
- Inputfield
- UI
-
(and 2 more)
Tagged with:
-
I have implemented a default value you can set in the field settings. Which means you can decide for yourself. i.e. "EAEAEA" or "". Which has effect on how you can test the field. Not sure how others have implemented the colorpicker, but this would be backward compatible if you set it to default "FFFFFF" as before. And a link "reset" alongside every colorpicker. I'll have to test a little more, but it works fine but haven't had time to commit the changes.
-
As you may noticed or not it has FFFFFF as default value. You could test for it. Im not really sure if having it this way makes sense for a color field or not. Resetting the value to default isnt implemented simply bcause I havent had the need. Maybe a button or something to reset would be good.
-
You have to look for max limit.. I think then its under details. Its not a dropdown you just set how man images are allowed.
-
It's set in the field settings. Got Setup -> fields -> yourfield. Then in the input tab, you can set the things you need.
-
Welcome henriette. There's several ways to archive what you want. Your ideas are on the right track, you definately want to create some "/footer/" page where you could enter the content for your footer then output the content of that page. http://processwire.c...-settings-page/ Single page approach: If you create a template "footer" and in the php file you just would output the markup and data of the page. You can make this page "hidden" to not show up in navigation. Then in your main template, where you would include you just render the "/footer/" page like this. echo $pages->get("/footer/")->render(); and the footer page template would be this (just example. <div id="footer"> <?php echo "<h3>$page->title</h3>"; echo $page->body; ?> </div> Subpages or repeater approach: You could use repeaters or just subpages to create the 3 blocks. Repeater module is a great way to "repeat" a set of fields. It is not installed by default. See infos here: http://modules.proce...dtype-repeater/ If using subpages you would create children pages under maybe a page "/footer/". Then output them like this. $blocks = $pages->get("/footer/")->children('sort=sort'); foreach($blocks as $block) echo $block->render(); If using repeater, it would be slightly different, but the repeater field is like a field that holds pages, but since you can't use render you'd have to output markup too. If repeater field is named "footer_blocks" with title and body field inside you'd do it like the following: $footer = $pages->get("/footer/"); foreach($footer->footer_blocks as $block) { echo "<h3>$block->title</h3>"; echo "<div class='footer-body'>$block->body</div>"; }
-
Ah yes, that makes sense. Still the $page_temp->editable() could be used in that case too. $this->user->hasPermission('page-edit') is not page context aware, so a user could see it for pages he has no edit rights. Well while testing I found it works with the user->hasPermission() if you do it with a hook on before render. $this->addHookBefore('Page::render', $this, 'changeView');
-
Why is there no women composer?
-
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; ...
-
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; } }
-
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.
-
(Static) Template page for failure to connect to DB
Soma replied to BrendonKoz's topic in Wishlist & Roadmap
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. -
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.
-
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.
-
Maybe also want to read this thread about uploading images via front end form.
-
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 )
- 19 replies
-
- 19
-
What error? I tested it and works fine. This is in upload class: public function setMaxFileSize($bytes) { $this->maxFileSize = (int) $bytes; return $this; }