Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/02/2012 in all areas

  1. $user = $users->get('antti'); $users->setCurrentUser($user); If you want to make the user persistent for the session (without having to do the above on every request), then do this: $session->_user_id = $user->id;
    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.
    1 point
  3. 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.
    1 point
  4. Yep. Form Builder 0.1.4 supports the Password Inputfield (which always uses double inputs).
    1 point
  5. How about a module that copies the user and sets a random passwd and logs in.
    1 point
  6. Looks like I broke this a couple weeks ago, but it was an easy fix. Thanks for finding it.
    1 point
  7. Ryan, you're amazing... Already fixed !
    1 point
  8. Can I make a suggestion that the default skin for TinyMCE should actually be "default" and not "o2k7"? The thing is, whilst "o2k7" fits in with the default ProcessWire admin theme, the theme called "default" fits in better with almost every other theme produced so far. I can see a couple of options here - switch the theme to "default" for new downloads from now on and override the colours for the default PW theme, or else make that a configurable part of the module (though the second option doesn't help if you want to set it with your admin theme). I realise what I just suggested above for the default PW theme - overriding the CSS in the admin theme - is another possible way to do it but it's just that every other theme looks fine with the theme "default" and only the original PW admin theme looks fine with "o2k7". Another alternative would be a simple way to override the setting outside of InputFieldTinyMCE.js but I can't think of one off the top of my head. It just gets a little annoying at present to have to remember not to override the setting I change with each new PW upgrade Not a big issue of course, just one that bugs me a bit
    1 point
  9. I like the idea of field groups, but perhaps in another approach: Grouping them in the fields overview. On more complex sites I have 30-40 fields which I group by adding prefixes to them like contact_address, contact_person and so on. But it would be nice to define a field group "contact" and sort the field there (collapsible and tabbable perhaps?). Then the possibility to clone whole groups would be ... wait for it ... legendary ;-)
    1 point
  10. It depends on what you need. Curious as to what limitations you encounter in Bootstrap. Also, responsive is all the rage nowadays but not everything needs to be responsive. Anyways, some nice ones: http://foundation.zurb.com/ http://www.getskeleton.com/ http://www.gumbyframework.com/ http://www.yaml.de/
    1 point
×
×
  • Create New...