Hey Folks,

This is the 4th drupal site I've built, and I think my best one so far. I started a video podcast dedicated to the new Nintendo Wii. Please let me know what you think of the site.

Aside from the core modules I also used CCK, Views, ConTemplate, and ImageCache. Even though the site was built with Drupal 4.7 I'm probably going to be porting it over to 5 very soon.

http://www.wiiliketopodcast.com

The biggest problem I've had with this site was generating a clean iTunes compatible RSS feed for the podcast videos. I ended up adding some extra lines into the $extra variable in views_rss.module which creates the enclosure for either the iTunes compatable video or audio file. I took this feed and passed it through feedburner to add the extra tags that I needed.

I'm currently trying to learn how to build my own module to at least just pass the parameters to $extra without having to manually edit the module directly. Can anyone offer any insight as to what path I should take? I would consider myself a rather brute force coder with basic php skills.

If you have any questions or suggestions please let me know.

Thanks!

Comments

newdru’s picture

Could you tell me a how you created both the Teaser Nodes on your front page and the associated full page views of those same nodes when you click on them?

More specifically:

1) I'm wanting to have a thumbnail img in my Teaser formatted similar to yours (to the left with the title on top and teaser body to the right).

I imagine you created two separate custom content types for both article and podcasts and then... :

- do you make sure your thumbnail is presized before uploading or is it being sized on the fly when you upload?
- would you be so inclined to reveal the steps you used in views to create that teaser view?
- would you be so inclinded to share the template used to present the teaser (i imagine you did that with contemplate)

2) The page views of the podcast and article nodes look great too!

For the article page node:

- did you load that img separately from the thumbnail or is it just derived from the same source file?
- did you manually input img tags to embed the larger img in the body or is that somehow automated when create the node and upload an img?
- the article page body contain a TOC, headers and more inline imgs. i'm guessing you had to hand code / embed the html directly for this?
- if so do you usually create that in another html editor then cut n paste into drupal or use tinymce or some other rich text editor directly in drupal?
- do you attach or associate the inline imgs in the body with that article node or are they just plain old files that you embed img tags for?

For the podcast node:

- similar to your article node, the podcast node is more complex than an average vanilla drupal node. It looks like hand coded embedded html - right?
- however, i'm wondering if the the podcast and the downloads section at the top were automatically inserted via a video and or download module of some kind?
- which modules did you use for the podcast and downloads?

Any input on this would be greatly appreciated. Especially with regard to your teaser and page view presentations.

nice job!

arvinsingla’s picture

Hey newdru,

Thanks for the nice comments. I really appreciate you checking out the site. Let's see if I can answer some of those questions for you. I'll just start from the top and work my way down.

1)

Q: "do you make sure your thumbnail is presized before uploading or is it being sized on the fly when you upload?"

A: All the images are generated on the fly using ImageCache. It's a little hard to setup, but go through the README. Depending on which view is shown either the teaser or the full page, imagecache generates the image accordingly based on presets I defined.

Q: "would you be so inclined to reveal the steps you used in views to create that teaser view? would you be so inclinded to share the template used to present the teaser (i imagine you did that with contemplate)?"

A: As it stands the teasers on the front page and the teasers shown when clicking on the individual links from the top menu are both created differently. The front page is done using contemplate, and the individual ones are done using Views. The reason for this is because I was learning how to use both at the same time. When I port the site over to drupal 5 I will more than likely pick one display method and stick with it.

I'll describe the contemplate version first. The title and submitted information is outputted from my node.tpl.php. This is from the standard install and I haven't touched it. The rest of the teaser, the picture and the teaser text itself is displayed using contemplate. Below you'll see the actual contemplate teaser for the article node.

<div class="main_image">
<?php print theme('imagecache', 'podcast_thumbnail_small' , $field_cover_image[0]['filepath'], $field_cover_image[0]['title'] ,array('alt' => $field_cover_image[0]['alt'])) ?>
</div>
<div class="field field-type-text field-field-teaser-description">
<?php print $field_teaser_description[0]['value'] ?>
</div>

