Tips and Techniques

No sense reinventing the wheel, is there? Here, we will attempt to catalog the things we discover work well in managing the site. We hope it gets REALLY full of stuff!

Capturing a video from the web

Now, you are always responsible for making sure you are not violating law when you are doing this, but this is an easy way to capture embedded flash videos so they can be stored, preserved, and utilized. It requires only a Windows PC, and free browser software.

1) Download and install the web browser Opera, available here.

2) Open My Computer (that is, an Explorer window), and navigate to your primary system hard drive (usually C:), then to  Documents and Settings, then to your personality area (look for your login account name). We'll shortcut that as "C:\Documents and Settings\<login>\". Then navigate deeper, to Local Settings\Application Data\Opera\Opera\profile\cache4. This is the place where temporary files are placed during browsing with Opera.

3) In that Explorer window, click View -> Details.

4) Click/select the "Size" column header so that the largest files are at the top (usually this requires two single clicks).

5) In Opera, navigate the web to the video you wish to capture, and play it to start loading it into the cache.

6) In Explorer, repeatedly click View -> Refresh, watching a new and  cryptically-named caching item get created and then get bigger and bigger, until it stops changing in size.

7) Click and Drag that cache file to your Desktop, or anyplace else convenient.

8) Change the name of the Desktop copy to something that pleases you, but ending in ".flv" (for "Flash Video").

9) Upload that file to YouTube, and try it.

You can also play that video in a flash player on your won machine. I recommend FLV Player 2.0, available here.

Control Your Teasers

Drupal automatically splits off a leading part of an article to use as a front page teaser, and although you can control the nominal size of teasers by navigating to Administer -> Content management -> Post Settings, it doesn't really matter, because sooner or later you will run into a teaser that just doesn't work right.

Let me explain a bit about the teaser split that Drupal performs: when you post a content item, Drupal looks at the text, including all the hidden HTML tags, and tries to find a spot where it can break the content into two pieces, nominally at the character count setting established in Post Settings. That can be a little complicated, especially if the item has lots of complex HTML. In making the break, items with nothing but simple text will show more of their text in the teaser than items with lots of links in the opening lines, for example. Conversely, an <iframe> tag which drags in 256MB from a outside web source may end up appearing totally in the teaser, which really is the opposite effect you want.

There is a trick, however, to force Drupal to set your teaser right where you want it.

When editing a page, drop into Source mode, and insert "<!--break-->" where you want the teaser to end. Drupal will obey your manually entered break point, and not create its own.

Make sure you don't interrupt any tag open/close pairs when doing that, however. Annoying. Really. If your teaser breaks with a tag left open -- font color or size, or a <div> tag, for example -- your teaser may totally fry the appearance of the home page by causing the viewer's browser to interpret mismatched tags.

For most items, keeping the item formatting simple keeps you out of trouble. For the ones which don't format the way you want, consider putting the forced break in. For the really messed up ones, go into Source mode in the editor, copy the entire item, and paste it into NotePad++. Then you can set the language type to HTML, and let NotePad++ show you the HTML pairings.

Copy 'n Paste content from rich-text emails

Tips on adding content from existing e-mail and preserving existing formatting:

Using the Windows COPY and then PASTE features from a rich-text Outlook email into an article or page on this website seems to work well. The hyperlinks are usually preserved, though I recommend checking them all before Publishing to make sure the links you have received are current. There is usually some garbage that needs to be cleared out in Source and the spacing often needs to be adjusted.

The best way I have found to check my file and clean up errant code is to save my Article or Page and open it up in a second window to scroll through side-by-side with my edit node.

Caution, Mac users - I haven't had good luck attemping this from Mac Mail. Please comment if you have found a way to work around this using Mac.

Also, best luck creating and editing within Firefox browser (over Safari and Google Chrome).

How to create a Facebook Fan Page

Sandy Abercrombie prepared the attached Word file, describing how to create a fan page on Facebook.

AttachmentSize
Facebook_fan_page.doc305.5 KB

How to incorporate images in your Article or Page

If you want to include an image in a document, it needs to exist on the internet already.

I found two ways to do source images for the Drupal site:

1) Click on the Image Button and paste in the URL. If it is a site that you do not manage, this is not ideal because it is not reliable.

2) For internal purposes, the best way I have found is to load images on to SmartCommunicator or another image library that is a reliable storage place. Use image editors before loading them up if you want to make any changes, though they can be resized once loaded.

Also, when trying do download images from an email, I have noticed that they are not always downloadable, only copyable. My best luck with images has been with my Mac where they are almost always downloadable, but if not I can take a quick and editable screenshot using SHIFT+COMMAND+4.

