How To Create A Music Review Site:
|
|
« Red Queen User Manual
|
Tutorial Table Of Contents
|
Obtain Red Queen »
CUSTOMIZING TEMPLATESAudio/Video Is For Detail PagesRed Queen is presently configured to allow audio files or video files to be presented on detail pages. Do not expect to be able to present them in Category, Team, or Yellowpage listings. TemplatesFrom the start it is important to realize that the templates which control the integration of audio and video files into detail pages are very complex. You very probably do not want to try customizing these. That said, the front end to these templates is very simple--a few Template Toolkit INCLUDE blocks in the main detail page templates, which can be moved around as you please. This section discussed how to do this. The main templates which contain blocks for including audio and video content are the following:
item_page_top.ttml member_page_top.ttml supplier_page_top.ttml The structure of the TT blocks is identical in each of these templates, so here we will just concentrate on the first one--the primary template for an item detail page: item_page_top.ttml If we bring the template up in an editor we find the following 3 TT INCLUDE blocks:
[% INCLUDE wimpy_audio_presentation %] [% INCLUDE wimpy_video_presentation %] [% INCLUDE other_downloadable_files_presentation %] The first of these will present the Wimpy MP3 Player and a tiled gallery of click-to-play links (if the gallery has been enabled). The second tag will activate either the Wimpy AV or Wimpy WASP Player, depending on your selection of player for video files. The last tag is the mop-up: any audio or video files not handled by Wimpy plus any other file attachment types are simply presented as file download links. These 3 INCLUDE blocks can appear anywhere in the template, they do not need to appear together. Also, these blocks do exactly nothing if there are no files to format. Likewise, if none of the Wimpy Players has been activated via the Configure > Wimpy Players page the first 2 INCLUDE blocks will nothing and all downloadable files will be handled by the third block. The Audio BlockIf you decide to use the Wimpy MP3 Player to present audio files for streaming you will appreciate an understanding of the following Tempplate Toolkit block which replaces the [% INCLUDE wimpy_audio_presentation %] statement. Here is the definition of the block, the details of which follow: [% BLOCK wimpy_audio_presentation %] [% wimpy_mp3_enabled = 'wimpy_mp3_enabled_' _ alias.thing_type %] [% wimpy_mp3_gallery_enabled = 'wimpy_mp3_gallery_enabled_' _ alias.thing_type %] [% IF ( audio_cols AND audio_cols.size > 0 ) AND global.cfg.$wimpy_mp3_enabled AND global.cfg.site_wimpy_mp3_swf_path %] [%# present audio tracks within the Wimpy MP3 Player + possibly a click-to-play gallery of cover art. position these INCLUDE elements to suit you... %] <br/><br/> [% INCLUDE audio_cols_wimpy_mp3_format %] [% IF global.cfg.$wimpy_mp3_gallery_enabled %] <br/><br/> [% INCLUDE thing_gallery_audio.ttml %] [% END %] [% END %] [% END %] The IF conditional simply checks first whether or not there are any audio columns associated with the record (that is, are there any columns with the PUBLIC_AUDIO Form Type?). The conditional also depends on whether or not the Wimpy MP3 Player has been enable in Red Queen and whether there is a path defined for the executable Wimpy SWF file that generates the MP3 Player. If everything is set the audio columns are formatted according to the result of the [% INCLUDE audio_cols_wimpy_mp3_format %] statement (the content of which should be left unexplored unless you really understand the intracies of Red Queen template design--that is, if you edit these lower level components and break things you are on your own). The Wimpy MP3 Player is then embedded into the browser page, and may or may not be populated with tracks from the playlist, depending on how it has been configured. The [% INCLUDE thing_gallery_audio.ttml %] is self explanatory. If the tile image gallery format has been enabled, it appears as the result of this tag. The content of these 2 INCLUDE statements naturally enough should appear in close proximity on the page as the gallery contains click-to-play links which control the loading and playing of audio tracks. The Video BlockIf you have selected either the Wimpy AV or Wimpy WASP Play to present video columns (those with a Form Type of PUBLIC_VIDEO) you should find the following block to include the selected player only slightly more complex than the one for the Wimpy MP3 Player: [% BLOCK wimpy_video_presentation %] [% wimpy_av_enabled = 'wimpy_av_enabled_' _ alias.thing_type %] [% wimpy_wasp_enabled = 'wimpy_wasp_enabled_' _ alias.thing_type %] [% wimpy_wasp_popup_enabled = 'wimpy_wasp_popup_enabled_' _ alias.thing_type %] [% wimpy_wasp_popup_gallery_enabled = 'wimpy_wasp_popup_gallery_enabled_' _ alias.thing_type %] [% IF ( video_cols AND video_cols.size > 0 ) AND global.cfg.$wimpy_av_enabled AND global.cfg.site_wimpy_av_swf_path %] [%# present video clips (and perhaps audio tracks if merged) with the Wimpy AV Player %] <br/><br/> [% INCLUDE video_cols_av_format %] [% ELSIF ( video_cols AND video_cols.size > 0 ) AND global.cfg.$wimpy_wasp_enabled AND global.cfg.site_wimpy_wasp_swf_path %] [%# present video clips (and perhaps audio tracks if merged) with the Wimpy WASP Player %] <br/><br/> [% IF global.cfg.$wimpy_wasp_popup_enabled AND global.cfg.$wimpy_wasp_popup_gallery_enabled %] [% INCLUDE thing_gallery_video.ttml %] [% ELSIF global.cfg.$wimpy_wasp_popup_enabled %] [% INCLUDE video_cols_popup_wasp_format %] [% ELSE %] [% INCLUDE video_cols_embedded_wasp_format %] [% END %] [% END %] [% END %] This time, if the AV Player has been enabled, the [% INCLUDE video_cols_av_format %] statement will generate the AV Player which is embedded into the browser page. Otherwise, if the WASP Player is to do the job, there are 3 possibilites:
Once again, the content of the blocks behind these INCLUDE statements, from the thing_download_cols.ttml template should probably be left untouched due to the complexity of the code that controls the presentation of these players. The Other Files BlockThis last block is very simple. Every file column that has not been handled by either of the two Wimpy blocks above is handled by the [% INCLUDE other_files_formatted %] statement. In contrast to the Wimpy code, the TT statements behind this block are not particularly difficult to understand, and if you wish to edit the code you should not have much difficulty. See thing_download_cols.ttml if you need to make modifications. [% BLOCK other_downloadable_files_presentation %] [% IF other_file_cols AND other_file_cols.size > 0 %] [%# present any files NOT handled by one of the previous blocks %] <br/><br/> [% INCLUDE other_files_formatted %] [% END %] [% END %]
Copyright © 2004 Random Mouse Software. All Rights Reserved. | ||||||||||