As you can see I use the theme command as outlined in the imagecache README to specify the preset I made 'podcast_thumbnail_small, and then pass imagecache the path to the original image filed that was uploaded with the node $field_cover_image[0]['filepath'].

The steps to create a views version are as follows. provide a page view of view type "LIst View", then I specified the fields I wanted. TItle, submitted Info, my image, and the teaser_description. The nice thing about views is that it reads all the imagecache presets you created and gives you a drop down list as part of the parameters for the image field. So you can specify right there which preset you want it to use. I set mine to the "podcast_thumbnail_small" and then the view automatically uses/generates the smaller image for that view. The rest of the view setup was just specifying the filters to determine what content is displayed.

2)

Q: "did you load that img separately from the thumbnail or is it just derived from the same source file? did you manually input img tags to embed the larger img in the body or is that somehow automated when create the node and upload an img?"

A: As specified before all the images were dynamically resized from the same source file using imagecache, and then output using contemplate.

Q: "the article page body contain a TOC, headers and more inline imgs. i'm guessing you had to hand code / embed the html directly for this? if so do you usually create that in another html editor then cut n paste into drupal or use tinymce or some other rich text editor directly in drupal?"

A: Unfortunately the article was all written by hand in HTML just using a text editor and then cut and paste into the body of the article node. I tried using WYSIWYG editors like TinyMCE before, but found they generated too many stray and excess tags that often didn't look good from browser to browser. It takes a little more time, but the end result looks a lot better.

Q: "do you attach or associate the inline imgs in the body with that article node or are they just plain old files that you embed img tags for?"

A: Sorry it's late and I'm not quite sure what you're asking here. The image for the article is part of the body as specified in the contemplate and generated by imagecache. Below is what the template looks like for my article full node view.

<div class="main_image">
<?php print theme('imagecache', 'podcast_full' , $field_cover_image[0]['filepath'], array('alt' => $field_cover_image[0]['alt'])) ?>
</div>
<div class="field field-type-text field-field-description">
    <?php foreach ((array)$field_description as $item) { ?>
      <div class="field-item"><?php print $item['view'] ?></div>
    <?php } ?>
</div>

Q: "similar to your article node, the podcast node is more complex than an average vanilla drupal node. It looks like hand coded embedded html - right?"

A: You are correct, in my contemplate for the podcast node, I grab values from different fields I made in the node as well as special computed fields using the computed_field cck type.

Q: "however, i'm wondering if the the podcast and the downloads section at the top were automatically inserted via a video and or download module of some kind? which modules did you use for the podcast and downloads?"

A: Ok this answer is going to be long, so bear with me. Firstly I'm not using the video module or a download module, everyting is done through the CCK and contemplate. It is important to know that I upload all the video and audio files to the server on my own. My file directories are created manually by me and follow a set naming convention {mysite.com}/files/podcast/{episode_number}/{filename}. I will outline the fields I used to create my podcast node.

Title -> title
cover_image -> The image used in the teaser view
episode_number -> single integer specifying the episode number
filename -> A text field for a standardized filename which all my files for this episode will follow, E.g. episode_01_it_has_begun
hosts -> A select box list of all the different hosts which could be in an episode
teaser_description -> text for the teaser
main_description -> Where my show notes and other general text will go
mp3_audio_size -> a computed field which uses the filename field to performa simple php file command and get the filesize of the mp3 file already on the server
mp3_audio_url -> a computed field which constructs the url for the file based on filename and episode_number
quicktime_small_size -> Same as mp3 size, but my ipod quicktime file
quicktime_small_url -> Same as audio url but for ipod quicktime file
quicktime_large_size -> same as mp3_audio_size
quicktime_large_url -> same as mp3_audio_url

When I create all the different files for my podcast I make sure to name them according to the same convention I used in the filename field. It's important to note that the computed fields for the file size have values of 0 if the files aren't already on the server when the node is created. This information is computed only when a node is created or updated. So I can still create the node before the files are there, I just have to make sure I go back and re-save the node again when the files are present to make sure the computed nodes have the right values.

