Jump to content

Leaderboard

Popular Content

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

  1. I can imagine how overwhelmed you feel right now. It's like wanting to start playing the guitar, but being confronted with amplifier settings, guitar brands and whatnot right within the first minutes. When you only want to learn one single chord first and build upon that. I guess you already stumbled upon Chris Coyiers close-to-perfect intro to Grunt? http://24ways.org/2013/grunt-is-not-weird-and-hard/ ? My advice would be: Choose either Grunt or Gulp (both are great, capable, and have all necessary functions as plugins), stick to that decision for a couple of projects, don't let distract yourself by the usual developer tiffs, and once you build your own Grunt/Gulp boilerplate and feel confident with it, reach out for optimizations (and maybe read these links here again). But then you'll already have entered the amazing world of task runners and will most probably consider them as a crucial part of your development workflow Also, here's a super simple Gulpfile from processwire-recipes.com, just dealing with SASS and gluing some JS files together (Please ignore the messed up indentations in the file)
    2 points
  2. If all you need is some SCSS/LESS (or JS) processing, there are some helpful GUI tools that take the command line and dependency management hassle away - Prepos as mentioned above, or my favourite, Koala. They can watch your files for changes for you, so no running commands every time you change project or change a single line in one file.
    1 point
  3. I think you should be asking, why do you want to use Gulp or Grunt? What are you doing (or want to do) in your projects that needs those tools or that workflow? If you don't need them, don't use them
    1 point
  4. It's a method I'm currently using to allow users to create jumplinks that start with index.php. Not sure why Google is indexing those, especially considering they are 404s. If you have a jumplink that checks for index.php?cat=32, for example, but you make a request for anything but the 32 and leave the index.php in the URI, Jumplinks will redirect index.php to index.php.pwpj so that it can be tested. I will more than likely be using a better method when I rewrite the module. I could indeed do that, but I think it would be better for that to be handled with .htaccess, like so: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} \.(jpg|png|gif)$ RewriteRule ^ - [G,L] Check the request doesn't match an existing file Check that an image is being requested Send 410 Gone if both conditions match
    1 point
  5. I've just found the following article via Twitter: https://www.cmscritic.com/a-look-at-processwires-latest-core-updates/. I haven't read it yet. I have just clicked on the link because I've seen an error worth noting... I am going to send the author a message to suggest him a change from "ProcessWire, the open source PHP platform, has some updates well worth nothing." to "ProcessWire, the open source PHP platform, has some updates well worth noting."
    1 point
  6. You can save all your pageTable pages to a hidden page (same as repeaters do). I put mine under /admin/. Think of it as a closet in the basement that you will never look in.
    1 point
  7. Little tutorial for adding a "truncate text" function to a text/textarea fields. Here's a little step by step tutorial how to add javascript behaviour to fields using Admin Custom Files. We are gonna truncate the text length of the title field. The plugin only works for simple text and textarea fields and is language aware. Note that the plugin won't work for TinyMCE or CKEditor a likes. Create a file in the Admin Custom Folder called: ProcessPageEdit.js Create a file in the Admin Custom Folder called: custom-plugins.js Go to custom-plugins.js and copy/paste the plug-in code and save the file. Open the ProcessPageEdit.js file and paste in the code from Using the plug-in and save the file. Go to the Admin Custom Files module settings Select the process ProcessPageEdit In the Dependencies textarea type: ProcessPageEdit AdminCustomFiles/custom-plugins.js Save the module. You're done, go to a page where you have a title field to see the result. plug-in code: /site/templates/AdminCustomFiles/custom-plugins.js (function ($) { $.fn.truncate = function(options) { var $fields = this, name = $fields.attr('name'), settings = $.extend({ characters: 128, prefix: '', suffix: '', class: 'notes' }, options ); if ($fields.parent('.LanguageSupport').length) { var $fields = $("#langTabs_Inputfield_" + name ).find("input, textarea"); } $fields.after("<span class='" + settings.class + "'></span>"); $fields.each(function (index, el) { var truncate = function () { var value = $(el).val(), typed = typeof value != 'undefined' ? value.length : 0, left = settings.characters - typed; if (left < 0) { $(el).val(value.substr(0, settings.characters)); truncate(); } else { $(el).next("span").text(settings.prefix + left + settings.suffix); } } $(el).keyup(function() { truncate(); }); return truncate(); }); }; }(jQuery)); using the plug-in: /site/templates/AdminCustomFiles/ProcessPageEdit.js // DOM is ready $(function () { // field with the name attribute title $("[name='title']").truncate({ characters: 64, prefix: 'To go: ', suffix: ' characters' }); });
    1 point
  8. Works with many to many too. $prs = $pages->find("title=Zoo|Theme park|Museum"); // maybe also use the name or id $poi = $pages->find("template=poi, poi_type=$prs"); EDIT: corrected code. yours doesn't work because "get" will return only 1 page and not page array.
    1 point
×
×
  • Create New...