In my case I want to create a custom jPlayer with views.
I am able to create a playlist via file fields:
(File) File: Title -> excluded in display
(File) File: Path -> excluded in display
Global: Custom text
{
title:"[media_title_1]",
mp3:"[uri]"
},
... which looks like this:
Content:
{ title:"Wangu ft. Tony Allen & OG Spirit Godess", mp3:"private://audio/lowfi/02_wangu_ft._tony_allen__og_spiritual_godess.mp3" }, { title:"Bailalo ft. Cleydys Villalon", mp3:"private://audio/lowfi/05_bailalo_ft._cleydys_villalon_0.mp3" }, { title:"Soy Como Soy ft. Cleydys Villalon", mp3:"private://audio/lowfi/07_soy_como_soy_ft._cleydys_villalon_0.mp3" }, { title:"Intro by Cleydys Villalon", mp3:"private://audio/lowfi/01_intro_by_cleydys_villalon_1.mp3" },
But now I need a header & footer surrounding this code without any additional code created.
The result should look like this:
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{ title:"Wangu ft. Tony Allen & OG Spirit Godess", mp3:"private://audio/lowfi/02_wangu_ft._tony_allen__og_spiritual_godess.mp3" }, { title:"Bailalo ft. Cleydys Villalon", mp3:"private://audio/lowfi/05_bailalo_ft._cleydys_villalon_0.mp3" }, { title:"Soy Como Soy ft. Cleydys Villalon", mp3:"private://audio/lowfi/07_soy_como_soy_ft._cleydys_villalon_0.mp3" }, { title:"Intro by Cleydys Villalon", mp3:"private://audio/lowfi/01_intro_by_cleydys_villalon_1.mp3" },
], {
swfPath: "js",
supplied: "oga, mp3",
wmode: "window"
});
});
//]]>
</script>
How can I achieve this?
Using Header & Footer is not possible.
How can I print the views result values with php in the footer?
Then I could write the needed output with a custom field.
Comments
Comment #1
drupa11y commentedGuess the easiest way is to use a custom "Style output"-template in my theme.
Nevertheless maybe it would be good to improve the views output that something like this would be configurable via UI without any additional html-code produced:
Comment #2
stborchertYes, overriding the specific views (style) template in your theme is the way on how to do this.
Uhm, by adding HTML via UI you'll add additional HTML to the output of the page, too.
Btw.: by using fields as output style you are able to rewrite the output of each field directly from the UI without the need of using templates.
Comment #3.0
(not verified) commentedInserted code wrappers