Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/12/2012 in all areas

  1. The ProcessWire equivalent of the suggested code that I just added to StrategyCore is: <meta name="generator" content="ProcessWire <?php echo $config->version ; ?>" /> <!-- This website is powered by ProcessWire ProcessWire is a free open source Content Management System created by Ryan Cramer and licensed under the GNU/GPL. ProcessWire is copyright <?php echo date('Y', time()); ?> by Ryan Cramer. Modules are copyright of their respective owners. More information can be found at http://www.processwire.com --> There's a bit of PHP in there to always show the latest PW version that's running, as well as the current year in the copyright line. @ryan - would you suggest any changes to that?
    4 points
  2. Still frustrated by the all too real objections of Ryan came into my mind that PW applies more to developers than ordinary surfers. Then the source should be as relevant as a banner at the bottom of the page. So I suggest that there is a recommendation for an equivalent to <meta name="generator" content="TYPO3 4.5 CMS" />. Also, a comment like <! - This website is powered by TYPO3 - inspiring people to share! TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under the GNU / GPL. TYPO3 is copyright 1998-2012 of Kasper Skaarhoj. Extensions are copyright of their respective owners. Information and contribution at http://typo3.org/ -> at the top of the page can be useful. It is clear that in contrast to PW Typo3 here can not make provisions which can at best be overwritten. But Ryan may make a recommendation.
    4 points
  3. Some recent additions for 2.3 that are now in the dev branch (I could use help testing if anyone has time): Added "required" support to all fields I've enabled required field support for all fields in ProcessWire (no need for advanced mode either). Now you get a "required" checkbox on the "input" tab of any field in Setup > Fields > [field]. If you are dealing with a published page and save it, you'll get an error if any required fields are blank. The page will still be saved. So it's more of something to annoy you into completing the required field. But if you are dealing with an unpublished page, it won't let you publish it (in the page editor) until you complete all required fields. While seemingly a small thing, the scope is more broad than it sounds as it applies to a lot of different Inputfields. I could use help testing this one out to make sure I haven't missed anything or introduced any new side effects or issues anywhere in ProcessWire. Other additions Fieldsets can now take advantage of column widths, enabling you to have multiple fields in a column. Fixed some bugs that occurred with fieldsets in tabs and fields getting brought into fieldsets they weren't supposed to. Add Interrobang's PHPdoc comments. Add ability to disable PW from throwing an exception when you call an unknown method (for porl's Twig module and other future ones like it). Clean up and optimize the /wire/templates-admin/styles/inputfields.css - it had some redundancy before. Also added a style to call out required fields. Other admin themes may want to do something similar (see the InputfieldStateRequired style in that file). Some other small things in the commit log (Apr 07-Apr 12)
    3 points
  4. Good idea. I will plan to add this to the default profile too and we can recommend that people include the generator tag in their own sites...perhaps as a prerequisite to being listed in the upcoming PW site directory? This would make sense so that if the generator tag ever changes we know the site is probably not running PW anymore and shouldn't be linked from the directory.
    2 points
  5. I don't want to sound too strange, but I've been watching that header animation for almost ten minutes now. With inspect tools opened. Drooling a bit. Absolutely brilliant stuff! Oh, and the rest of the site is very nice too
    2 points
  6. Just updated the Module to version 1.1 on Github and Modules Section of Pw! New Features / Optimizations Better UI with tabs for the main categories (Audience, Content, Traffic sources) New options section: You can change the date range for your Statistics "strftime" used instead of "date" for the date range in header Fixed PHP notice errors There changed some module default config options + I added an option to set the format for the InputfieldDatetime fields. So I guess you should uninstall and install the whole module again to avoid errors. Sometimes I'm not sure if use the right words for my lables and descriptions, as I'm not a native english speaker/writer. So if anybody sees typo errors or a description that makes no sense, please tell me. I ended up using WireTabs, amazing simple to implement as everything with Processwire! =) Wish you all a nice day (night or whatever), I'm going swimming now here : http://www.bbc.co.uk...europe-10893835
    2 points
  7. One of the ways you can show support for ProcessWire is to help get the word out by including a small "Powered by ProcessWire CMS" tagline (ideally linking to processwire.com) in the footer of sites that you develop. This is a big help to the ProcessWire project. But I know there are many cases where it just doesn't work to do that because the client thinks of it as gratuitous. I think it's important to communicate to your client that it's not gratuitous at all. It is doing the right thing by showing appreciation and support for a software that is running their site at no cost. Even so, it's not always as simple as that, and I completely understand. We have no requirement or expectation that sites developed in ProcessWire do this. We just encourage and appreciate it when you can. Let your client decide One thing I've been doing lately is to put the control into my clients hands. They really appreciate that I've given them control over it… more so than if I'd left out mention of ProcessWire completely. It also makes them feel good as they are the one showing support, not just their site developer. Here's how to do it in 1 minute: 1. Create a new "checkbox" field in Setup > Fields called "toggle_powered" (or whatever you want to call it), and enter the following for label and description: 2. Add the "toggle_powered" field to your homepage template. 3. Edit the homepage and check the box (if possible in your situation). 4. Edit the template file or include file that contains the site footer and paste in the following: <?php if($pages->get('/')->toggle_powered): ?> <p> <a id='processwire' target='_blank' href='http://processwire.com'>Powered by ProcessWire Open Source CMS/CMF</a> </p> <?php endif; ?> The code above is an example, so adjust the markup, size, wording and placement to suit the site.
    1 point
  8. I thought I'd share a little project I'm working on. Launched the new website for a colleague that has a local cycling delivery service. It's very simple website and is an ongoing project, changing and adding stuff over time. As always it was very easy to setup in PW and he loves the admin to edit his stuff. Previously it was using Limbo and I refused to further use that horrible system. Now using PW it opens up a whole world of possibilities. http://velokurier.com
    1 point
  9. Hehe, not strange that's what we all do sometimes. Glad you like it, I also watched it for hours I think. PS: Don't tell anybody, I activated my, during developement, present and made an eastern egg. Press ctrl+1 Not sure it works in every browser/system though.
    1 point
  10. @ryan - added .module to my PHP pattern and all is well, IDE and more importantly me ... happy again
    1 point
  11. Hah, what a Muppet - you have to install it through the Module's panel! Woot! I'm having (many) Senior Moment(s)
    1 point
  12. PW uses the .module extension for the same reason Drupal does... so that the file can quickly be identified (by PW's module loader) as a file containing a plugin module rather than some other PHP file. We've had a request to make it also support .module.php, so will likely be adding this shortly in the dev branch. But for now my suggestion would be to set your editor to recognize .module as a PHP file. For instance, I use VIM and place this in my .vimrc file: set nowrap syntax on au BufRead,BufNewFile *.module set filetype=php
    1 point
  13. Hmm for some reason the module could not fetch the statistics. I need to implement a check if the results are returned correctly as an array and display an error message otherwise. Sevraf2, were you able to choose the GA Account from the dropdown before? Have you customized the date range or any date format settings? Can you do some checks in the module config options: Client ID, Client Secret, API Key correct? Google Analytics Account Id should now have a value like "ga:xxxxxxxx" @Soma I have debug mode enabled, but the statistics always came up fine ;-) Will implement the check soon!
    1 point
  14. Not sure what exactly you're doing but you could create a modules that is autoloaded and provides functions to use everywhere in PW. Something like this: class HelpersModule extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Helper Functions', 'version' => 100, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true ); } public function init() { $this->setFuel("helpers", $this); } public function getPosts() { return wire("pages")->get("/posts/")->children(); } } Then you can do in your templates: $posts = $helpers->getPosts(); There's variations of this but it should be simple to do. Also you could also make it not autoload and load it on demand. $helpers = $modules->get("HelpersModule"); // load module $posts = $helpers->getPosts(); Edit: wow everytime I edit the post the indentation get lost, that's new to me and pretty annoying...
    1 point
  15. See the $session variable. You can store objects, but always have to be careful, like with objects that may reference others and ensuring those object's class definitions are present before they are instantiated in the session. ProcessWire's $session isn't much more than a wrapper on top of PHP's $_SESSION, and you can still use PHP's $_SESSION if you want to. More about objects in sessions here. Personally, I prefer to recreate objects myself on each request. It should be possible to do what you are asking to do but the details of it will be PHP-specific rather than ProcessWire-specific.
    1 point
  16. Soma "Then you create custom page fieldtype "categories_selected" that has set /Categories as the parent and allow multiple pages" This was when the "penny dropped"! It appears exactly how I want it to in my "image_meta" repeater field! Now just some playing around with the querying and I'm done. Thank you so much! You too Martijn! --Gary
    1 point
  17. Highest page count I've seen on a production site so far is 30k+ and that site runs just fine. All things considered I wouldn't be too worried -- PW is surprisingly resilient There's an earlier thread with almost the same question that you really should read; in his reply Ryan explains some of the things you need to consider when building a (very) large site: http://processwire.com/talk/topic/1527-largest-project-performance-multi-server/#entry13779. That performance issue Soma mentioned is discussed further here: http://processwire.com/talk/topic/1508-performance-problem-possibly-a-bug-in-pages-class/ (and yes, related problem / bottleneck has already been fixed.)
    1 point
  18. Hi! I just finished the first release of my first PW module: Piwik Top Keywords: https://github.com/f...ik-Top-Keywords This module can be used to create a tag cloud based on the keywords that visitors use to find your site (referrer keywords). These keywords are fetched from your Piwik installation. For those that don't know Piwik, it's an open source alternative for Google Analytics, more info on http://piwik.org. The keywords are, as a query, linked to ProcessWire's search page.* The module can be configured from the admin area, but it's also possible to configure it in your template. In order to reduce the load on your Piwik installation and avoid delays when rendering your pages, it makes sense to use it on cache enabled templates only. I am sure that the code can be improved, since it is my first module and because of the fact that I am not an experienced PHP developer. If you have any suggestions, please let me know. To Install: 1. Download the file attached (PiwikTopKeywords.module) to this post and place in /site/modules/. Go to Modules in the admin, 'Check for new modules' and click install for Piwik Top Keywords under the Piwik section. 2. Add the following to your CSS style sheet: #PiwikTagcloud {list-style-type:none; margin:0px; padding:0px; text-align: center;} #PiwikTagcloud li {display:inline !important; margin-right:15px; line-height:1.5em;} #PiwikTagcloud li a {display:inline; text-decoration: none;} #PiwikTagcloud a:hover {text-decoration: underline;} #PiwikTagcloud .smallest {font-size: 100%;} #PiwikTagcloud .small {font-size: 125%;} #PiwikTagcloud .medium {font-size:150%;} #PiwikTagcloud .large {font-size:170%;} #PiwikTagcloud .largest {font-size:200%;} To use: Add the following to your template: $PiwikTopKeywords = $modules->get("PiwikTopKeywords"); $PiwikTopKeywords->DisplayTopKeywords(); I also attached a screenshot of the output and a screenshot of the admin area: I'm not sure how many of you use Piwik and how many will use this module, but if it's helpful to anyone I am more than happy! //Jasper * Edit: I just realised that is your site doesn't have a search page, you might want to link the keywords to a Google site-search. Simply use the following Search URL in the config: http://www.google.com/#q=site:yoursite.com+
    1 point
  19. Hi Jasper, I noticed a little typo. Tried to change it via git. As I'm totally new to github, I'm not sure if I did the right thing. Anyway: line 74 says piwik_max_kewords i/o piwik_max_keywords That's all Cheers, J
    1 point
  20. Not sure if there is a limit other than your hardware. Depends what those 5000 pages are doing but I see no problem at all even without cache. It's much faster than MODX. If you take care of what you do with queries in templates and maybe use partial markup cache for heavy queries I think you can do a very performant website within the hundred thousands easily only really limited on performance of the server PW is quite optimized. Anyway it has never really been tested how far you could go but I heard about sites in the twenty+ thousands and they still seem to be fine. Just recently there happened to be some issue with large scale when saving pages and already got more optimized.
    1 point
  21. 1 point
  22. I just added it to a german site. Maybe you want to incorporate a german translation. ProcessWire im Fuß anzeigen? Wenn deaktiviert, wird der kleine "Powered by ProcessWire"-Slogan nicht in der Fußzeile erscheinen. ProcessWire ist Open Source und freie Software. Dieses Kontrollkästchen aktiviert zu lassen, ist eine Möglichkeit, Ihre Wertschätzung und Unterstützung zu zeigen. Das ProcessWire-Entwicklungs-Team bittet darum, soweit möglich, im Austausch für die Verwendung der Software. Allerdings ist es Ihre Entscheidung und kein Muss. BTW: I also learned something: How to set an option only once for the home page is valid for the whole site.
    1 point
  23. Is the ProcessWire logo somewhere available in vector or high resolution so people can make a powered by ProcessWire logo.
    1 point
  24. This should be included in default installation
    1 point
  25. Here's what draws the form for the skyscrapers search: <form id='skyscraper_search' method='get' action='<?php echo $config->urls->root?>search/'> <h3>Skyscraper Search</h3> <p> <label for='search_keywords'>Keywords</label> <input type='text' name='keywords' id='search_keywords' value='<?php if($input->whitelist->keywords) echo htmlentities($input->whitelist->keywords, ENT_QUOTES); ?>' /> </p> <p> <label for='search_city'>City</label> <select id='search_city' name='city'> <option value=''>Any</option> <?php // generate the city options, checking the whitelist to see if any are already selected foreach($pages->get("/cities/")->children() as $city) { $selected = $city->name == $input->whitelist->city ? " selected='selected' " : ''; echo "<option$selected value='{$city->name}'>{$city->title}</option>"; } ?> </select> </p> <p> <label for='search_height'>Height</label> <select id='search_height' name='height'> <option value=''>Any</option> <?php // generate a range of heights, checking our whitelist to see if any are already selected foreach(array('0-250', '250-500', '500-750', '750-1000', '1000+') as $range) { $selected = $range == $input->whitelist->height ? " selected='selected'" : ''; echo "<option$selected value='$range'>$range ft.</option>"; } ?> </select> </p> <p> <label for='search_floors'>Floors</label> <select id='search_floors' name='floors'> <option value=''>Any</option> <?php // generate our range of floors, checking to see if any are already selected foreach(array('1-20', '20-40', '40-60', '60-80', '80+') as $range) { $selected = $range == $input->whitelist->floors ? " selected='selected'" : ''; echo "<option$selected value='$range'>$range floors</option>"; } ?> </select> </p> <p> <label for='search_year'>Year</label> <select id='search_year' name='year'> <option value=''>Any</option> <?php // generate a range of years by decade, checking to see if any are selected for($year = 1850; $year <= 2010; $year += 10){ $endYear = $year+9; $range = "$year-$endYear"; $selected = $input->whitelist->year == $range ? " selected='selected'" : ''; echo "<option$selected value='$range'>{$year}s</option>"; } ?> </select> </p> <p><input type='submit' id='search_submit' name='submit' value='Search' /></p> </form> And here's the code that processes it and performs the search: <?php /** * This template looks for search terms as GET vars and formulates a selector to find matching skyscrapers * */ // most of the code in this template file is here to build this selector string // it will contain the search query that gets sent to $skyscraperList $selector = ''; // we use this to store the info that generates the summary of what was searched for // the summary will appear above the search results $summary = array( "city" => "", "height" => "", "floors" => "", "year" => "", "keywords" => "", ); // if a city is specified, then we limit the results to having that city as their parent if($input->get->city) { $city = $pages->get("/cities/" . $sanitizer->pageName($input->get->city)); if($city) { $selector .= "parent=$city, "; $summary["city"] = $city->title; $input->whitelist('city', $city->name); } } // we are allowing these GET vars in the format of 999, 999-9999, or 999+ // so we're using this loop to parse them into a selector foreach(array('height', 'floors', 'year') as $key) { if(!$value = $input->get->$key) continue; // see if the value is given as a range (i.e. two numbers separated by a dash) if(strpos($value, '-') !== false) { list($min, $max) = explode('-', $value); $min = (int) $min; $max = (int) $max; $selector .= "$key>=$min, $key<=$max, "; $summary[$key] = (substr($max, 0, 3) == '999') ? "$min and above" : "$min to $max"; $input->whitelist($key, "$min-$max"); // see if the value ends with a +, which we used to indicate 'greater than or equal to' } else if(substr($value, -1) == '+') { $value = (int) $value; $selector .= "$key>=$value, "; $summary[$key] = "$value and above"; $input->whitelist($key, "$value+"); // plain value that doesn't need further parsing } else { $value = (int) $value; $selector .= "$key=$value, "; $summary[$key] = $value; $input->whitelist($key, $value); } } // if there are keywords, look in the title and body fields for the words. Note in our selector // we are using the "~=" operator, rather than the "*=" operator, which means that we want to // match all the words, but they don't have to be in a phrase right next to each other. if($input->get->keywords) { $value = $sanitizer->selectorValue($input->get->keywords); $selector .= "title|body~=$value, "; $summary["keywords"] = htmlentities($value); $input->whitelist('keywords', $value); } // display a summary of what was searched for above the search results $content = "<ul id='search_summary'>"; $browserTitle = "Skyscrapers - "; foreach($summary as $key => $value) { if(!$value) continue; $key = ucfirst($key); $content .= "\n\t<li><strong>$key:</strong> $value</li>"; $browserTitle .= "$key: $value, "; } $content .= "\n</ul>"; $skyscrapers = $pages->find($selector); $content .= $skyscrapers->render(); // substitute your own output code $browserTitle = rtrim($browserTitle, ", "); $headline = "Skyscraper Search"; include("./main.php");
    1 point
×
×
  • Create New...