Leaderboard
Popular Content
Showing content with the highest reputation on 02/28/2014 in all areas
-
MultiPage Editor is a module that takes any valid ProcessWire selector and shows you all matching pages. You can edit all fields from one page, thus being perfect for bulk editing things like product pages or lists. It works best when selecting on template, because all pages will have the same fields. How to install: Download from: https://github.com/weworkweplay/ProcessMultiPageEditor Place the file ProcessMultiPageEditor.module in your /site/modules/ directory. In ProcessWire admin, click to 'Modules' and 'Check for new modules'. Click 'install' next to the 'MultiPage Editor' module (under heading 'Process'). Following that, you'll see a new menu option for this module on your Admin > Setup menu. Please note that the module currently only shows FieldtypeText-fields. This is something that probably needs some work.9 points
-
So, just before the weekend, I've uploaded a new version (3.1.1) that supports a new feature: Conditional loading. You can now assign CSS, LESS or JS files with an API-selector a condition at which they should be loaded. For example: <?php $stylesheets = array('css/reset.css', 'css/main.less', array('loadOn' => 'id|template=1002|1004|sitemap', // PW API selector 'files' => array('css/special.css', 'css/special-theme.less'))); ?> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS($stylesheets); ?>" />9 points
-
JSON Installer is a module that allows you to define installer scripts in JSON. The module has proven its use when either setting up a big website for a client (it's easier to type all pages in a JSON-file than to create them all with the click-heavy ProcessWire admin) or doing repeated tasks. At We Work We Play we always do the same kind of setup (create a configuration page, add SEO & sharing fields, an 'Under Construction'-toggle) so this module automates this for us. Huge timesaver. How to install: Download from: https://github.com/weworkweplay/ProcessJSONInstaller Place the file ProcessJSONInstaller.module in your /site/modules/ directory. In ProcessWire admin, click to 'Modules' and 'Check for new modules'. Click 'install' next to the 'JSON Installer' module (under heading 'Process'). Following that, you'll see a new menu option for this module on your Admin > Setup menu.7 points
-
Every time a new PW site goes live, an angel gets their wings! I am so pleased to announce this one: UW Undergraduate Advising This is my fourth professional PW site, and the largest. It manages information about more than 100 different majors at the UW, their associated departments, related courses, schools, colleges, and subjects. And a handful of people and a LOT of text. It's basically a manual to pursuing an undergraduate degree at the University. And PW was a JOY to work with. It kept up with everything I threw at it, gracefully and effortlessly. I cannot praise this software highly enough. Thank you Ryan and everybody that is keeping this thing cooking. Best wishes, Jenn6 points
-
Hi Guys, Based on some feedback I decided to favour the AIOM+ module over the Minify module, which means I no longer need the less compiler in Spex, I also removed all other 3rd party libraries to make it less opinionated. Starting with v0.8.0 the Spex module no longer bundles less.js, less.php, modernizr and jquery. Spex is actually a lot less code now which is fine by me. Check out the base template now: https://github.com/jdart/Spex/blob/master/example-site/layouts/_base.php vs before: https://github.com/jdart/Spex/blob/0dd56629232d68be4f6248555caf47f6972dad87/example-site/layouts/_base.php3 points
-
echo $page->documents->description; should work just fine. I think it is likely your documents field is set to handle more than one image, so you will need: echo $page->documents->first()->description; I just did a little testing a noticed something slightly unexpected. When there is one image in the field you get: echo $page->documents; //selfie.jpg echo $page->documents->first(); //selfie.jpg echo $page->documents->url; //site/assets/files/xxxx/ echo $page->documents->first()->url; //site/assets/files/xxxx/selfie.jpg echo $page->documents->first()->description; // image description echo $page->documents->description; // blank With two images in the field, you get: echo $page->documents; //selfie.jpg|selfie2.jpg So I guess I had never noticed that you actually get the filename returned from a files array. I would have expected an error with: echo $page->documents;3 points
-
Hi everyone, I've made a snippet update for the bootstrap 2.2.2 navbar by Soma to Bootstrap 3.x. I also added a multi level menu fix since it was removed from Bootstrap 3. Screenshot: topnav_inc <?php /* Navigation for ProcessWire using the Bootstrap 2.2.2 markup This menu was written by Soma based on work by NetCarver and a bit thrown in by Joss Navigation Bootstrap 3 update by Damienov, with multi level dropdown support fix */ function renderChildrenOf($pa, $output = '', $level = 0) { $output = ''; $level++; foreach ($pa as $child) { $atoggle = ''; $class = ''; if ($child->numChildren && count($child->parents) == 1) { $class .= 'dropdown'; $atoggle .= ' class="dropdown-toggle" data-toggle="dropdown"'; } else if ($child->numChildren && count($child->parents) > 1 ) { $class .= 'dropdown-submenu'; $atoggle .= ' class="dropdown-toggle"'; } else if ($child->numChildren && $child->id != 1) { $class .= 'dropdown-menu'; } // Makes the current page and it's top level parent add an active class $class .= ($child === wire("page") || $child === wire("page")->rootParent) ? " active" : ''; $class = strlen($class) ? " class='" . trim($class) . "'" : ''; if ($child->numChildren && count($child->parents) == 1) { // Add Caret if have children $output .= "<li$class><a href='$child->url'$atoggle>$child->title <b class='caret'></b></a>"; } else if ($child->numChildren && count($child->parents) > 1) { $output .= "<li$class><a tabindex='-1' href='$child->url'$atoggle>$child->title</a>"; } else { $output .= "<li$class><a href='$child->url'$atoggle>$child->title</a>"; } // If this child is itself a parent and not the root page, then render it's children in their own menu too... if ($child->numChildren && $child->id != 1) { $output .= renderChildrenOf($child->children, $output, $level); } $output .= '</li>'; } $outerclass = ($level == 1) ? "nav navbar-nav" : 'dropdown-menu'; return "<ul class='$outerclass'>$output</ul>"; } // bundle up the first level pages and prepend the root home page $homepage = $pages->get(1); $pa = $homepage->children; $pa = $pa->prepend($homepage); // Set the ball rolling... echo renderChildrenOf($pa); Add to your CSS /* Bootstrap 3 navbar with multi level fix */ .dropdown-submenu{ position:relative; } .dropdown-submenu > .dropdown-menu { top:0; left:100%; margin-top:-6px; ; -webkit-border-radius:0 6px 6px 6px; -moz-border-radius:0 6px 6px 6px; border-radius:0 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu{ display:block; } .dropdown-submenu > a:after{ display:block; content:" "; float:right; width:0; height:0; border-color:transparent; border-style:solid; border-width:5px 0 5px 5px; border-left-color:#cccccc; margin-top:5px; margin-right:-10px; } .dropdown-submenu:hover > a:after{ border-left-color:#ffffff; } .dropdown-submenu .pull-left{ float:none; } .dropdown-submenu.pull-left > .dropdown-menu{ left:-100%; margin-left:10px; -webkit-border-radius:6px 0 6px 6px; -moz-border-radius:6px 0 6px 6px; border-radius:6px 0 6px 6px; } note: My php skills are crappy , so feel free to add some fixes on the code2 points
-
Over in the uk, Cute used like this is saying it is good. Possibly a London thing ... not sure.2 points
-
Hopefully DJ Cramer will kick out the jams and restart this party. I'm all dressed up, standing on an empty dance floor. *crickets*2 points
-
You would even save more time when creating a profile of your basic setup. Next time install it with the profile and you're ready.2 points
-
2 points
-
What's stopping a client from opening devtools? If clients care enough to look at source code and actually base an opinion (negative or positive) on that, i think they are well aware of optimizations like minimize and they actually applaud you for that, or you could tell them: "we minimize (and concatenate) the output for optimal performance, especially on mobile". Keeping cr/lf in there seems an in-between, for no real reason. To me minimize means minimize, but to each it's own i guess.1 point
-
Well the definition of cute that I remember from my Aussie upbringing was: "Ugly, but interesting" Glad we got that cleared up1 point
-
Doesn't this kind of defeat the purpose of minimizing your html? If you want to look at nicely formatted source every browser nowadays has a good or decent devtools/inspector.1 point
-
Get the image, then echo its description...e.g. $images = $page->photos->find("sort=name"); foreach ($images as $image) { echo $image->description; } The above assumes multiple images/array...if not, just echo directly without foreach. Code also assumes you have a field called photos. The code can be shortened too - so you are on the right track but probably need to iterate an array... http://processwire.com/api/fieldtypes/images/ Edit: Adrian was faster1 point
-
A couple of options from Soma for achieving this: http://processwire.com/talk/topic/3159-hide-settings-tab-in-page-edition/?p=31126 http://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/?p=457341 point
-
Have you edited the access permissions for the settings page template? You can change whether a particular role can edit, view, create pages based on template or add children. Delete is something you can do globally for the role it self If you need to mix and match permissions, you can add more than one role to any user. So you can set different roles to have different permissions depending on template, the just add those roles to a user as you need.1 point
-
Yes, my way round it previously has been to make parent items nothing. You can actually add a bit of code so that that if an item has children then $childUrl beomes # I added this to a foundation version (based on a later version of the bootstrap menu, I think - cant quite remember now) $has_children = count($child->children) ? true : false; if($has_children && $child !== $root) { $class .= 'has-dropdown'; // sub level Foundation dropdown li class $childUrl = "#"; // stop parents being clickable } else { $childUrl = $child->url; // if does not have children, then get the page url } But repeating the parent item as a child would be the ultimate - then use media queries to show or not to show. That way you can preserve your tree structure but still have it work. I have to say, I am tending to avoid complicated menus entirely now.1 point
-
If you managed to solve it, could you perhaps post your solution to be marked as the answer?1 point
-
@Manol, If it was me I'd look at getting a custom module written. I've used something similar for ExpressionEngine which really takes the load off the site - especially when it comes to site backups. The only problem is that it doesn't delete files from S3. I'm not sure if that's a limitation with the plugin or S3, but I know there's a few GB of files up there that aren't being used.1 point
-
Hey Pierre, I'm not really happy with Assetic for several reasons: Too many dependencies. Java-based YUI integeration. Many shared hosting do not offer Java support. Depending on the Google Closure API. I don't wanted to integrate any third party service. Node.js for LESS parser, because the PHP-ported version in Asettic is outdated and is no longer developed and supported. In summary, you could not just use AIOM+ as it is now – install and use. AIOM+ requires only PHP and is not dependent on another service or special server requirements.1 point
-
1 point
-
For those interested, this one http://zedapp.org/ that works as a chrome app and is a quite an interesting project.1 point
-
Just deployed a new PW site for a contemporary classical composer: http://www.jonathandawe.com/ AIOM Formbuilder ProCache Redirects MapMarker ImportPagesCSV MarkupSimpleNavigation Hanna Code Version Control Audio plugins used: Soundmanager2, 360 player with visualizer Fancy Music Player And thanks to the combination of AIOM, Procache and Cloudflare, the site seems to be very fast, gets a yslow of 96-98; Homepage Here is the sm2 circle player example with vis, overlaid on a relevant image: [goodbye joomla....!]1 point
-
I have no idea. Probably some tricks soma is doing again, and reno is following blindly (as usual)...1 point
-
It's not necessary here, as ProcessWire doesn't include the http host with url() calls... just the path. So you can prepend the http host yourself, or make a custom function to do it for you. For example, you make an uppercase "URL" property to refer to your own version: wire()->addHookProperty('Pagefile::URL', function($event) { $event->return = "http://www.domain.com" . $event->object->url; }); Usage: <img src="<?=$page->image->URL?>">1 point
-
I would use the config options in site/config.php for including functions (ver. 2.2.3+ i think, maybe it's 2.3+)... /** * prependTemplateFile: PHP file in /site/templates/ that will be loaded before each page's template file * * Uncomment and edit to enable. * */ $config->prependTemplateFile = '_in.php'; /** * appendTemplateFile: PHP file in /site/templates/ that will be loaded after each page's template file * * Uncomment and edit to enable. * */ $config->appendTemplateFile = '_out.php'; In _in.php you can set up things that need to happen for each template. The nice thing about this option is not having to use an include statement on each of your template files. In my _in.php example below I'm initializing fredi and including functions. That's about all I'm using _in.php for. $fredi = $modules->get("Fredi"); include("./includes/functions.php"); Your approach is a nice one. You could also wrap ob_start around all output and gzip it. PW may already do the gzipping, I don't know. //compress the output for faster page loads ob_start("ob_gzhandler"); //output from your includes needs to be sent back with a return //e.g. return $html_string; or return $data as an array $body[] = include './teaser.php'; $body[] = include './pager.php'; $page->body = implode("\n",$body); //you can also use file_get_contents on a public url //(but you'll need to bootstrap PW if you need access to $page,$pages, etc.) //e.g. file_get_contents('http://www.mysite.com/my_php_include.php'); //depending on needs, maybe easier just to... //include './teaser.php'; //include './pager.php'; //$page->body = ob_get_contents(); //ob_clean include './main.php'; ob_get_clean(); Here's what the contents of teaser.php could look like... //this gives you some flexibility to format data as you wish and is helpful if you want agnostic data //you can also use this approach to create your own template system. (e.g. regex replacement {{body}} with $page->body) switch ($input->urlSegment1) { case "csv": //format data for cvs, save to file, provide download link break; case "xml": //format data for xml break; default: //format data for html foreach ($page->children as $a) { $data[] = "<li><a href=\"#{$a->$name}\">{$a->title}</a></li>"; } return "<ul>" . implode("\n",$data) . "</ul>"; } And while you are at it, maybe the better approach is to put ob_start("ob_gzhandler"); in _in.php and ob_get_clean(); in _out.php. Really just depends on what you want to do, but you can see how damn cool PW is.1 point
-
As a brief answer before getting perhaps a more complete one from one of the more advanced PW crew If each user had a login and also their own page under say a template "client", you could make sure that only they can see their general client page by checking if their $user->name and the $page->name are the same, if it is, you are safe to output their content as only they will get to see the page content. Something like: if ($user->name === $page->name) { // show all the pictures and other member stuff } else { throw new Wire404Exception(); } This is all quite basic and you could turn on urlSegments so that you could have gallery on an additional page. Again only those who have the credentials to get to the client page will see the pages beneath it. I've used this method to create whole member areas, if you're interested I'll share with you what I did. In terms of the actual images that will be stored somewhere in assets/files/... you'll want to protect them somehow (unless protecting through obscurity is enough for your purposes) but will have to let one of the more advanced users advise on this. EDIT: To sum up, you could have the following page tree: Home About Clients (clients template) -- Joe Bloggs (client template) -- Jane Bloggs (client template) One thing that can get annoying is having to make sure you're creating both the user and the page and that they share the same name. As my editor was the person adding clients, I made a simple front end template for them to add clients through which created the user and the page at the same time. You could also just extend the built-in user template to add images and use that but I've found that in the long run having non user pages is more flexible for outputting data.1 point