Leaderboard
Popular Content
Showing content with the highest reputation on 10/09/2015 in all areas
-
I'm currently developing about 4 websites in ProcessWire as I've moved all my bespoke development away from WordPress. I'm so happy I've found ProcessWire and I've been recommending it to all my developer friends. Seriously @Ryan, you are a very smart man. Thank you for bringing us such a great CMS/CMF and releasing it for free. --- Jump-Inc is the first site that I have released using ProcessWire, I'm very keen on staying active the the PW community and I will be sharing which sites I have completed using PW. http://jump-inc.uk/ Jump-Inc is a trampoline park opening in the UK, I have used the responsive framework UiKit and for the parallax slider I have used Revolution Slider. I have used @Soma 's ColorPicker module for the gradient picker. Keep up the great work Soma, I love the fact that you can define a selectable colour pallet. Thanks again ProcessWire and the people who contribute to the project.11 points
-
Sometimes you have clients who will login to the admin, and they perhaps only need to access a few areas of the site, such as: a product or blog list (ListerPro) site settings formbuilder entries specific front end pages documentation helpdesk backup interface Server health or server status (for example site5 has a page for every server to see it's status) Link to a bookmark (page tree bookmark for example) - this is awesome by the way Run a special action like clear a wirecache or other custom caching Add a billing or late payment notice Add an alert about upcoming server maintenance The Problem: How can you collate all of these diverse links and messages into 1 page, as fast and easy as possible, make it hassle-free to add stuff to it, maybe some messages, change the order of the links etc. In some systems this is called the Dashboard. You can make one in a few minutes using: 1.) Admin Custom Pages 2.) ready.php in your site folder Steps: Install ACP create a file inside templates for your dashboard (e.g. _ac_dashboard.php). Create your dashboard page below the admin branch of the page tree, assign it to ACP, and set the template to use to the one you created. This example will display a table of quicklinks. Contents of the dasboard file: <?php wire('modules')->get('MarkupAdminDataTable'); ?> <h3>Title of site here</h3> <div id='ProcessFieldList'> <table id='AdminDataTable1' class='AdminDataTable AdminDataList AdminDataTableResponsive AdminDataTableSortable'> <thead> <tr> <th>Item</th> <th>Comment</th> </tr> </thead> <tbody> <tr> <td><a href='<?php echo $config->urls->admin?>blog/'>Blog</a></td> <td>Filterable/Searchable listing of blog posts.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>news/'>News</a></td> <td>Filterable/Searchable listing of news items.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>projects/'>Projects</a></td> <td>Filterable/Searchable listing of projects.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>page/'>Page Tree</a></td> <td>A hierarchical listing of the pages in your site.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>settings/'>Site Settings</a></td> <td>Global site settings</td> </tr> </tbody> </table> <script>AdminDataTable.initTable($('#AdminDataTable1'));</script> </div><!--/#ProcessFieldList--> You only need this if you want to redirect logins to the dashboard: add to ready.php (where 1234 is the ID of your dashboard page): if($page->template=="admin" && $page->id == 2) $session->redirect($pages->get(1234)->url);3 points
-
Delete is permanent (be careful with that) deletion/removal of that record (from the database)....trash is well, send it to the trash...can be retrieved later in case you change your mind (unless of course you empty the trash, then its deleted)..... http://cheatsheet.processwire.com/ Welcome to the forums2 points
-
It's clearly not just you, but.. nope, they didn't On a (slightly) more serious note, I have to say that after a few years with OS X I would find it very difficult to switch back to Windows. OS X has a bunch of neat features (such as the Spotlight search, which in my case has literally eliminated the need to touch menu items or Finder ever again), but a much bigger benefit is that it's Unix-like. If I need to automate a task or two, can't figure out how to do this or that via the GUI, or just want to get things done without swinging a goddamn plastic rodent all over, I can always just step into the soothing darkness of the console and get shit done. OS X is the next best thing after Linux, and since Linux still doesn't have most of the apps I need, it's the best thing at the moment. The new Surface Book does seem like a splendid machine, of course. Compared to a MacBook Air it looks a bit clunky, but from a strictly technical point of view it does seem quite awesome. If I actually had to get a Windows laptop, this just might be it2 points
-
I missed the XML sitemap generator that I used in a previous CMS so I built my own module to achieve the same functionality. This module outputs an XML sitemap of your site that is readable by Google Webmaster Tools etc. I've generally found that it reduces the time it takes for new sites and pages to be listed in search engines using one in combination with Webmaster Tools etc (since you're specifically telling the service that a new site/new pages exist) so thought I may as well create a module for it. The module ignores any hidden pages and their children, assuming that since you don't want these to be visible on the site then you don't want them to be found via search engines either. It also adds a field called sitemap_ignore that you can add to your templates and exclude specific pages on a per-page basis. Again, this assumes that you wish to ignore that page's children as well. The sitemap is accessible at yoursite.com/sitemap.xml - the module checks to see whether this URL has been called and outputs the sitemap, then does a hard exit before PW gets a chance to output a 404 page. If there's a more elegant way of doing this I'll happily change the code to suit. Feedback and suggestions welcome On a slightly different note, I wanted to call the file XMLSitemap originally so as to be clearer about what it does in the filename, but if you have a module that begins with more than one uppercase letter then a warning containing only the module name is displayed on the Modules page, so I changed it to Sitemap instead which is fine as the description still says what it does. File can be downloaded via GitHub here: https://github.com/N.../zipball/master1 point
-
You can detect whether the current page was loaded from ajax by checking the value of $config->ajax from your template file: <?php if($config->ajax) { // page was requested from ajax } Following that, you will likely want to render the page differently to accommodate whatever you are doing from the javascript side. For instance, you might want do one of these: 1. Deliver alternate or reduced markup when loaded from ajax 2. Deliver a JSON or XML string for parsing from javascript Below are examples of each of these scenarios. 1. Deliver alternate or reduced markup when loaded from ajax You might find checking for ajax helpful when you want portions of pages to load in your site without re-rendering the entire page for each request. As a simple example, we'll use the default ProcessWire site and make it repopulate it's #bodycopy area when you click a page in the top navigation. (To use this example, you'll need the default ProcessWire site templates, though you can easily adapt the example to another situation.) To accomplish this, we'll update our main page template to only include the header and footer markup if the page is NOT being loaded from ajax: /site/templates/page.php <?php if(!$config->ajax) include("./head.inc"); echo $page->body; if(!$config->ajax) include("./foot.inc"); Next we'll update the top navigation to do ajax loads of the pages when the client has javascript (and leave as-is when they don't). Paste this javascript snippet before the closing </head> tag in the header markup file: /site/templates/head.inc: <script type="text/javascript"> $(document).ready(function() { $("#topnav a").click(function() { $("#topnav a.on").removeClass('on'); // unhighlight selected nav item... $(this).addClass('on'); // ...and highlight new nav item $("#bodycopy").html("<p>Loading...</p>"); $.get($(this).attr('href'), function(data) { $("#bodycopy").html(data); }); return false; }); }); </script> Now when you click on any page in the top navigation, it pops into the bodycopy area without a page load visible from your browser. And all pages remain accessible from their URL as well. Note that this is just a test scenario, and I probably wouldn't use this approach for the entire bodycopy area on a production site (it would make bookmarking difficult). But this approach can be very useful in the right places. 2. Deliver a JSON or XML string for parsing from javascript Lets say that you want pages in your site to return a JSON string with the page's id, title, and number of children when it is requested from ajax. When not requested from ajax, they will return their content as normal. To handle the ajax requests, you'd want to add something like this at the top of your template file before any other output. <?php if($config->ajax) { // this is an ajax request, return basic page information in a JSON string $json = array( 'id' => $page->id, 'title' => $page->title, 'numChildren' => $page->numChildren ); echo json_encode($json); return; } // not ajax, continue with regular page output And here is some markup and inline javascript you might use to test the ajax call on some other page (or the same one if you prefer). You would paste this snippet right in your site's markup where you want that info to appear. <ul id='info'></ul> <script type='text/javascript'> var url = '/'; // this is homepage, so replace '/' with page URL you want to load JSON from $(document).ready(function() { $.getJSON(url, function(data) { $.each(data, function(key, value) { $("#info").append("<li>" + key + ": " + value + "</li>"); }); }); }); </script> The above snippet would output something like this: • id: 1 • title: Home • numChildren: 5 To take this example further, you could build an ajax-driven sitemap or any number of web services. Conclusion Hope this helps you to see how simple it is to use ProcessWire to deliver output for ajax. These are just contrived examples, but hopefully examples that might lead to more ideas. In addition, much of what you see in these examples is also applicable to building web services in ProcessWire.1 point
-
Hi guys, I've been doing events sections for a few sites and for each I needed to make an iCal feed. I've wrapped up this functionality into a module now to make it a little easier for myself and anyone else that needs to make these feeds. The module is basically a simple wrapper around the iCalcreator library (a copy is included). It's modelled on the MarkupRSS module from Ryan, so anyone familiar with that should have a feed up and running in no time. Usage The module takes a PageArray and creates the feed from that. The [tt]->render[/tt] method will send the output to the browser with a generated filename and will automatically download. Because it will return HTTP headers, it has to be included before any html and is best in its own template or followed up by [tt]exit;[/tt] <?php $today = time(); $items = $pages->find("template=event, sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Some upcoming events"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $ics->render($items); You can use the [tt]->renderFeed[/tt] method to return the output as a string instead, which is particularly useful if you want to debug or write the output to a file. <?php $today = time(); $items = $pages->find("template=event, sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Some upcoming events"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $cal = $ics->renderFeed($items); echo $cal; I often put RSS and iCal feeds at the top of my listing pages so as not to clutter up the site tree with extra templates. This way /events/ may point to my events page, and /events/ical will point to it's feed. Here is an example: <?php // iCal feed if ($input->urlSegment1 == "ical") { $today = time(); $items = $page->children("sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Upcoming events for my company"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $ics->url = $page->httpUrl; $ics->render($items); exit; } // Render the template as normal. include("./includes/head.inc"); Download and feedback You can download or fork the module here: https://github.com/f...MarkupiCalendar At the moment it only supports all day events (as these are all I have dealt with) but I hope to add time based events soon. Any feedback is warmly appreciated and feel free to report bugs or suggestions for improvement. Stephen1 point
-
i just had to install a site-profile and i thought it would be handy if there was a field to upload the site-profile.zip during installaton. would make things easier than explaining how to upload things to the server and then extract it to the right place etc... of course just a little improvement but may be helpful for newbies. what do you think?1 point
-
You can also install my ProcessPageAdmin module to do this https://github.com/ocorreiododiogo/ProcessHomeAdmin1 point
-
1 point
-
Wicked work, some serious design talent. Noticed one thing with the glow on :focus for input boxes in chrome shows up as a blue square outside of the newsletter signup input. Setting the tapered class to the input seemed to fix the styling here for me.1 point
-
Only on mobile... Love it! Great design and well organised. Welcome and happy processwiring1 point
-
There was a good discussion about templates here: https://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/1 point
-
Looks great. I like the colors and the overall design. Just a minor thing I noticed: The "wall runner" tab on the homepage doesn't seem to have a active state color, while the other tabs do have one.1 point
-
Thanks, Diogo! Brilliant idea This way I realized that I somehow mixed up the stylesheets. My contents-inline.css was basically the same like contents.css. Don't know how this happened I've copied now the right one out of the wire-directory and the bullet-points show up. Just a few small changes yet and we are ready to go Thanks again!1 point
-
1 point
-
I like the pure php style to output more, because it's not filled by all those open and close tags. The essential thing is that $page->images is always equal to true, as it's an pageimages object. You need to check for the action number of images: <?php foreach($page->repeater as $box) { //if there are images uploaded output images if($box->images->count()) { echo '<div class="box images">'; echo $box->images->implode("<img src='{url}'/>"); echo '</div>'; }else{ // maybe }else if($page->text){ //if not only output text echo '<div class="box text">'; echo $box->text; echo '</div>'; } }1 point
-
If it wasn't for mobile app development I probably never would have made the switch to Mac, but now that I have, I probably won't go back, just because of the UNIX base and also because I am now comfortable with the toolset I am working with. That doesn't mean I am thrilled by Macs - in my mind they are just a different set of problems1 point
-
Hi @gebeer - I can certainly add an option like that, but I am curious about the behavior you are seeing - is it a multi-language issue? When I change the title of the homepage, the path to it and all child pages does not change because the name of the home page is never used in the URL. Maybe I should add a checkbox to the Settings tab of all pages to disable name changes when checked?1 point
-
I always set the title/name of the homepage and after that i go to >template>home>fieldsetttings for title and set visibility to locked...so this page name is save. I do the same for "critical" content pages like news, events, contact....and so on. regards mr-fan1 point
-
See, this is what I love about ProcessWire. I was just in a meeting, and the question came up whether it was possible to export a list of events and dates as a calender, i.e. in iCal format. I wasn't sure about it, but I took a wild guess that there would be some way to do this. Back at home, checked the modules page, BAM, there you go. For someone like me who is not able to do "real" PHP coding, this is a life saver. Thank you so much.1 point
-
Ryan, Many thanks for this module, I just used it to add 436 users. There were a small handful of things that weren't initially clear, so I detailed them below for anyone else trying to import users. If you plan to import passwords, you need to open the module and add FieldTypePassword to $fieldtypes protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypePassword', // add this line ); Since users are pages and all pages require a title, your CSV will need to have a title column. In my case, I duplicated all the usernames into that column — so name and title are the same. In order for title to show as a connection option during your import, you need to add the title field to the user template file. To do this, go to: Setup > Templates (open the filters area at the top, and choose "show system templates". Select the user template and add the title field. One other thing to note, be sure to have a roles column in your CSV with roles for each user. I forgot that during my first test import and all the users were set to guest. You should be all set to import your users.1 point
-
Hi Ryan, When adding and editing siblings, going back and forth to the page tree seems to slow down the process quite a bit. What if there were links to some common things like: prev, next, add new (or add sibling) when you are in edit mode? I attached a quick mockup, not necessarily for placement purposes, just as a visual aid. I'm still very new to PW, so there might be better methods already, just thought I would throw this out there as a feature request.1 point