Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/21/2012 in all areas

  1. ProcessWire2.+ Minify 1.0.3 This module helps you combine Javascript and CSS files into one, minified file to save on unnecessary HTTP requests and to compress files anywhere up to 80% (including already minified .js files). To use it, extract the attached zip file into your /site/modules/ directory and check for new modules in the ProcessWire Admin area, then install the module. Once installed, go to configure the module and, instead of this configuring anything for you, you can use the drop-down lists to build stylesheet and script code to place in your templates, grabbing a list of any stylesheets and scripts it finds in the /site/template/styles/ and /site/templates/scripts/ directories respectively. It's more of a helper than anything else, but it should take the guesswork out of configuring Minify for your site. Notes: This module contains a third-party library - Minify - which is subject to its own license (a copy is included in the attached zip file). I've left the module in-tact including its unit test files so there are more files than are necessary, but this will make it easier for me to upgrade the module if/when they release updates to that code. This module doesn't insert any code into your templates automatically - I think copying and pasting the code it currently outputs to the screen is more useful/configurable for more situations. It's worth using even if you only have one CSS or JS file as it will compress CSS files by about 80% and JS files by quite a lot too, plus since it handles caching on the server-side and does its own checks of the files it is serving (plus it's a dynamic URL), you can always be sure that it will serve the latest version of a CSS file (no more CTRL+F5 to show the new styles if your browser decides to cache it. You can change the /site/modules/Minify/min/config.php as you could if you were using Minify as a standalone script - tweak cache paths (default is your server's cache path) and other advanced settings here. Updates: v0.0.2 - now produces code that includes paths derived by ProcessWire at run-time so paths will be fine on localhost and live servers, removing potential issues when pushing a site live. v1.0.0 - bumped this up to a major version number since there appear to be no issues with the initial versions to speak of. Also implemented yellowled's input field suggestion (looks much better and easier to select for copy and paste purposes) and turned off autoload at ryan's suggestion. v1.0.1 - now recusrively searches for files inside subfolders under the scripts and styles directories using PHP 5's built-in iterator classes v1.0.2 - pull request from teppo - https://github.com/Notanotherdotcom/Minify/pull/1 v1.0.3 - updated Minify code to v2.1.7 which fixes a significant security flaw: https://groups.google.com/forum/#!msg/minify/cpN-ncKPFZE/kwYVpLMkfDwJ You can download the module here.
    4 points
  2. Video embed for YouTube and Vimeo ProcessWire Textformatter module that enables translation of YouTube or Vimeo URLs to full embed codes, resulting in a viewable video in textarea fields you apply it to. How to install Download or clone from GitHub: https://github.com/r...atterVideoEmbed Copy the TextformatterVideoEmbed.module file to your /site/modules/ directory (or place it in /site/modules/TextformatterVideoEmbed/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Video embed for YouTube/Vimeo". How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing videos in). On the details tab, find the Text Formatters field and select "Video embed for YouTube/Vimeo". Save. Edit a page using the field you edited and paste in YouTube and/or Vimeo video URLs each on their own paragraph. Example How it might look in your editor (like TinyMCE): Here are two videos about ProcessWire https://www.youtube.com/watch?v=Wl4XiYadV_k https://www.youtube.com/watch?v=XKnG7sikE-U And here is a great video I watched earlier this week: http://vimeo.com/18280328 How it works This module uses YouTube and Vimeo oEmbed services to generate the embed codes populated in your content. After these services are queried the first time, the embed code is cached so that it doesn't need to be pulled again. The advantage of using the oEmbed services is that you get a video formatted at the proper width, height and proportion. You can also set a max width and max height (in the module config) and expect a proportional video. Configuration/Customization You may want to update the max width and max height settings on the module's configuration screen. You should make these consistent with what is supported by your site design. If you change these max width / max height settings you may also want to check the box to clear cache, so that YouTube/Vimeo oembed services will generate new embed codes for you. Using with Markdown, Textile or other LML I mostly assume you are using this with TinyMCE. But there's no reason why you can't also use this with something like Markdown or Textile. This text formatter is looking for a YouTube or Vimeo video URL surrounded by paragraph tags. As a result, if you are using Markdown or Textile (or something else like it) you want that text formatter to run before this one. That ensures that the expected paragraph tags will be present when TextformatterVideoEmbed runs. You can control the order that text formatters are run in by drag/drop sorting in the field editor. Thanks to Pete for tuning me into these oEmbed services provided by YouTube and Vimeo a long time ago in another thread.
    3 points
  3. 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
  4. ProcessWire2.+ Admin Hot Keys 0.0.7 This modules adds hot keys functionality to PW backend. The keys can be configured in the module settings in the admin. I created a repo here for download and if anyone interested in picking it up. https://github.com/s...ic/AdminHotKeys Currently it supports Save : ctrl+s Add New : ctrl+n View Page : ctrl+v Open Pages search : alt+q (search field can be configured) Open Templates search : ctrl+shift+t Open Fields search : ctrl+shift+f Goto Pages : ctrl+shift+p Goto Setup : ctrl+shift+s Goto Modules : ctrl+shift+m Goto Access : ctrl+shift+a Note: If you're inside a text input it will ignore the hot keys, as to avoid problems with already defined key. Tip: If you open up templates or fields autocomplete search `ctrl+shift+f|t` press `shift+tab` to focus on the link in the label previous to the search input box. Now hit enter to get right to the template or field screen. (If using FF make sure to enable tab focus for all elements in MacOSX: http://support.mozil...enus or buttons)
    1 point
  5. Regarding the original request to use  + s (CMD + S) to save files, I tried with Somas HotKey module, (use meta+s in the settings) however, I think  + s is a reserved shortcut for "save" and cannot be overridden. (Maybe you can by changing the OS default keyboard shortcuts, not too sure)
    1 point
  6. Not sure what exactly you need. Those numbers with the "next" looks like a pager? Is that coming from where? The $types->render() causes it? However this is not what you need, you just have to foreach the types and output them any way you like. $types = new PageArray(); foreach($products as $product) { // get the types selected, assuming your page field is "catalog_product_type" // add() will import a set of page array or a single as of latest PW, if older PW you can // use import() method to import arrays $types->add($product->catalog_product_type); } echo "<ul>"; foreach($types->sort('title') as $type) { echo "<li>$type->title, $type->url, $type->id</li>"; } echo "</ul>";
    1 point
  7. Hmm, not sure my attachement came through. Here's the code for the module so far: https://gist.github.com/3080802
    1 point
  8. I'm not sure about Chrome in that case, but in jQuery, most manipulations are done in $(document).ready(), which executes once the DOM is ready. The way you describe it, it sounds like maybe Chrome's inspector is giving you a picture of the structure before the javascript executed? I think that the best way is with a separate JS file. Inputfield modules will automatically load a CSS or JS file with has the same name as the module in the same dir. The same goes for any module that extends ModuleJS. However, there isn't much to it, and it would be easy to duplicate anywhere else. This is how it does it: public function init() { $class = $this->className(); if(is_file($this->config->paths->$class . "$class.css")) { $this->config->styles->add($this->config->urls->$class . "$class.css"); } if(is_file($this->config->paths->$class . "$class.js")) { $this->config->scripts->add($this->config->urls->$class . "$class.js"); } } Then your js file should look like this: jQuery(document).ready(function() { // your JS code });
    1 point
×
×
  • Create New...