Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/30/2015 in all areas

  1. I´m building a Markup Patternlab for my company to make it easy for our Devs and Graphic Designers to speak about the same elements and force them to produce reusable code. This is a little side project of mine because i have to manage some freelance designers, devs and our inhouse designers and devs. So this Patternlab is also serving as corporate styleguide once finished. If im allowed I will publish the whole App for the comm. Have a look:
    12 points
  2. This ProcessWire module allows you to import and parse XML files (using xpath) to create or update pages. [detailed instructions at github] Settings After successfull installation go to Setup > Import Pages From XML to start using the XML Importer. This module does not support all available field types. Nevertheless, I've refrained from restricting the supported field types because many of them should work by default. Xpath Mappings If you want to take advantage of references between fields in your xpath mapping then make sure the fields you're relating to are placed before the ones which need the relations. You can access and use any values/fields that you placed earlier in your file. Use $field_<fieldname> to match the desired value. Example: <?xml version="1.0" encoding="UTF-8"?> <songs> <song track="2"> <title contact_id="1">Some song title</title> </song> <song track="7"> <title contact_id="2">Just another song title</title> </song> <contact id="1" name="Sesmallbos" mail="info@test.org"/> <contact id="2" name="Sebigbos" mail="info@exam.ple"/> </songs> context: //song field order: title, track, contact_id, contact_name, contact_mail contact_id must be placed before contact_name and contact_mail first get contact_id : title/@contact_id then use that value as relation : //contact[@id=$field_artist_id]/@name as well as //contact[@id=$field_artist_id]/@mail
    6 points
  3. This is more of a Fancybox question than a ProcessWire one. But something along the below lines might work. Be aware that it is not tested. $(document).ready(function () { $(".fancybox").fancybox({ helpers : { title: { type: 'inside'} }, afterLoad: function () { this.title = $(this.element).find('img').attr('alt'); } }); });
    2 points
  4. Another option to consider is ProFields Table. For many things it's a good alternative to repeaters and the UI is a lot more compact.
    2 points
  5. That's probably a red herring. Initialization fails early on due to memory exhaustion, so it makes sense that Wire::$fuel is unset, as it's the property in which the Wire class stores all the magic variables you call up by invoking wire('users'), wire('pages') etc. While you're digging through the includes, have an eye out for anything that re-assigns to a reserved ProcessWire variable like e.g. $config or $users.
    1 point
  6. You should probably first install it via Modules->Core, under Fieldtype, -> Cache
    1 point
  7. Just create one of those fields and most of those will be answered already by the descriptions/notes in the field editing. Essentially you don't have to worry about anything, create the field, add it to a template, save the page once or regenerate the cache by using the option in the field editing interface and add it like any other field to your selector. Now you can essentially forget it's even there.
    1 point
  8. I doubt there's any official documentation, but there's actually not much more to know about. It combines the string contents of each specified field when the page is saved and stores it encoded in json in the database. The same does happen when a page is loaded to populate the runtime accessable fielddata. If you then search the field and the keyword is somewhere in the json blob, than it's somewhere in your other fields, too. Besides that it's handled just like any other field as well. If you've any further questions just ask them here.
    1 point
  9. Your config file needs to have the domains of your online domain listed versus whatever you had for the local install
    1 point
  10. Display flex with sort-order column-reverse could also work.
    1 point
  11. Form Builder has this functionality. Form submissions can be displayed in a table in the PW admin or saved as pages.
    1 point
  12. Thanks guys. I'll take a second look at the news/tweet section and a generator meta tag shouldn't present a problem. Update 12/8/2015: Just returned from vacation. Generator tags are now in place and I can see the design dissonance between the news and tweets. Will tweak as time permits.
    1 point
  13. I'm happy to share the recent re-launch of the website for the Smart City Alliance, an organization that promotes knowledge sharing and collaboration between Alberta municipalities, academic institutions, technology advocacy groups and business. Their previous website was built (oddly) as a Ruby-based application, and I managed to completely rebuild the site (while enhancing both the design and functionality) within a 2.5 week window while handling other projects. View the site: http://smartcityalliance.ca/ - - - - - - Front-End Fanciness: - Fully responsive design - SRCSet for key images Modules in Action: - AIOM+ (All In One Minify) - Hanna Code - Map Marker (Field Type) - Twitter Feed Markup Leverging Processwire: - Powerful use of pagefields (for the tagging system) - Advanced caching rules for all template types - Easily generated a variety of specific RSS feeds
    1 point
  14. Yes. Use getQueryLog() (will only work with debug on) See example code here: https://processwire.com/talk/topic/11483-duplication-in-query-results/?p=106994
    1 point
  15. Here we are Luis.... just set up a public repo: https://github.com/mr-fan/Officesuite Just created a exported siteprofile from a actual 2.7.1 PW version. So every one could install it simple as a site profile. Now the last question is the license and your permissions and wishes about that topic. May we should go with GPL or release it as simple Public Domain: http://choosealicense.com/licenses/ For me i think it could only stay as a example application for learning some stuff - the app itself can only used partly while some things in accounting and billing changed and everyone that use this app should care about this things (for example IBAN and BIC instead of banking accont number...) But it is your piece of work and it is your decision. @all - this is a german language application and for multiligual frontend we have to change every hardcoded string in the templates....so to a multilang working out of the box app some work is on the road...that i could not do alone. So every one that is interested in helping could send me a PM for further work on this - or every one could use it as it is... regards mr-fan
    1 point
  16. sounds like a job for listerpro... just choose what fields to display and you're done. admincustomfiles could also be helpful
    1 point
  17. You can use insertBefore, eg: $newField = $fields->get("your_new_field"); $t = $templates->get("your_template_name"); $existingField = $t->fields->get("sitemap_ignore_END"); $fg = $t->fieldgroup; $fg->insertBefore($newField, $existingField); $fg->save();
    1 point
  18. I just started the process of going 2.0 on my first PW build. It's been running smoothly on 2.5.3 for a little while now, its first iteration was on 2.4, early 2012 according to timestamps. It never had an issue whatsoever, neither DB or security issues. The only downtimes I've ever had with it is moving from a shared to a dedicated server and a few security updates on the server itself. Satisfied customers for 3 years in a row! Since then, PW has seen so much.. and I've gotten a lot better at architecting content on it.
    1 point
  19. Use getQueryLog() Maybe something like: $queries = $database->getQueryLog(); foreach($queries as $query){ if (strpos($query, 'classification')) {//just to limit our search since there could be other queries echo '<pre>' . $query . '</pre>'; } }
    1 point
  20. FrontendUser and FormHelper modules are small helpers to use the form api and PW login in the frontend, because the core modules aren't fit my needs. I know that PW not supports the frontend usage of core modules (login, forgot password, ...), form api and inputfields, but it would be great. I hope in the future some modules / core features will be simplified and with frontend usage in mind (also if not official supported). Login without build in admin notifications Most of the inputfields work in the frontend, but I don't like the QueryUI dependency Simple form handling / verification (FormHelper fhProcessForm) with a single method call ... But because that isn't planned we need such community modules
    1 point
  21. tpr's solution is better than the one I posted. To take it a step further, those _x() functions never even need to execute. They can simply be contained in a PHP comment, as they only need to be visible to the language parser, which parses the files directly and doesn't execute the with PHP. So you could do this: /******************************************* Intentionally commented out ​// Search_x('Search site', 'Search'); _x('No matches', 'Search'); // Forms _x('From', 'Forms'); _x('From email', 'Forms'); _x('To', 'Forms'); ... *******************************************/ Of course the actual t() function should not be commented out though.
    1 point
  22. I'm using almost the same setup, but my "t" function handles context too. The good thing is that _strings.php can be copied to your next projects too. function t($text, $context = 'General', $textdomain = '/site/templates/_strings.php') { return _x($text, $context, $textdomain); } _strings.php: // Search _x('Search site', 'Search'); _x('No matches', 'Search'); // Forms _x('From', 'Forms'); _x('From email', 'Forms'); _x('To', 'Forms'); ...
    1 point
  23. Thank you so much apesia, soma and adrian. @soma and @apeisa - I followed your advise. Thanks again now it is working fine (happy). @adrian - Yes adrian I put news-pager-index.php file under template directory. Just to recap: if we need use external template file other than the template name we have to use altFilename property. In the normal scenario we can use name property if the template file name and template name were same. Here is the working copy thanks to processwire and friendly community members. It might be helpful to newbies like me. class NewsPager extends WireData implements Module{ public static function getModuleInfo() { return array( 'title' => 'News pager', 'version' => 001, 'summary' => 'News pager template', 'singular' => true, 'autoload' => true, ); } public function init() { //todo add some listeners } /** * Install the module * */ public function ___install() { // new fieldgroup $fg = new Fieldgroup(); $fg->name = 'news-pager-index'; $fg->add($this->fields->get('title')); // needed title field $fg->add($this->fields->get('body')); // needed body field $fg->save(); // new template using the fieldgroup and a template $t = new Template(); $t->name = 'news-pager-index';//Used different name other than file name /* * altFilename property will accept file-name or file-name.php * or even $this->config->paths->templates . 'file-name.php' * Note: template file needs to be placed under * template directory */ $t->altFilename = 'news-pager-index-file';//name of the template file which is under tml dir. $t->fieldgroup = $fg; // add the field group $t->save(); } /** * Uninstall the module * */ public function ___uninstall() { $templateNeeded = $this->templates->get("news-pager-index"); $fgOld = $this->fieldgroups->get('news-pager-index'); if ($templateNeeded->getNumPages() > 0) { throw new WireException("Can't uninstall because template been used by some pages."); }else { wire('templates')->delete($templateNeeded); wire('fieldgroups')->delete($fgOld); } } }
    1 point
  24. To save module config data, put the data you want to save in an array and then call the $modules API var with the saveModuleConfigData function. <?php $data = array( 'something' => 'Well hello there', 'something_else' => 1234, ); $module = 'ModuleClassName'; // can also be instance of module wire('modules')->saveModuleConfigData($module, $data); ProcessWire will automatically set the keys from your configData to the module when it loads, so you don't have to do anything else. As a result, your module could call upon a value like $this->something; and the value would be there. Or if you want, you can add a setConfigData(array $data) function to your module, and it will set the config data to that instead (when the module is loaded). Though I rarely do this. To retrieve a module's config data from another module or elsewhere in the API, you can also use $modules->getModuleConfigData('ModuleClassName'); Use it like this: <?php $data = wire('modules')->getModuleConfigData('ModuleClassName'); echo $data['something']; // displays 'Well hello there' The $data would be the same array that you set in the first example.
    1 point
×
×
  • Create New...