Now the contemplate is where all this information is used. The podcast node is mildly php heavy. The flash viewer is embedded into the contemplate and is simply fed the value of the filename with the proper extension added. The links to download the other files are also generated in php using the values from the node. If a particular size value is 0, the download link for that file type isn't displayed. Each section is sequentially layed out with DIV tags and is then styled with CSS to make sure it is put where I want it.

That's pretty much how my site was built, I hope that helps. If you have any more questions feel free to post again.

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

2houseplague’s picture

Nice site and thanks for sharing all the methods. I'm interested in the computed field code you used to create the URL: "mp3_audio_url -> a computed field which constructs the url for the file based on filename and episode_number"

Thanks

http://profitlabinc.com

arvinsingla’s picture

My computed field is really simple, It's basically just a pieced together string. Since I always know roughly where the files are going to be I just append the episode number and the filename to the path.

$node_field[0]['value'] = "http://www.wiiliketopodcast.com/files/podcast/" . $node->field_episode[0]['value'] . "/" . $node->field_flash_video[0]['value'] . ".mp3";

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

newdru’s picture

for your informative post! super cool to share your experience..

I'm going to play around with contemplate the next couple of days before i ask you a few followups related to that part of your post...

until then:

- why did you ditch the video module and prefer to handcode this using cck?

- fwiw, i downloaded the video module yesterday, played around with it and found it lacking in a number of respects. i like your approach but think it could benefit with one little tweak which would require you to probably convert your cck to a module. that feature would be to allow a file select form element to allow you to navigate and select the filename you've already uploaded to the server versus having to type it in. It would allow you to not necessarily have to use a set naming and scheme and it might make things easier as you start accumulating 100+ files on your server, etc. you ever think about doing that?

- which flash viewer are you using (is that a home rolled player or some open source player)?

- when you have a flash viewer displayed on a vid cast page, how do you set the video frame that is displayed in the initial stop state? that might sound stupid, but is that something you determine when you create the video, is it automatically the first frame or something that you pass into the flash viewer (e.g. a frame # param or something)?

- finally, i'm pretty impressed with imgcaches automated thumb and body img resizing. they look fairly optimized. did you have to tweak imgcache to make the settings work good for your different sizes? which backend php image processor does imagecache use.. GD(2), Image magik..? it almost looks sharpened but i don't think these graphics processors are smart enough to do that..

thanks again

arvinsingla’s picture

Q: "why did you ditch the video module and prefer to handcode this using cck?"

A: The biggest reason I didn't like it is because I didn't really have the time to modify it to what I wanted it to do, and since I wanted to learn CCK anyway I thought it best to just roll my own. The only major feature I lost by not having it is keepign track of how many times the file was played, and I'm pretty sure I can monitor that from my web server stats.

Your suggestion about selecting filenames would definitely be nice had I the time to impliment. But as it stands I don't mind so much manually naming the files. I'm following a convention I setup and I'm only posting a new video every week or so. But the idea would be nice for the future when I dabble into making my own modules.

Q: "which flash viewer are you using (is that a home rolled player or some open source player)?"

A: I'm using an open source player by Jeroen Wijering. From what I can tell it's a very widely used player.
http://www.jeroenwijering.com/?item=Flash_Video_Player

Q: "when you have a flash viewer displayed on a vid cast page, how do you set the video frame that is displayed in the initial stop state? that might sound stupid, but is that something you determine when you create the video, is it automatically the first frame or something that you pass into the flash viewer (e.g. a frame # param or something)?"

A: The flash player accepts a number of arguments and has a number of features. Unfortunately it doesn't allow you to specify a frame number for the initial stop state. It does however allow you to display a jpg image. So currently I just have the same image I use for my iTunes album cover.

Q: "finally, i'm pretty impressed with imgcaches automated thumb and body img resizing. they look fairly optimized. did you have to tweak imgcache to make the settings work good for your different sizes? which backend php image processor does imagecache use.. GD(2), Image magik..? it almost looks sharpened but i don't think these graphics processors are smart enough to do that.."

A: I didn't do anything to imagecache aside from provide the preset with what sizes I wanted the images to be. I'm not even sure if it even allows you to change the compression quality. For me in this case ignorance is bliss. As for which image processor it uses, again I am unsure.

Cheers!

---------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

newdru’s picture

How you approached these pages now... Instead of trying to get fancy with modules, your approach trys to mirror that of creating an actual page by hand in html. I like it. Probably not the best if you had to turn the site over to a clueless user but for what you're doing if fits the bill perfectly and allows you to achieve what you want. nice!

You said this in your original post:

A: As it stands the teasers on the front page and the teasers shown when clicking on the individual links from the top menu are both created differently. The front page is done using contemplate, and the individual ones are done using Views. The reason for this is because I was learning how to use both at the same time. When I port the site over to drupal 5 I will more than likely pick one display method and stick with it.

You seem to differentiate between the front page and the page listed teasers as using different techniques. I'm confused by that.

When you use contemplate, it applies to *THE DISPLAY* or *THEMING* (kind of like a mini pretemplate) of ALL nodes of that type regardless of where they show up - right? What i mean is that the contemplate teaser gets applied whether that node is displayed AS A TEASER on a non-front page, front page, and i would imagine in a view if you set it to 'teaser list'. right? or am i missing something?

The view basically SELECTS the nodes and applies a predefined format of your choosing (teaser, full, table, etc). But it doesn't necessarily theme it. The x.tpl.php and associated contemplate would though. I'm not sure you can theme the view separately from the contemplate. If a contemplate exists for a content type, it's goign to get applied in the view - right?

Maybe when you said they use different methods to **CREATE** you weren't referring to the THEMING but just that you hand coded WHICH NODES would show up on the front page versus WHICH nodes would show up on the VIEW LIST page. Not sure if you follow that or not.

I just enabled contemplate now and will noodle around with it today.

thanks as usual

arvinsingla’s picture

Reading through your post you basically solved my problem :)

