Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/25/2013 in all areas

  1. THis is now out of date and WILL NOT WORK with recent versions of ProcessWire This is a Bootstrap based admin theme This is a very early release and may not be up to production standards - use at your own risk, or just play around with it. UPDATE New version has lots of improvements (see screenshots) and has been updated to Bootstrap 2.3 And roll back to 2.2.2 - at least the JS. It runs into problems with the version of JQuery, I think. Important - this is developed for the DEV branch of ProcessWire and is not fully compatible with the current stable release. The Bootwire Admin theme uses the most current version of Twitter Bootstrap and should be easy to update as new versions come out. Any changes to Bootstrap are done with overrides and the bootstrap.min.css and bootstrap-responsive.min.css are left untouched. Features The theme has been kept sympathetic to the original PW admin colours and layout. The top menu features drop downs rather than linking to an intermediate page (thanks to Soma and his lovely Teflon theme for the menu). I have tried to make the theme as responsive as possible, but I was foiled on some pages by some Tables and TinyMCE - if you want a responsive edit page, make sure your TinyMCE tool buttons are over a couple of rows rather than one long one. Page list actions have been replaced with Icons so that they take up less space (useful for small viewports) Compatibility This was designed using the PW Development branch and using the Chrome browser. It has been tested on other browsers, but not extensively, so any problems, please yell! Overrides Overrides to Bootstrap are in the bootstrap-overrides.css file. Main,js has several overrides to turn elements Bootstrap compatible. There is also a commented out section which changes the page list icons to a dropdown button - however, this is not working in this version. Installation Unzip the archive and place the template-admin directory in your "/site" directory. Note: since this is not a full release, it is not available through Soma's Module Manager. Thanks Soma, for allowing me to steal bits from Teflon and helping with the menu markup Diogo for Teaching me a bit of JQuery and helping with the page list action button (still to be implemented) Ryan for making it possible to create an admin theme in a couple of days (including working on other stuff) Files Now on GitHub: https://github.com/jsanglier/Bootwire-Admin/ Download Hope you enjoy it - leave nice comments below! Joss Screenshots bootwire-admin-v0.4.1.zip
    5 points
  2. Once the International Organization for Standardization have a 639 classification for WillyC's lingo, we can give him his own sub-forum too.
    3 points
  3. There's the short open tag and the short echo tag. In php5.4 the short echo is always available but not the short open tag. Some more info here with a comment from a php dev member. I quite like my short echo's in templates and don't consider them bad.
    2 points
  4. Awhile back, I made an Ajax API for querying pages in the admin via the ProcessPageSearch module. It is used by [for example] the PageAutocomplete Inputfield. I thought this capability would be useful on the front-end too, so this module brings it to the front-end as a page in your site that you can put wherever you want to. The way you use it is exactly the same as the one in ProcessPageSearch, but this one is a little more strict, given that it's publicly available on the front-end. By "more strict" I mean that you have to define what you want to allow in terms of input and output in the module's configuration. The web service takes it's query from GET variables in the URL and returns results in JSON format. It installs a page called /service-pages/ in your site, and you are welcome to move that page wherever you want. Here is the official page at modules.processwire.com: http://modules.processwire.com/modules/service-pages/ Once installed, you should view the /service-pages/ page that it installs because it outputs detailed instructions and examples on how to use it in your own projects. But here's a few excerpts from what you'll find on that instructions page: Input The /service-pages/ page can be queried with GET variables in the URL to return JSON-format results. The query string should follow a ProcessWire selector format ([field][operator][value]), but modified a bit for use in a URL query string. Here are a few format examples: Specify a single value: ?field=value Specify multiple fields and values to match: ?field1=value1&field2=value2&field3=value3 Specify multiple fields where at least one must match the value. Note use of "," rather than "|", something we had to settle for to make it work as a URL key: ?field1,field2,field3=value Specify one field with multiple possible values (it's fine to use "|" as a separator here): ?field=value1|value2|value3 Note that unlike regular ProcessWire selectors, multiple field=value sets are split with an ampersand "&" rather than a comma ",". Allowed Values The allowed values for field are set with the module configuration. You may also specify the following modifier keyword=value pairs: sort=[field] (Specify field name to sort results by) debug=1 (Enables debug mode producing human readable output) limit=[n] (Specify the max number of pages to return) start=[n] (Specify the result number to start with) include=hidden (Include pages that are 'hidden') Allowed operators The operator demonstrated by the "=" sign in the examples above may be replaced with any of the following operators in the query string: = Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to *= Contains the exact word or phrase ~= Contains all the words %= Contains the exact word or phrase (using slower SQL LIKE) ^= Contains the exact word or phrase at the beginning of the field $= Contains the exact word or phrase at the end of the field As an example, this ProcessWire selector: template=property, body*=luxury, bedrooms>5, bathrooms<=3 ...would be specified as a query string to this web service like this: ?template=property&body*=luxury&bedrooms>5&bathrooms<=3 Allowed templates For security, the search will only be performed on pages using templates that are defined in the module's configuration. Output The returned value is a JSON format string in the following format (populated with example values): { selector: "title*=something, template=basic-page, limit=50", total: 2, limit: 50, start: 0, matches: [ { id: 1002, parent_id: 4525, template: "basic-page", path: "/test/hello/", name: "hello" }, { id: 1005, parent_id: 4525, template: "basic-page", path: "/test/contact/", name: "Contact Us" } ] } Each of the 'matches' values will also include all the fields you have specified to appear with the ServicePages module configuration. If an error in the query prevented it from being performed, a JSON string in this format will be returned: { errors: [ "Error message 1", "Error message 2 (if there was one)", "And so on..." ] } The web service honors user view permissions. As a result, if you are accessing this service from a superuser account, you are likely to get pages that others users may not see. Superusers get an "include=all" automatically, unless you override it with an "include=hidden". Returned field values The following field values will be returned for all matched pages: id (integer) parent_id (integer) template (string) path (string) name (string) Any other fields may be included from the module's configuration screen. Pagination To paginate, simplify add a "page[n]" url segment to the request URL, i.e. /service-pages/page2/?template=basic-page&sort=name
    1 point
  5. Dear PW-ers. I would like to inform you that I’ve been in need of Tree View commenting system for a project being developed by me at the moment, thus, I’ve decided to make some additions to the commenting system developed by Ryan. Hereunder, I’d like to share the code with you for your kind information. You can also practice it in case of need. Some screenshots: Download link: FieldtypeComments.zip List of changed files: small change in main.css: Archive updated.
    1 point
  6. Hey guys, I've created an initial ProcessWire bootstrap repository if any of you want to use it. Try this, branch it out, do whatever you want with it. https://bitbucket.org/thatgibbyguy/base_html5_processwire The features of this bootstrap are: HTML5 Boilerplate Modernizr/HTML5 Shiv Javascript Libraries: Twitter Bootstrap Javascript Library jQuery-1.8.2 jQueryUI-1.9.1 jQuery.fittext.js jQuery.mobile-1.20 jQuery.scrollto-1.4.3.1 retina-0.0.2 CSS/LESS Frameworks: font-awesome (not 3.0 yet) KUBE Grid (in LESS) Twitter Bootstrap Library (in LESS - library.less) Base LESS file (style.less) Key changes to Ryan's initial download are just that I took each one of his calls and abstracted them out as includes. So Ryan's functionality has been abstracted into the following includes: Breadcrumbs -> breadcrumb.inc Page Titles -> pagetitle.inc Random Image -> randomimage.inc Search -> search.inc Sidebar -> sidebar.inc For example, to add the breadcrumbs to your site, simply include it in your markup like so: Also included is Soma's Markup Simple Module.
    1 point
  7. I am writing News module for PW (https://github.com/orkhan/PWNewsPlugin). Any ideas about module?
    1 point
  8. Dead right! (Psst! Where is the code edit button?) murof eht htiw gnorw gnihtyna ees t'nac I ,yawynA ssoJ
    1 point
  9. EllisLab have recently changed the pricing structure of their flagship product, ExpressionEngine. Just to some up the changes, they've basically discontinued their freelancer and non-commercial licences, got rid of volume discounts and changed their support structure. So, the only available option now is to buy the fully commercial licence, which currently costs $299. This has seemed to anger a good chunk of their customer base, who have raised their concern for the future of ExpressionEngine in a number of places. See here for some examples: http://bit.ly/R2yFLf http://bit.ly/U8qrBV Now, I think this is an excellent opportunity for ProcessWire. I believe that a good number of ExpressionEngine customers now looking for alternatives would greatly appreciate the flexibility and power that ProcessWire has to offer, and would find the transition from EE to PW relatively smooth. I'm not suggesting that PW and EE are totally interchangeable, but I do believe they share enough in common to appeal to those EE users currently looking for an alternative CMS. So, what do you guys think? How could we take advantage of the 'EE exodus'? Claudio
    1 point
  10. There appear to be some ongoing issues since the upgrade and some of it seems to be down to some weird mish-mash of old and new code in the new template - evidently the update did not run as smoothly as it seemed! Since there's a minor upgrade required due to another recent release, what I'll likely do soon is start from scratch with a blank installation locally and copy the edits made for the current theme over the top of that and then re-import it. It's a bit of work, but not as much as it sounds to be honest. In the meantime, those experiencing issues on Chrome might like to try a different browser. @Nik: this means one with a GUI
    1 point
  11. We could indeed put puppies on it. I think it should also run on Wordpress too
    1 point
  12. alway.s have call.to action my designe teacher say
    1 point
  13. Thanks Ryan - sounds like you are on it Yeah, I figured they weren't a replacement for pages when dealing with lots of entries. Definitely a great option to have in the arsenal though and I think they will be much friendlier for the client with those couple of enhancements.
    1 point
  14. Awesome update to this module. Thanks celfred and ryan!
    1 point
  15. *facepalm* I stepped in the ->first()-trap again... From now on I'll place a post it on my monitor, stating "...have you tried ->first?" or "Try ->first() first before annoying people in the PW forums!" Thanks!
    1 point
  16. nn_basic_page_file contains Pagefiles object, which is inherited from WireArray, which is actually an object that PW uses pretty much everywhere. It is neat concept and makes working much faster than with regular PHP arrays. See more from here: http://processwire.com/api/arrays/ So from that link you find all the ways to find files from your field. Some examples: //first, this makes it all nicer: $p = wire('pages')->get(1001); $first_file = $p->nn_basic_page_file->first(); // like wanze showed above $second_file = $p->nn_basic_page_file->eq(1); $random_file = $p->nn_basic_page_file->getRandom(); $specific = $p->nn_basic_page_file->get("filename=myphoto.jpg");
    1 point
  17. That event would be .ajaxComplete(). Joss, try this: $(document).ajaxComplete(function() { $('.PageListActions').addClass('test'); });
    1 point
  18. Have a look into the cheatsheet and search for delete, you get something like this: $files->delete($file) damn Antti was faster
    1 point
  19. http://processwire.com/api/cheatsheet/ $filefield->delete($file) requires actual file object as a paremeter. $filefield->deleteAll() deletes all the files.
    1 point
  20. Congrats and thanks for the great modules! Can you even sleep without a daily dose of 50-100 Pw-likes?
    1 point
  21. Good idea Nico. I'm happy to setup subdomains as needed.
    1 point
  22. ProcessWire now implements ALL of the jQuery traversal functions in the Page API. Existing ProcessWire versions already implemented most of them, but once we started updating parent() and parents() to support selectors, I figured we might as well be fully complete and consistent with the jQuery equivalents. Now we are. The following functions were added or updated: $page->parents([$selector]) -- Now you can specify a $selector and it will return parents that match your selector. $page->parent([$selector]) -- Now you can specify a $selector and it will return the closest matching parent. $page->closest($selector) -- Same as parent($selector) except that it considers the current page in addition to the parents. $page->parentsUntil($selector, [$filter]) -- Return all parents from current till the one matched by $selector, optionally filtering them afterwards by $filter (a selector string). Note that $selector may be a selector string, a Page, a path, or an ID. $page->next([$selector]) -- Now you can specify a $selector and it will return the closest matching next sibling. $page->nextAll([$selector]) -- Returns all siblings that come after this $page, optionally filtered by a $selector. $page->nextUntil($selector, [$filter]) -- Return all sibling pages after this one until matching the one specified. Optionally filters the results by $filter, which is a selector string. Note that $selector (the first argument) may be a selector string, a Page, a path, or an ID. $page->prev([$selector]) -- Now you can specify a $selector and it will return the closest matching previous sibling. $page->prevAll([$selector]) -- Returns all siblings that come before this $page, optionally filtered by a $selector. $page->prevUntil($selector, [$filter]) -- Return all sibling pages before this one until matching the one specified. Optionally filters the results by $filter, which is a selector string. Note that $selector (the first argument) may be a selector string, a Page, a path, or an ID. Arguments in [brackets] are optional. These functions duplicate the arguments and behavior of their jQuery counterparts. The exceptions are that parent(), next(), and prev() have a slightly different behavior: they will traverse to find the closest match (which I thought was a lot more useful in our context). In jQuery, they don't traverse beyond the direct parent/next/previous item in the DOM. As before, all the next and prev functions should be used cautiously when $page has a large amount of siblings. All these functions require loading all the pages they interact with, as comparisons are done in memory and not via SQL queries. All of them accept an optional last $siblings argument, which is a PageArray of siblings you want it to analyze (which is presumably a more limited set), and this is what you'd use if you need to scale to thousands of pages when using these functions. But if you aren't dealing with huge amounts of pages, then you don't need to consider this.
    1 point
  23. Hello everyone, As others have said, it's too bad about EE. At one time, I thought EE was the best CMS, and I still think it is pretty amazing. But I like to experiment and develop ideas freely. Even with the old pricing structure, this was not really possible with EE. Under the new stucture, it's even less feasible. But what's most relevant is that I can replace everything I did in EE with ProcessWire, and in ProcessWire it feels more "natural" and closer to pure PHP. I also really liked CodeIgniter. It was the framework that introduced me to frameworks. But even here, Laravel has taken the framework role. I think that with Ellis Labs making such pricing decisions, a lot of excellent and generous CI contributors will feel that their contributions make more sense in the Laravel community. And by the way, there were hints about the licensing issues over a year ago, when Ellis Labs changed the license type for CodeIgniter. Regarding posting in the EE forum: I would personally be against that unless a discussion had already developed over there about alternatives. I think that posting blog entries and commenting on other blogs is the better way to go. Thanks, Matthew EDIT: I added my "like" to alternativeto.com!
    1 point
  24. If someone wants to write an article about how to make the move from EE to PW, I will gladly edit it and give it some spin. It can go on the Wiki as a useful article and then you can all put it on your blogs everywhere! I am not talking about how to move an actual site, but rather if you do this on EE, this is how to achieve the same thing in PW .... that sort of thing. Joss
    1 point
  25. I came here from EE and agree that EE users looking to go elsewhere won't find a better fit than PW. Bit of a shame for them though, I also found it a nice system to use and in the main real enjoyed using it. The cost for my small sites had begun to get prohibitive as well as the need to install modules to do simple things. I'm just delighted that PW is here to offer all of the advantages of EE without the drawbacks And it response to Claudio's final question, I think the answer is "talk about PW in their forums". Not sure whether or not that feels right though...
    1 point
  26. I stopped using EE about a year ago. I didn't see all these EL changes coming but the multiple pages of ongoing bugs and having to install a multitude of add-ons to do simple stuff just got tedious. That and the painful upgrade process/add-on compatibility made maintaining a site excruciating. It made selling it to clients a no go. EE is generally a good product and the developer community have created a wealth of good add-ons. But that has inadvertently stifled any EE development. I can't think of a new feature they've brought out in the last two years whilst the bug list keeps growing. I think it's become a platform for developers to make a few bucks - and not that much from what I've read. The EE community can be really one-eyed too and the loudest are those that have hinged their business on using EE and don't/won't consider using anything else. While it's not a particularly healthy thing, they're generous and helpful as well. I don't miss using EE one bit and I'm honestly impressed beyond belief that I can do 99% of the work I used to do in EE (and add-ons) now with PW. Cheers Marty
    1 point
  27. Greetings, I'm glad someone is talking about this here. If it was April 1, I would think that Ellis Labs' decision was a bad joke. But, apparently, it is serious. I have used EE for a couple of projcts. I stopped using it a few months before I discovered ProcessWire. It's a great system, maybe the best out there after ProcessWire. But the new pricing scheme will drive away all but the most lucrative design studios. Just to lanch an EE site costs about $2,000. With middle-of-the-road support, the first year for that project starts off at about $4,400, with recurring minimum service fees at $2,400/year. To have same-day support, the first-year cost of a site is -- not kidding -- about $26,000, with recurring minimum service costs of $24,000/year. Some of my customers could bear that, but I would clearly have to reject all arts organizations, non-profits, community concepts, not to mention any of my own "pet projects." But the real damage will come from the fact that in the famed Ellis Labs forum there is an understandable reaction from many valuable and active members who are obviously not willing to continue offering free advice to support Ellis Labs. I'm puzzled by this move. It's too bad -- seriously. I think it will not only drag down EE, but may also take CodeIgniter with it (and CodeIgniter has been having enough trouble lately as it is). But yes, to the main point of this discussion, it might bring new people over to ProcessWire. Thanks, Matthew
    1 point
  28. indeed, here is the code with validation if(isset($_POST['title'])) { $newpage = new Page(); $newpage->template = $templates->get("upload"); $newpage->parent = $pages->get("/uploader-test/"); $newpage->name = $_POST['title']; $newpage->title = $_POST['title']; $newpage->save(); $path=$newpage->images->path; // GET THE PATH TO THE UPLOADS FOLDER FOR NEW PAGE $name = strtolower($sanitizer->name($_FILES['upload']['name'])); // RUN THE $NAME THROUGH $SANITIZER TO MAKE IT PW COMPATIBLE... // prepend underscores to filename until it's unique... while(is_file($path . $name)) $name = "_" . $name; // validate the file extension $pos = strrpos($name, "."); if(!$pos) throw new WireException("File is missing extension"); $ext = substr($name, $pos+1); if(!in_array($ext, array('pdf', 'jpg', 'jpeg', 'gif', 'png'))) throw new WireException("Invalid extension"); $file = $path . $name; // DETERMINE THE FINAL DESTINATION AND STORE IT IN $FILE if(move_uploaded_file($_FILES['upload']['tmp_name'], $file)) { // MOVE THE FILE TO IT'S DESTINATION USING PHP'S FUNCTION $newpage->report_request->add($file); // ADD IT TO THE PAGE $newpage->save(); // SAVE THE PAGE AGAIN } }
    1 point
  29. For the page that's selected, the 'select' link is replaced by 'unselect'. When you click unselect, it will make it unselected.
    1 point
×
×
  • Create New...