Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/20/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.
    4 points
  2. I was a long-time MODx user before PW and it does take time to un-learn your previous system. Moving forward though PW is pretty easy to pick up with the right examples - the people using it have a wide range of programming knowledge and ability. It's always interesting to see what people come up with and gratifying to see them get going with it after asking a few questions here, so if you have any other queries or suggestions please keep them coming.
    3 points
  3. Hi, This is the second version of Electric Firefly I've been involved in creating. This version was the most fun to work on. http://www.electricfirefly.com.au/ Go and buy a lamp. They're great Cheers Marty
    2 points
  4. You should also be able to grab the last image and add the description to it: $page->images->add($filename); $page->images->last()->description = "description";
    2 points
  5. Hi, Sorry for the very basic question, I have looked here and tried to find an answer but I had no luck. Basically I would like to output the first image for each 'item' featured (they all have an image field titled 'images' in the standard way). So, my code so far is: <?php $features = $pages->find("featured=1, limit=5, sort=-date"); foreach($features as $feature) { echo "<li>" . "<h3><a href='{$feature->url}'>{$feature->title}</a></h3>" . "<em>{$feature->date}</em>" . "<p>{$feature->intro}</p>" . "</li>"; } ?> Would anybody be able to help me to ouput the first image from the images field for each of these? Again, sorry for such a basic question. I am so impressed with Processwire, I have used it for 4 sites now and would return again and again. There's nothing that comes close out there. Thanks, Jon
    1 point
  6. I'm halfway through a module for this already, but it will still just build a URL from a selection of files to paste into the template. The whole ethos of ProcessWire is not making assumptions about what people are going to do with it or how they're going to work, so reducing the Minify process to a simple copy and paste is about as far as I feel comfortable taking it. There are occasions where you won't want every JS or CSS file being called for every page so I don't want it to make assumptions or rewrite anyone's HTML markup if I can help it. It'll be a simple solution though - I promise You will always have code in your templates by the way so that's not a problem. Take a look through the default template files in the site/templates directory to see what I mean.
    1 point
  7. Great update Soma! I'm really liking the new ajax page search. Only thing I wanted to mention though was the default key assigned to this ALT+Q can't be assigned in OS X because it's the application Quit command. I did it, and it immediately quit the browser, closed all windows, etc. I changed it to CTRL+Q, which seems to work well, but am thinking you chose alt+q because ctrl+q has the same problem on windows? Maybe there is some other default for this that would be safe across platforms? Maybe something like CTRL+. or CTRL+[ or CTRL+- I love everything about this module, except that I'm confused by the templates/fields search. Probably because I'm just accustomed to clicking, rather than typing template/field names in the admin. In most sites, the quantities here are small enough to make the search seem overkill. So if there were a most wished for feature on my part, it would be that either: 1) it showed a list of templates/fields rather than a search box. Or; 2) that the field/template search boxes showed all of the fields/templates (that you could click to edit) and then filtered (rather than created) in the list as you type.
    1 point
  8. Hello, just commited a new update. Added new action to search for Pages using PW internal ajax search "alt+q". You can even select template to filter. Added setting to change the fields used in page search. Default "title body". Search uses %= (SQL like) Changed dialogs to position fixed so they appear right where you are and page doesn't jump Added check so it doesn't get initialized on login screen
    1 point
  9. I always use a text field to copy in video url or code. If needed inside a text I use a tag that will be replaced.
    1 point
  10. Interesting fact is that after building couple sites, some with lots of images, there's been always a good solutions (image per page) that even without a media manager it just works. The on page files has limits it seems at first, but it has also many pros. People working with me or clients wheren't really asking for something, but saying this is amazingly simple. Drag upload all files, arrange them and the gallery is finished. I find it fascinating that you can actually do pretty much with that system and even without a "real" media manager all the other cms have, which I mostly found akward to use.
    1 point
  11. You have probably already read this, but there's quite a bit of discussion about this subject (video content) here: http://processwire.c...de-processwire/. I've implemented similar solution as discussed there; user copies video URL from YouTube (or any other supported service) and some regexp magic converts it into embedded video. That works for me very well, especially since (in my experience at least) users quite often want to embed videos here and there, mostly within other content, and thus video field wouldn't be sufficient solution. TinyMCE plugin (also discussed in the thread above) would be an interesting option, though I'm not sure if that's possible yet. Long story short: video field is a nice idea and might actually meet some of our clients needs too - I'm sure a lot of folks here will be really happy if you find the time to create something like that. And naturally if there's anything we can help you with regarding this module (or just about anything else) just ask By the way, are you thinking about adding certain hard-coded video services, or could there perhaps be an option for administrator to add new services / remove those that already exist? I'd consider that a nice addition, especially for handling smaller, local video sharing sites - and perhaps even in-company video editing + sharing services, seen couple of those popping up lately. Of course this could also be solved, especially early on, by implementing service-specific stuff in a way that makes it easy to developers to modify, add and remove new services at code-level..
    1 point
  12. Yeah, Soma's right! You can do it this way: foreach ($page->myrepeater as $item) { if ($item->visible) { echo "<p>$item->title</p>"; //or do something else... } } or this: foreach ($page->myrepeater->find('visible=1') as $item) { echo "<p>$item->title</p>"; //or do something else... }
    1 point
  13. I think it's easy if you see the repeaters as pages array Out of my head this can be done like this: $elements = $page->repeater->find("checkboxfield=1");
    1 point
  14. You are close on this. You can't actually give a field a different name. A field name is the same no matter what template you put it on. It is a constant. Though you can change the label or description according to the context of a template. Fields are not fieldtypes, they are variables on a page. There are fieldtypes in ProcessWire, and you can have as many of the same fieldtype on a template/page as you want. You do have to create the fields (of your chosen types), and assign them to your template. But just like you can't have two variables in PHP named $foo in the same namespace, you can't have two fields on the same page named 'foo'. If you need another field just like 'foo', then clone it and name it 'bar' or 'foo2' or whatever you want. You can create as many copies as you need. In the admin, Setup > Fields serves as your master directory of all fields in your site. To take the example further, some types in PHP can contain multiple values, i.e. arrays. The same goes for ProcessWire, as some fieldtypes are multi-value fieldtypes. Examples include page references, files, images, comments. There's also the 'repeater' fieldtype, which appears to throw all rules out the window, but that's in appearance only as it is technically mapping everything within the rules behind the scenes. Underneath it all, every field maps to a database table, ensuring that everything remains quickly selectable, searchable and consistent throughout the API.
    1 point
×
×
  • Create New...