I set up my views with the "List View" option, not the "Teaser List". Which ignores the templates and contempletes and outputs any element you put in the "Fields" section as a list. I was basically themeing two completely different layouts one with the contemplate and the other with the views "List View". I completely forgot that I can specify "Teaser List" and have the contemplate handle the layout for everything

I don't know why I didn't realize that... But thanks!

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

newdru’s picture

I'm glad i helped! My favor back to you.

the thing that both blows my mind and pisses me off about drupal s that there are usually 1000 ways to do the same thing. in theory that makes it powerful but it often means that one takes a longer path to achieve something that can be done easier. it's often a matter of which method you stumble upon first. using this sucker would be more efficient if there weren't so many different ways. it means that one usually has to do a boatload of research BEFORE one dives in to figure out which path is best (or which path is worst and so to avoid it).

Beggars can't complain though ;-)

OK back to the topic.. I may have helped you shortcut your theming BUT...

I still want to know how it was that you were able to theme the "list view" of the views if 'list views' ignores "templates' (not contemplates)???? Actually how is it possible to theme any view separately period? a node is a node is a node.. and when all is said and done, it winds up in node.tpl.php or similar?

that one has me scratching my head i mean arse? ;-)

may you shed some light

sepeck’s picture

Because a view is not a node, you can theme it differently then you would a node. If you download views it has a theme wizard module with it now that can give you a start on theming your view.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

JohnForsythe’s picture

Don't want to rain on your parade, but your site doesn't actually validate.

"This page is not Valid XHTML 1.0 Strict"

--
John Forsythe
Blamcast - Custom theme design and more...

arvinsingla’s picture

Looks like I made some changes last night that broke validation. It's been fixed and the site now validates. Thanks for letting me know.

------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

daniel-san’s picture

Just wanted to compliment you on two things...

1. Your site looks great. Very clean and easy to navigate. Looks like the kind of stuff that I'm trying to learn how to do with drupal. good job.

2. Great job on posting and responding. One of the things that makes it very nice about learning drupal is the community and the willingness to share. Your post and answering of questions is the kind of thing that makes me want to keep learning and try to get to a point where I can help the community as well.

Thanks and take care,

Dan

krisvannest’s picture

