Leaderboard
Popular Content
Showing content with the highest reputation on 10/21/2015 in all areas
-
hi everyone, i'm happy to share my first little module that could have broader use... use at your own risk! i'm quite new to module development Usage Just install the module and place your preview images in the folder /site/templates/TemplatePreviewImages filename = template-name.png Github https://github.com/BernhardBaumrock/TemplatePreviewImages Notes jquery image picker used in this module (MIT license): http://rvera.github.io/image-picker/ Room for improvement / roadmap: Images are resized via CSS (height: 200px) Images could be placed via masonry or the like create image-field to upload preview images directly to the template looking forward to hearing your feedback ps: is it intentional that i am only allowed to choose from 2 templates when adding the page and have more options available when editing the template settings of the page like you can see in the video? i'm wondering why this should be like this?!15 points
-
Hi folks So I actually just added this as a pull request on Github before figuring out it's already possible in the system. What I wanted was an ASMSelect field (can be a normal select or other Page field) where the list was ordered in a certain way and pulled from two sets of pages with different templates. The trick was that I wanted the labels for one set of pages to include the parent page name in the label so they're sorted by parent title, then title, but the other set of pages was just to be added to the end in alphabetical order. I've anonymised the example somewhat, but I have a medical blog where I wanted to categorise posts against medical procedures listed on the site, as well as other blog-specific, general categories. To achieve what I wanted, I selected ASMSelect as the Page Inputfield type, then used the "Custom PHP code to find selectable pages" option and did this: $options = new PageArray(); foreach ($pages->find("template=surgery, sort=parent.name, sort=name") as $category) { $category->title = $category->parent->title . ' / ' . $category->title; $options->add($category); } $options->add($pages->find("template=blog-category, sort=name")); return $options; This results in a nice, alphabetised list such as: Surgery Category A / Procedure 1 Surgery Category A / Procedure 2 Surgery Category A / Procedure 3 Surgery Category B / Procedure 4 Surgery Category C / Procedure 5 Surgery Category C / Procedure 6 General Category A General Category B General Category C and so on, so the surgery pages are in the format {parent.title} / {title} in the Select list, and the blog-category pages are just the normal {title}, all ordered alphabetically by parent (where necessary) and page title. Nice and easy7 points
-
choosing a cms your organization will love, read here, (and also see the first posted comment)6 points
-
RedBeanPHP is a simple and easy-to-use ORM, and this module is a lightweight ProcessWire wrapper and/or loader for it. The main task of the module is loading and setting up RedBeanPHP with database credentials from $config. There are some config settings for defining how RedBeanPHP should behave, and the module also exposes some often-used methods, but that's just about it. For more details (including a rant about why one might prefer separate ORM in some cases), take a look at the README file. Please note that, for almost all use cases, the data modeling features of ProcessWire are much better choice than a separate database structure of your own, but in those rare cases where that's not the situation, it's good to have options. This module was a side product of one of my own projects, and I thought I might as well share it with you folks. You can grab the module from GitHub: https://github.com/teppokoivula/RedBeanPHP.5 points
-
@Mike Making Automation is something I definitely lack, I kind of always feel slow to start, every new project a tad bit better, but always kind of slow paced. I will take your advice and think thoroughly on what I could put in these blueprints for future work. @OrganizedFellow I get you! It's like, right now, I get some weird looks amongst a few programming friends because I'm programming in godforsaken PHP. I guess that's probably one of the reason I've been really enjoying this forum, I don't talk that much about programming, but rather useful ways of doing things and solving problems, and creating great design with a really cool tool (looking at you PW), and well, it all happens to be a written in PHP and that's just fine with me.5 points
-
I am noticing that some editors are forgetting, or not seeing that they have to publish the items/pages in a PageTable fields. I think in many/most cases you would want all published automatically. Or perhaps it could be an option for the field - the dev can decide whether editors can choose to save unpublished if they want. Alternatively I think it would at least be helpful if there were publish and hide toggles (like the new main page tree action buttons) so it is easy to quickly publish all subpages rather than opening each one up. I would prefer the first option though. Anyone else think this would be useful?4 points
-
I still write my CSS without a preprocessor... Is that weird now? I admittedly haven't really tried any of the preprocessors (although I have looked into them), but at this point I prefer to use plain CSS because I can see exactly what code I'm producing and base how I architect my CSS off of that. I'll have to look more into this gulp n' grunt stuff...3 points
-
Some enhancements could be: - A setting to chose thumbnail size, maybe even giving the users the option to choose by themselves. - Moving the images folder out of the module's folder. It should rather be part of the assets or templates folder.3 points
-
Session Login Throttle doesn't prevent multiple logins with the same user. It's to prevent dictionary attacks, so when someone trying to login 3 times with same username but wrong password.3 points
-
What a great comment!! I sometimes find myself apologizing for my PHP work also, but until someone can show me a system in a trendy/better language that is better than PW, it will always be my goto tool for web development. That doesn't mean I don't like playing with the new JS toys (node, meteor, angular, react) when the need arises, but PW makes everything so easy that I'd rather be here3 points
-
Hi, three new sites i've worked on recently going live: Photographer - http://www.samhofman.co.uk/ Photographer - http://www.domeni.co.uk/ Illustrator / 3D artist - http://www.mircopinna.com/2 points
-
I posted on a separate thread some days ago on why this would be useful, and it seems you had the same use cases that I have a need for (or had in mind). I tried doing something similar with Propel ORM, but there is a steep overhead and I got nowhere.Thank you. I will play around with it and possibly give some feedback.2 points
-
Update version 1.0.1 (Dev only for now) Note: Haven't had time to update README Changes As requested, added ability to find column/row pages using custom PHP code. Thanks @adrian. This is a really powerful feature. Note that the order of precedence for the 3 methods to return row/column pages is: 1. Selector 2. Custom PHP code 3. Page field (3 is greatest). Browser warning alert for reset button + rename the button (@adrian). Done + enhancement by @mackski, the button styling now matches other PW buttons Added two properties: rowLabel and columnLabel (in memory only; not saved to DB) to return user-friendly row/column header info. E.g. echo matrix->rowLabel could render 'Red' or 'Large' instead of echo matrix->row that would instead render the page's ID. These are searchable in-memory ONLY, e.g. $results = $page->results->find("columnLabel=Maths"). Added two methods getRow() and getColumn() for mainly syntactic convenience. These do in-memory searches. Can search by path, title, ID, page object (see examples below). Examples columnLabel //find all results for one column - using 'user friendly selector'; $results = $page->results->find("columnLabel=Maths");//@note: in-memory selector echo '<h3>The are the results of: ' . $results->first()->columnLabel . '</h3>';//maths results foreach ($results as $r) echo $r->rowLabel . ': ' . $r->value . '<br>';//student name: score rowLabel $results = $page->results->find("rowLabel=Maurice|Joel|Mi Mong");//@note: in-memory selector #$results = $page->results->find("");//will show all echo '<h3>The are the MULTIPLE results for several students</h3>'; $row = array(); foreach ($results as $r) { if(!in_array($r->row, $row)) { echo '<h4>' . $r->rowLabel . '</h4>';//echo'es student name (e.g. Joel) $row[] = $r->row; } echo $r->columnLabel . ': ' . $r->value . '<br>';//echo'es each subject's results, e.g. Maths: 70 } getRow()//accepts 3 arguments selector value, limit, sort #$p = $pages->get(1088); #$results2 = $page->results->getRow($p->id);//get by ID #$results2 = $page->results->getRow($p->title);//get by Title #$results2 = $page->results->getRow('Joel');//get by Title (case sensitive) #$results2 = $page->results->getRow($p);//get by Page #$results2 = $page->results->getRow($p->path);//get by Path $results2 = $page->results->getRow(1087);//get by ID//get by ID #$results2 = $page->results->getRow('/students/richard/');//get by Path #$results2 = $page->results->getRow($p, 4, 'random');//get by Page, limit to 4 random values #$results2 = $page->results->getRow($p, 4, 'asc');//get by Page, limit to 4 values, sort ascending #$results2 = $page->results->getRow($p, 3, 'desc');//get by Page, limit to 3 values, sort descending #$results2 = $page->results->getRow($p->title, 4);//get by Page title, limit to 4 #$results2 = $page->results->getRow($p, '', 'asc');//get by Page, no limit, sort ascending #$results2 = $page->results->getRow($p->path, '', 'desc');//get by Path, no limit, sort descending echo '<h3>The are the results for: ' . $results2->first()->rowLabel . '</h3>';//student name foreach ($results2 as $r) echo $r->columnLabel . ': ' . $r->value . '<br>';//subject: score getColumn()//accepts 3 arguments selector value, limit, sort Similar to getRow() except for columns $results3 = $page->results->getColumn('/subjects/physics/'); echo '<h3>The are the results for: ' . $results3->first()->columnLabel . '</h3>';//Subject foreach ($results3 as $r) echo $r->rowLabel . ': ' . $r->value . '<br>';//student:score Some feature requests still pending + thinking whether to implement findRows() and findColumns(). Please test and let me know (if you can, both fresh install and upgrades [test on non-critical data please])2 points
-
Sometimes I feel horrible that I'm not using the cool kids tools, but truth be told I think none of my projects are that complex to really need this setup. Am I being lazy here? Should I actually try this tools to actually see the possible benefits? I mean, I do want to become a better webdev, just really haven't seen the need, I just feel that all that minification and optimized workflow works for complex stuff and when that time comes, I will make my move, meanwhile it feels like an overkill.2 points
-
A ProcessWire Fieldtype storing files in a customized location, outside the web root. This module is primarily useful if you need to store sensitive data which should not be accessible directly from the web. Normally, ProcessWire stores all files under /site/assets/files. Direct URL access to these files can be restriced by setting $config->pagefileSecure = true. Still you need to make sure that your template permissions are setup correctly. If something goes wrong, those files could be accessed from outside. GitHub: https://github.com/wanze/FieldtypeSecureFile Modules Directory: http://modules.processwire.com/modules/fieldtype-secure-file/ How does it work? After installing this module, you can create a new field of type SecureFile. Enter your configuration under the "Details" section when editing the field: Storage Location Enter a path outside the web root where the files are stored. You need to create the directory manually. Also make sure that the user running the web server has write permission. Roles allowing to download a secure file Users with a role selected here are able to download the files if a download is requested via the API. Allow Download in Admin If checked, users having a role selected above can download the files when editing a page. I needed this functionality for a recent project, so I created this module and thought to share it, mabye this is useful for someone else Consider it beta, I'm using it on one site but I'm sure it could be improved here and there. Feel free to suggest additional features! Cheers1 point
-
Which is the one all the coolest kids are using? Yes, the coolest kids are you all, ProcessWired Friends. They've been around for a long time and I never was intrigued or interested in using either. I did some reading up and they sound pretty cool. What are you using? Why? Can you give me some newbie-advice?1 point
-
I solved it this way - a bit hacky but as it's only a cosmetic issue, it will do. In the module I needed this feature I added a "data-asm-placeholder" to the asmSelect field in module JS I added a $(function () { ... } inside document.ready() where I set the asmSelect field's first option text to the value set in data-asm-placeholder $(document).ready(function () { // other code here $(function () { $('select[data-asm-placeholder!=""][data-asm-placeholder]').each(function () { var placeholder = $(this).data('asmPlaceholder'); if (placeholder) { $(this).parent().find('.asmSelect').find('option:first').attr('selected', true).attr('disabled', true).text(placeholder); } }); }); });1 point
-
1 point
-
1 point
-
Hi All, I just launched my very first website (and Processwire site), Westchester Vocal. It's a site I made for my mom, whose a voice teacher. Some of the images still have to be updated (need to cycle out a stock photo for a portrait shot as soon as I can track the guy down). I'm also going to be adding some more pages, but the basic structure is there. I used formbuilder for the contact form. Any feedback/comments appreciated! www.westchestervocal.com1 point
-
Hi Gazley, No, it only hooks to ProcessWire's 404 event, which fires only on HTTP requests that do not resolve to a Page. Were the old URIs from another CMS, or did you move pages around in an existing PW installation?1 point
-
Thank you! 1) thanks, did read it and together with the blog post it was very helpful: https://processwire.com/blog/posts/new-module-configuration-options/ 2) thank you! 3) damn... i looked at this file but didn't see the info in the comments1 point
-
Module Creation: http://wiki.processwire.com/index.php/Module_Creation#Properties_to_return_from_getModuleInfo.28.29 (old wiki, but important stuff is there) Module Dependencies: https://processwire.com/talk/topic/778-module-dependencies/ Module.php (line 67) Not sure of any official [updated] module docs, actually. But haven't needed to look for them before.1 point
-
You can define the PW minimum in the module info: "requires" => "ProcessWire>=2.5.5" By the way, you can also separate your info into a JSON file named <ModuleName>.info.json, like this.1 point
-
http://www.walkercoderanger.com/blog/2015/06/state-of-js-build-tools-2015/ Btw. here is a slightly outdated list for your pleasure: https://gist.github.com/callumacrae/9231589 Comments kind of work as updates, though..1 point
-
1 point
-
I think diogo fell in the copy/paste trap here. You need to check the count of the field instance of the page. $page->fields->… will get you the field's properties, but not actual data. if($page->adr_rubrik->count()){ // just syntax sugar for: count($page->adr_rubrik) … }1 point
-
Most of its magic happens in JS. See how I do it Menu Builder if at all helpful. I hooked into its render method and injected my custom JS file (jquery.asmselect-mb.js) which overrides its native jquery.asmselect.js. See this thread for the results (toward the end)1 point
-
You can add things to Process Modules fairly easily. In the case of ProcessDashboard, I think you just add your custom code to dashboard.php A basic example: // create a button $addNew = wire('modules')->get('InputfieldButton'); $addNew->attr('id+name', 'add_new'); $addNew->addClass('top_button'); $addNew->attr('value', "Add New"); $addNew->attr('href', 'add/?parent_id=1'); // render the button on the page somewhere. <?php echo $addNew->render();?>1 point
-
Thanks! Modules: all use AIOM, Images with cropping, Batcher, Admin Save Actions, Export Site Profile, Page Delete, Redirects, and Template Notes. Sam's also uses: Select Multiple Transfer, Page List Image Label, Images Manager. I've got into the habit of running peoples new site as a subdomain, then putting it live through adding an A record to their domain, and if it's a bigger client I'll take a copy of the site and have live and dev for future alterations.1 point
-
Superusers can use Page Edit to select templates that are otherwise not available. It's a feature, though admittedly a weird one1 point
-
Thanks Kongondo - the new custom PHP code option is awesome - I just swapped out my old hacked version for this and it's working brilliantly!1 point
-
They all look great! The search bar in Sam Hofman's site was a nice surprise! And this one is my favorite of the three, I like the design and the content is really nice too.1 point
-
Only you have to keep in mind that it doesn't scale if you do this for more and more pages. Also note that if only counting a $pages->count(selector) is more efficient. Instead of $pages->find()->count What I do on a shop category tree, is calculate it every time a product is saved and write the count to a integer field on the category pages. So it's like cached. You could also use markup cache to cache the output and only let rebuild it when a product is changed.1 point
-
Not many specific use cases, beyond the general examples I mentioned in the README Some of my own modules have used their own database tables, partly for performance reasons, and partly because storing that kind of data on pages didn't seem like it would make sense and/or be worthwhile. Simple ORM like this can make dealing with such data easier and more enjoyable especially from developers' perspective; it's essentially a layer of abstraction, a middle ground between PDO and PW's API, and (at the very least) it can help avoid some extra rows of code. The specific use case for which I ended up building this module for was more or less similar to those existing modules: a Process module that handles custom data. In this case I found RedBeanPHP's fluid mode especially cool, as I could just dispense beans, add content, store the beans, and RB would create a schema for me automatically. RAD at it's finest, and at the end I could just switch to frozen mode, add some indexes, and be done with it Other than that, I would imagine that this could come in handy when dealing with content in external databases, or perhaps in SQLite databases. Haven't had many needs like that recently, but it's a topic that pops up even here sometimes.1 point
-
GosuSan, Welcome. I'm not sure of the context of those examples. I think Soma's original post has them as examples that are commented out. They are just meant to show alternate ways of accessing the values. Probably at different points in the submission process, depending on what you want to do. Accessing the values from $form->get("field_name")->value means the value already exists in the form object, so you are getting the values either after a successful submission, or at some point during the submission process. Perhaps for doing some other kind of check/validation (see the hotmail error in the first post example). So they both work, but it just depends on at what point you are asking for the values.1 point
-
And then you have everything listed here! http://www.frontendhandbook.com/tools.html1 point
-
Let's not forget good or interesting alternatives (in no particular order): Mercurial, Bazaar, Fossil, Darcs, Veracity... And there is also (in no particular order): OOCSS, ACSS, BEM, SMACSS...1 point
-
Absolutely LOVE the mircopinna site. So colorful! It scales beautifully on mobile! I like how you are hosting these as subdomains. Which module are you using for this?1 point
-
1 point
-
The site is clean, looks good, and loads quickly. I would add the bio info for the instructors, and add a detailed description of the voice and piano instruction for programs so that the prospect/student can see that the offerings meet their interests. I know you said you are adding pages in the future -- Just wanted to offer a couple of notes for those pages. Nice work!1 point
-
Deciding to use them for projects that don't need them isn't the greatest idea, to be honest. But, for learning purposes, I would give it a try. Should you choose to do so, you could also create yourself a blueprint of sorts for use in future projects. So no, you're definitely not being lazy - if the tools are not needed, then don't use them.1 point
-
http://modernrealestatesf.com/ Developed by Jonathan Lahijani Designed by Candy Muse1 point
-
Not APIs, API. Hopefully I don't sound too rude (in a bit of a hurry here), but please check out the docs section. It's all explained there. In addition to that, I'd suggest taking the time to browse through some of the tutorials, in case you prefer a hands-on approach. The kind of questions you're asking here are perfectly understandable from someone just getting started with the system, but it also sounds like you haven't really bothered checking out the docs either. Also, the forum is filled with answers to very similar questions, so you might want to try looking around a bit. To be fair most of your current confusion seems to stem from not understanding many of the basic concepts of ProcessWire, including how it handles content and content types. While it's a bit outdated by now, Ryan's excellent overview video is still a very good starting place in this regard; the UI will look different from what you'll see on your site and your site will have more options and settings to play with, but the basic concepts are the same.1 point