Jump to content

Leaderboard

Popular Content

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

  1. 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
  2. I'm always willing to take a fresh look at tools other people like. There was no VIM mode back when I used PhpStorm, so that sounds interesting from that aspect (as does the sublime vintage mode). But should qualify that I'm not naive about this, have spent a lot of time in IDEs, and used dozens of different editing environments over the years. Back when I was a C++ programmer working for another company, I didn't have a choice. I also used PhpStorm for a couple weeks when it was new (with ProcessWire), as well as Zend's IDE for some time. I even grew up in Turbo Pascal and Borland C++ IDEs, using them for years. But my mind always ends up more in the editor than in the code. For me, less has always been more. It's not about what's practical, easy or fast. VIM takes me to a place where I can think, and it took me years to find it. I lose creativity and enjoyment when you take away the minimalism. Coding becomes about work rather than code. I lose track of stuff when something is keeping track of it for me. What can I say, this is how I am about all my tools except maybe Photoshop. No doubt IDEs can be time savers when it comes to certain tasks, but I've not found it worth the tradeoff. (Though TextWrangler is my go-to for anything involving regex search/replaces across mass amounts of files). I will keep trying out tools that other people like and recommend, but I think most of the time we're looking for different things. I'm not trying to sway anyone towards using what I use. It's not practical, and it's slightly insane. In fact, I would say you should avoid the likes of VIM if you enjoy using an IDE. This is all beside the point on PSR-0 changes to the core. I can put up with more files, as the inconvenience is relatively minor. But I thought it was worth asking if there were any compliant conventions for including a similarly-named group of classes in one file. For instance, a file named Selector_.php might include classes beginning with the word "Selector", which are already grouped together in a file by intention and design.
    1 point
  3. Great and useful module Pete! One recommendation I have is that this module probably shouldn't be autoload. That's something reserved for modules that need to attach hooks and execute on every request. In this case (if I understand it correctly), the Minify module only needs to execute when you are configuring it. So this module will be more efficient if it is not loaded on every request. This 'autoload' is defined in your getModuleInfo() function and you can either remove the line or set it to false, to make this adjustment.
    1 point
  4. I would recommend Sublime Text 2, it also has vintage mode built in and numerous plugins.
    1 point
  5. I think there will be a vim storm coming from Ryan
    1 point
  6. Something along those lines would be fantastic. Regards Marty
    1 point
  7. Well, once and if PW attracts a greater user base, chances are someone™ will implement some kind of module or other mechanism to make building templates easier, maybe some kind of system like TemplaVoila or what's-it's-name for TYPO3. There might even grow a market for custom-made or at least pre-built templates, who knows? I absolutely agree that anyone can be bothered to fire up a text editor and follow instructions to copy & paste some lines into a file. It's not that hard. Then again, I have some years of experience in user support in a similar forum for a blog system … trust me, people will complain that this is too hard or something "only you nerds understand" … But there's also the question whether non-expert users do actually care for something like performance optimization. My opinion would be if they don't, their loss. If they do, they're gonna have to roll up their sleeves and get their hands dirty, just like we used to do. Of course we'll advocate them and give pointers and instructions, but no one can expect to be pampered in a support forum where people help out in their free time.
    1 point
  8. I just gave this a quick spin on my local Apache, works like a charm. (Can't really test it anywhere "live" since I don't have any "unoptimized" PW installations flying around since I usually use the H5BP build script to concat/minify.) Two small thoughts, both of them are completely a matter of taste: It might be a nice idea to emit the generated URL which you paste into your template in an input field instead of as plain text since that's usually a bit easier to get for copy & paste. As far as I know, Minify also has an option to emit a "clean" URL for the combined files, i.e. "style1.css" instead of "styles&f=reset.css,main.css" — which I'd prefer. I know it's silly and not an issue technically, but to me, it just looks wrong. Other than that: Great module to have, Pete. I'm not sure non-expert users will love this as much since they's still have to modify template files, but it sure adds a nice way to make Minify integration a lot easier.
    1 point
  9. Hi all, Using code provided by Ryan here, I've created a module that coverts a PageArray into JSON format. It's been super useful to me, and I'm hoping it will be for others as well PagesToJSON.module
    1 point
  10. Michael, that looks interesting. Looks like a lot of cool possibilities there and I look forward to taking a closer look and seeing if there might be another module brewing in there. But I have to admit that I find the whole oEmbed thing a bit vulnerable, as it's letting another web site populate raw markup into your site. You must have a lot of trust in whoever you let do that. It's more sensitive than linking to another service's JS. I have that level of trust with YouTube and Vimeo. I suppose I need to convince myself that something like embed.ly doesn't seem like a potential security timebomb, because the potential is very cool. I'm going to spend some more time looking at it.
    1 point
×
×
  • Create New...