IMO very clean and user-friendly-- did you start w/ one of the 4.7 Drupal templates or roll your own from scratch?

Thanx,
KV

arvinsingla’s picture

I started the site originally with bluemarine, just to have something to work with. Then I ripped the tables out and started organizing the content within DIV tags to get it organized. After that it's all CSS to make it look pretty. Try disabling CSS on my site and you'll see how very plain the DIV structures are.

-------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

krisvannest’s picture

Well then that's the best Bluemarine look I've seen yet. ;-)

In addition to the very clean but hip overall look, what I particularly like are the Wordpress-esque/like Date and Large 1st Letter you're using. Like at http://www.wiiliketopodcast.com/blog you've got this cool little date blocks that go something like:

<div class="view-blog-left">
   <div class="view-blog-avatar">
      <div class="picture"><a href="/user/2" title="View user profile."><img src="http://www.wiiliketopodcast.com/files/images/avatar/picture-2.jpg" alt="Ben&#039;s picture" title="Ben&#039;s picture"  /></a>
      </div>
   </div>
<div class="view-blog-date">
  Feb 12th 2007</div>
</div>

... and at http://www.wiiliketopodcast.com/article/wii_component_cable you've got this sweet looking large "L" starting off the 1st paragraph.

Do you have any tips, actual "view-blog-date" or other CSS class code, or pointers to on-line tutorial/instructions someplace on how to do those two things? Def would like to learn more (sorta new at CSS).

BTW, ditto on the other poster; great job giving back/sharing and thanks again.

arvinsingla’s picture

I've recently started reading any good CSS tutorials and books I can get my hands on. CSS is your best ally in making a site not look like a drupal site :)

This is a great CSS techniques list where I learned how to do the dropcap lettering (the large letter). http://www.smashingmagazine.com/2007/01/19/53-css-techniques-you-couldnt...

The CSS for avatar/date part of the blog is like this:


#content .view-blog-left {
        float: left;
        width: 40px;
        margin-right: 10px;
}

#content .view-blog-avatar .picture a img {
        float: none;
        display: block;
        margin-left: auto;
        margin-right: auto;
        padding-top: 2px;
        padding-bottom: 4px;
        border: 0;
        border-bottom : 1px solid #dbd5c5;
}

#content .view-blog-date {
        width: 40px;
        font-size: 1.2em;
        font-weight: bold;

Cheers!

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

krisvannest’s picture

That SmashingMag link is a great resource; thanx much.

I'll contrib to this whole thread theme by adding Ben Hunt's Web Designs from Scratch, another very good one more focused on overall design, including real-world comparisons of what seems to work/doesn't work, etc.

huayen’s picture

What kind of media module are you using?

For the information
-------------------------
Download:

* MP3 Audio (12mb)
* Quicktime Ipod (93mb)
* Quicktime Large (210mb)
--------------------------
Are they generated automatically by the module, or you input them into a CCK field? Thanks.

arvinsingla’s picture

That information is generated by computed field for CCK. If you look at one of my earlier responses in this thread I show a list of my CCK fields.

So for example I have the fields mp3_audio_size and mp3_audio_url. Both of these fields have simple php code associated with them to get the size of the file and generate the URL based on the other CCK fields I have with my node. Then in my template I check to see if the MP3 size field has a value, if it does I piece together a full link with simple php.

Hope that helps

------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

huayen’s picture

Thanks for your reply, which makes me better understand the function of computed CCK field. So, this kind of CCK field can be used to count how many times a URL were clicked, which is essential for a download center node type, right?

arvinsingla’s picture

Someone please correct me if I'm wrong, but I don't think that's possible with the Computed Field. I believe module executes the php code and stores it in the database at the time the node is either created or updated. I'm not sure if it could be run when a page is loaded. Or at least I'm not sure if it could be run easily when a page is executed.

Of course I'm far from a drupal ninja and have only been using the CMS for about 10 months so if someone could confirm or deny this I'd really appreciate it.

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

2houseplague’s picture

You could probably use Computed Field to add 1 to the prior value, then store it, repeat cycle each load. But there's gotta be a more elegant way to do it.

