i am very much a drupal newbie, and i have run across a snag in my understanding that i am hoping someone can set me straight on.
i am guessing i am just using the wrong tool in drupal (block vs module).

i want to create banner ads at the top and bottom of my site. we need to use some custom stuff (php etc), so i thought this would be a good thing
to build as a BLOCK. however, it seems that blocks can only be controlled via the web interface, that is, live inside the db. we would much rather
have our php code live in files so we can use svn, edit php with a real editor (vim), etc.

maybe i should be building a MODULE instead. it seems like overkill somehow to me because this is just some little selfcontained bunch of code that
doesnt rely on anything else in the drupal system (it doesnt care what page or node we are looking at, it doesnt care if the user is logged in, etc.) plus modules
seem less suited to be things you can move around the page and put in different places.

but maybe i just need to jump in deeper and make a module to do this. but since this is about the simplest part of the site design i have to do, and it doesnt
seem suited to a block, i am having a hard time getting my head around what *would* be good to make as a block? seems like anything complicated enough
would necessitate both revision control and code editing, therefore eliminate block as an option. unless i am meant to stick something like
require_once('somecode.php'); into a block, which i guess would be possible, but seems kinda silly. (and still doesnt facilitate easily pushing this from
a dev site to a live one.)

thanks!!
-jon

Comments

nevets’s picture

Since you do not seem to want to use a block (I personal do use blocks for this kind of thing) and since it does not vary with the page you could place in directly in the page.tpl.php file for you theme. You could even use a 'require_once' at the approriate place in page.tpl.php if you want to control/edit it separately.

Mumonkan’s picture

oddly enough, i was just sort of messing with this idea exactly.

i guess my problem with this (conceptually i mean -- but i am just learning drupal as i said), is that this makes
the ad stuff theme-specific. i kinda was working for a generic solution that would allow this very self-contained little
chunk of code work in different themes too.

but that said, i dont think our site will end up "themeable". and even if it did, i think it would be fairly easy to add
this to other themes. its probably a good stop-gap measure anyway. thanks for the tip!