Please comment if you find any other useful ways to make images reliably available for the ORP site, or if you know of any issues with the ways I have listed here.

 

Quoting the Famous and Infamous

Now, this really isn't going to address attribution and copyright issues -- you know about that, anyway.

The Quotes module is nice, but I wanted to put more STUFF into the quote displays, not just a quote and an author. After tinkering, I discovered that it is perfectly OK to put HTML into the quote edit field, so I created a set of css definitions, collected a set of quotes, wrote a Perl script to format them for me, and a template for creating those files specifically to match the ORP environment.

Feel free to use them. You'll need to install Perl (free), and use the Perl Package Manager to grab the IO and String packages (if they don't load with the basic installation), but that's not too tough. The script that produces the files has a few recognizable constants that you might have to change, but that should be fairly apparent if you look. As delivered below, the script expects to find the files "Revised59.txt" (the quotes, in a tab-separated format produced by Excel) and "QuoteFileTemplate.html" (containing a specification of what data to put into what file). It also expects to find a set of pictures in a parallel folder referenced as "../Pictures", and finally a local folder "Quotes" (into which it will place the resulting files).

To get started, download the .zip file and expand it where you find convenient. After you install Perl, double-click on the script and it should operate successfully. If not, open a command prompt window and run it from there to see any errors that appear.

The pictures should be uploaded, using your file manager or SSH client, to "~/sites/default/files/quotepics" (the "~" stands for your home folder on the website). You can certainly put them elsewhere, if you like, but then change the template file to reflect that location change.

Now, the QuoteFileTemplate.HTML file is a little obtuse, but it will make a little more sense after this:

  1. <FileID>, the identifier of the output file affected by the command.
  2. <Function>, either "File" (to close an old file, and open a new one) and "Template" (an output generating line)
  3. <Change>, telling the script to activate the line when a particular column from the quote file has changed. Those column identifiers are listed below.
  4. <Control>, telling the script to be sure certain fields actually exist before outputting any data for that template line, and
  5. <Data>, the actual html structure to interpret and output.
  1. $$Author, a composite of first and last name (quote file columns B & A)
  2. $$_Author, the author name, with blanks replaced by "_" (underscore).
  3. $$AuthIdent, identification information about the author (a one-line bio) (quote file column C)
  4. $$QuoteNum, identifies the quotes by number, starting with 0001 (4 digits, zero-filled).
  5. $$Quote, the full quote (quote file columns D & E)
  6. $$Citation, the source reference for the quote (quote file column F).
  7. $$Image1, the name of the first image file to use for the quote display (column G)
  8. $$Image2, the name of the second image file to use for the quote (column H).

As an example, the template line

SQ    Template    $$QuoteNum    $$Author$$Image1$$Image2    **BURP**

is interpretted this way: If the quote number has changed, and there is any content in the author, image1, or image2 fields, then output "**BURP** to the file identified as "SQ".

Oh, just play with it. Or ask me for help. Hey, it's free, and there are hundreds of quotes already compiled for you.

To upload the quotes like I have on the ORP and CCRP sites:

  1. Grab the custom CSS elements, and put them into an appropriate place so that Drupal can use them to format the text being displayed. You will probably need to edit them for your site construction.
  2. Paste the full contents of the created "AllQuotes.html" file into a new page, in SOURCE mode, and set the URL for that page to "AllQuotes".
  3. If you want an author index, create a block that is set to only display on the AllQuotes page (or other quote pages), and paste the full contents of AuthorIndex.html into that block, in SOURCE mode.
  4. TEST the display and link functions by grabbing a single quote, and creating a quote content item. Fill in the author in the single line provided for that, and paste the entire HTML-formatted quote into the edit window, in SOURCE mode. Fuss with things until you are satisfied it works, then delete the one test quote you created.
  5. Create a new quote item, and be careful! Paste the entire contents of QuoteLoad.txt into the SOURCE mode of the editor, double-check that the input format is unrestricted, verify that the quotes are NOT promoted to the front page, verify that your authorship is what you want, etc. Finally, be sure you check "import tab-separated....", so that the quote module will peel apart the text into the hundreds of individual items.
  6. If you heartily mess up, not to worry. Just delete all the quotes you just entered and start over. (See, THAT'S why you test with a single quote, or two or three, to start with). If you really do have to start over, I suggest the Drupal CMF module to help expunge the mess, because it allows you to do more quotes at a time.

 *** Soon I will add an "NewItem" column to the process, so that adding quotes to the database will not require as much work. Keep watching.

Tom Harrison