http://profitlabinc.com

huayen’s picture

Can you give more details for downloading count? Thanks.

2houseplague’s picture

If you use computed field, you would have to be sure to call the value from where it's stored in the DB (stored_count_field, for example), bring it into the computed field (add_1_field, for example), then be sure to have the computed field set to save the the new value. Check your weights, so you are sure to call the value into the node (You may want to set it to "hidden", so it won't show) first, then run the computed field AFTER. This way the value that is displayed will be the prior value plus one.

http://profitlabinc.com

mgorsuch’s picture

Wow, the site looks great. You've got tough design skills, man.

Lost’s picture

One word: awesome!

cghobbs’s picture

Looks good *cough* www.simplebits.com *cough*

arvinsingla’s picture

I'm definitely not going to deny that simplebits was an inspiration for the visual direction I wanted to take with my site. But then again a lot of sites helped with that. What i'm not quite sure about is what you're trying to say in your simple and so eloquently stated comment. Are simply trying to poke fun in a friendly manner knowing full well how many countless weeks of work went into learning, developing, and creating everything involved in putting this site and it's content together all on my own. Or are you trying to insinuate that I'm some kind of script kiddie blatantly ripping off peoples work and passing it off as my own? If that's the case I'll kindly ask you to leave your unfounded unmerited comments to yourself. The last time I checked it wasn't a crime to be inspired by someones work especially when you're learning and try to mold and shape an idea into something you can call your own.

I apologize to anyone else reading this rant of mine. It just irks me when someone doesn't consider the immense work that a noob like myself put into trying to create something before they slander it with sarcasm and accusation.

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

daniel-san’s picture

tkamen,

As a simplebits fan, I like seeing the inspired design. We all take inspiration from other sites and the design elements we see in our surroundings. The design's cool and so many of us liked it. Keep up the good work and I doubt Cederholm would be offended. Besides, who better to be inspired by?
But, try not to get too defensive. We're all in this together and take notice of all the great response and conversation that has come about because of your post.
Take care,
Dan

arvinsingla’s picture

Hey Folks,

Sorry for my short fuse yesterday. I'll chalk it up to sleep deprivation and stress. I really appreciate all the support as well as all the great suggestions I've been getting for the podcast. Thanks to everyone, this really is a great community and I'm glad to be a part of it.

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

cghobbs’s picture

I apologize, that comment was bit harsh. You have done good work. It was more of friendly poke. Of course we all use other sites as inspiration and thats good. No doubt there was a tonne of work you put into it. Especially good, since you call yourself a newbie. Keep up the good work. Next time I will keep the sarcasm to myself.

krisvannest’s picture

Well I imagine cg meant it friendly ('course can't speak for him, don't even know him), for myself I sincerely do appreciate all the great how-tos you've posted here and can also appreciate all the work it took you to develop a SimpleBits-inspired theme for Drupal.

But I'd also give a thanks out to Cg because I find it educational to learn where you got your inspiration from-- for one thing, it gives credit to all the original design work possibly pioneered by SimpleBits... I mean it does take time and artistic talent to properly choose great working/looking color combos and page layouts, so in my artistically-challenged opinion (IMA-CO) that's not a trivial part at all... and also kinda gives the rest of us non-designers (or maybe that's more just me ;-) ) some inspiration in the sense that it reminds us that we can all build on each other's ideas. Also FWIW and strictly IMO, I think for instances where we very closely model off someone else's work, even artistically where one site has a very close look-and-feel to one that came before it, it's always cool to say "inspired by" or something like that either on the site itself or at least when talking to other developers in order to give credit to those we borrowed from directly. 'course that's all just totally IMO stuff, not saying I think it's rude not to or anything.

So on a related note tkamen or whomever reading might know, just how hard is it to create a Drupal version of another theme? Anyone know if there's a lot of reworking a WP theme into Drupal?

For instance, I've seen some great looking WordPress themes out there and often thought of purchasing them (like from TemplateMonster or someplace), but didn't know if they're too incompatible or what.

And thanks again to tkamen et al and everyone contributing code/ideas here; really helps to see how it's done.

Thanks,
KV

newdru’s picture

hey tkamen,

I finally got around to exploring with contemplate and I have some last followups for you:

1) When one uses contemplate, the output that is generated by whatever is in the "teaser template' and 'body template' essentially gets injected into node.tpl.php $content. Is that correct?

2) I gather that your article and podcast cck's both had one field for the teaser and a second separate field for the actual node body (full content)?

