By Vc Developer on
I want to change the powered by image to one of the other available images in the misc directory. I the powered by block doesn't have a why to do this, so I'm assuming it's hard coded somewhere. I would like to use the 132x42 images instead. I know how to create a block and display the image using the Body: editor. Is this something possible with this block?
Comments
=-=
The image can't be altered by editing the block? I believe there is a drop down in the block edit screen?
There's no configuration for
There's no configuration for what you want. Just create your own block to display the logo you want to use.
OK Thanks!
OK Thanks!
Yes You Can.
I found this thread whilst searching for the exact same thing, this was the closest I got to the solution.
When I eventually worked it out I thought I would return here to document the solution for others.
I did find on http://dcs777.homeip.net/?q=content/how2-drupal-hacks a method that would work but it suggests you change core files, not really something any decent Drupaler should be doing.
As that posts says, dig through
/modules/system/system.moduleand you will find at the very end of the file the functiontheme_system_powered_by(), which takes the following form.Now you need to create a
template.phpfile in your theme folder if you dont already have one and then append the following code at the bottom.This should override the original
theme_system_powered_by()function and ensure that future updates dont wipe out your changes.Make sure to flush your theme registry after updating your files.
Excellent research! I shall
Excellent research! I shall do as suggested. Thanks!...
Convert a function to template
Here is another way of changing the default "Powered by Drupal" message.
I think this is an example of "Converting from functions to templates" About overriding themable output
As I'm terribly confused by the concepts of 'theme function overrides' and 'preprocess functions' I hope this may help others struggling with these concepts - and welcome any comments that may point to a better explanation within the documentation or indeed correct any misconceptions I may have!
I've found the documentation to be difficult to understand - but the more I experiment the more it is starting to gell!
Mainly I've been trying to get my head around these two documents Creating a sub-theme and About overriding themable output. Also the fantastic Zen documentation found in the various read-me files has been very useful.
I hope this example will help someone else struggling with this concept of themeable over-rides.
The following code needs to go into a file called
which can be anywhere within your theme folder.
The default place in Zen is the templates folder /sites/all/themes/YOUR_THEME/templates. Initially I named it MYTHEMENAME-system-powered-by.tpl.php, as the documentation seemed to indicate it should be prefaced by your theme name, however that didn't work!
The only reference I could find about NOT using a function within a 'theme function override' is an old document
template.php: Overriding other theme functions
In trying to re-find where I had seen this advice I came across another article Best practice for declaring functions within '.tpl.php' files? which confirms it is not best practice to use functions within '.tpl.php' files - however no explanation is given. I simply found that a function didn't work.
I'm not using any variables so the simple HTML is fine to do what I want.
I'm using Drupal 7.9 and experimenting with a Zen sub-theme.
i made it into a module
I came across this again whilst searching for an old post,.
I meant to revisit this post last year, when i made the Picon module, which allows for changes to the 'powered by' icon.
see http://drupal.org/project/picon