3) In your above contemplate excerpt for the *article* (not podcast) *page* (not teaser):

<div class="field field-type-text field-field-description">
    <?php foreach ((array)$field_description as $item) { ?>
      <div class="field-item"><?php print $item['view'] ?></div>
    <?php } ?>
</div>

you use a loop. Why do you do that? Your article body is one field with hand code html pasted into it right? So why do you loop through fields when there aren't any other than the body field? Just curious?

4) I can see how you got your primary menu LIST pages (e.g. Articles, Podcasts..) to display lists because they are essentially path aliased views that generate lists. But how did you get the combined teaser lists (both podcasts and articles) on the HOME PAGE? You said you weren't using views for that. Did you have to hard code php into the home page and if so what did you put there (function call to pull the node teasers on the front page)?

5) sepeck answered above that a view is NOT a node. I get that. A view is stored query that will retrieve MANY NODES (e.g. a set of nodes). But when that SET of nodes are displayed on a page, doesn't each SEPARATE NODE, still wind up being "pushed through" node.tpl.php for display as $content just like contemplate body/teasers do? The views wizard basically emulates what contemplate does except that it does it for views. It creates a formatted container that eventually becomes node.tpl.php $content - right? sepeck - wanna chime in here?

6) *** This is the stumper for me. If you look in node.tpl.php and it's various versions depending on the theme, you will see a reference to something similar to the following:

<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

a) The way i "sort" of understand that is that if page == 0 then we have a teaser. Is that correct? If so, that means the title only gets printed for teasers. Then where does the title get printed for full page views????

AND

b) Since node.tpl.php is used to handle BOTH teasers AND full nodes (i think), i would imagine that (as i stated above) that the value of $content must be preprocessed to contain either teaser or body prior to the final display. Is that correct?

7) As an added bonus question if you feel like it - I've embedded flash in html pages before. But I've never used the CDATA wrapper tags before. Why did you use those - what purpose do they serve? I've never been able to find a good explanation for that

Anybody else is willing to chime in on these
thanks

arvinsingla’s picture

Hey newdru,

1) I believe that is correct. I'm would imagine that is how contemplate works. But don't quote me on it.

2) You are correct my CCK nodes have separate fields for teasers and full body.

3) Actually I meant to comment on that before. You are right, in this case the loop is rather redundant as I know I'm only going to output one piece of data. I believe that code was taken directly from the handbook or a readme (i forget which) I just haven't gotten around to changing it.

4) This is drupals default front page. Any item appearing on my front page is published with the "Promoted to front page" check box checked. If you look under Settings >> posts you can specify how many front page items are displayed as well as if they are the full article or just the teaser. I believe any node is capable of being published to the front page.

5) At this point your starting to go over my head as I'm still learning myself. I think this particular question can be answered in the latest drupal dojo session that was held. It's all about theming, including using template.php overrides and tpl.php files. http://groups.drupal.org/drupal-dojo. I have to watch it again as I missed a lot of the stuff they were talking about. Not to mention I need to go through the handbook in more detail regarding this stuff.

6) According to this thread http://drupal.org/node/29132. $page == 0 is used to display the title for "node displays, taxonomy displays, any multi-node display" So basically it handles printing the title for almost any view of a node. conversely if you use $page != 0 it will use that only if you're viewing the node itself.

7) Ahh! This I can answer as I just recently spent a bunch of time reading about it. The CDATA tag allows anything inside it to be considered "character data" which is ignored by the w3C validator for site validation.

<script type="text/javascript">
//<![CDATA[
  var FO = { movie:"/themes/wltp/flvplayer.swf",width:"320",height:"260",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
             flashvars:"file=/files/podcast/1/episode_01_it_has_begun.flv&image=/files/images/wltp_flvcover.jpg&showdigits=true&autostart=false" };
UFO.create(FO,"player1");
//]]>
</script>

I will outline why I used it. If you look at the script above you'll see the flashvars variable uses '&' symbols to separate the different arguments. Unfortunately for valid xhtml you can't use the '&' symbol you have to use the & character code instead. When I used that character code Internet explorer, safari, and opera all saw it and worked properly. Firefox however for some reason doesn't like it. Firefox would only work if the real & character was used. So in order to allow all the browsers to use my flash player properly and have the website validate I had to enclose it in the CDATA tag while using the invalid & symbol.

If you want to read more the article I got my info from is here: http://javascript.about.com/library/blxhtml.htm

Hope that helps

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

newdru’s picture

that's what CDATA is for... :-)

thanks

Nick Lewis’s picture

I'm currently trying to learn how to build my own module to at least just pass the parameters to $extra without having to manually edit the module directly. Can anyone offer any insight as to what path I should take?

Looking at the code, I'm once again not suprised to see that Merlinofchaos has made his code extendable by other modules. The $extra variable is created by invoking all implementations of hook_nodeapi where $op = 'rss_item'. An example of a module extending drupal's rss feeds can be found in the upload_nodeapi: http://api.drupal.org/api/4.7/function/upload_nodeapi

My recommendation is to play with hook_nodeapi's 'rss item' $op, and eventually, you are bound to figure it out.

Fanastic work, btw.

--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
Personal: http://www.nicklewis.org
Work: http://www.onnetworks.com

--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
Personal: http://www.nicklewis.org
Work: http://www.zivtech.com

purifieron’s picture

Your site looks great! I love the heading.

---------------------------------------------
Air purifier
Air purifier

rubensoviccaro’s picture

Very simple but quality designed site. I must say that I like it a lot and it is really a functional and well made web.

yepitem’s picture

hi,man
you have done a great job.
Your wiiliketopodcat.com looks nice.
It's very simple,but it attacts me greatly.

Great job,man.


Welcome to http://www.cheapmesos.com/
Welcome to http://www.vanguardsagaofhero.com/
drupallinux’s picture

nice site. logo looks kewl.

http://www.SiteLancers.NET

Zoologico’s picture

Nice work.
I like the subject matter too.

xeeya’s picture

I really like your site and your videoblog. as I am a gamer myself and I also got the Wii, I am really interesested in the articles and the blog. But I got a technical question. In your description you said:

The biggest problem I've had with this site was generating a clean iTunes compatible RSS feed for the podcast videos. I ended up adding some extra lines into the $extra variable in views_rss.module which creates the enclosure for either the iTunes compatable video or audio file. I took this feed and passed it through feedburner to add the extra tags that I needed.

Can you please tell me more about that? I am trying to do something similar.

vkr11’s picture

Hey,

Your site seems to be working fast, anything specific for that?
Also where are you hosting the website?

-Victor

arvinsingla’s picture

As it stands I haven't really done anything special. Currently I'm not using caching of any kind. I think the bulk of my performance comes from my hosting company. I'm with site5 right now. I jumped ship from dreamhost and haven't looked back.

Sorry I couldn't be more help, but as it stands I haven't really done any performance tuning.

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.wiiliketopodcast.com

---------------------------------------------------------------------
"I am a very model of a modern major general"
http://www.arvinsingla.com

chiebert’s picture

I'll certainly add my vote for Site5 - a couple of years back I went through 3 shared hosts for a contract before I settled on Site5 on a colleague's recommendation. Solid, reliable, super support, and willing to grant more robust access (like ssh and compile privs) when needed without hassle.

tkamen - you're probably tired of hearing this by now ;) but this has been a superlative thread for folks trying to make good-looking, functional sites with Drupal. Edited bits of this belong in a 'cookbook' posting somewhere.

misty3’s picture

I do not have any questions ( except : site5 -which plan? ) or suggestions at the moment but just want to say
I am overwhelmed .... its a f a n t a s t i c site you have built. Many,many praises !!

Best regards