Hi,

For my website I wanted to publish / unpublish header-images with scheduler.module. As I was trying things out I first noticed that regardless of header image nodes being published or unpublished they were shown in the region. Reason being; header image just adds a class to a parental div with which you can css display:none the header image.

if (!$node->status) {
    $output  = '<div class="node-unpublished">';
  }

After fixing this with css I found out that headerimage.module doesn't supply other modules with the nessecary variables on a node_load. Therefore, unless a header-image is editted manually, all the variables are gone when the node is editted by a process like scheduler.

Once I fixed this I found out that header-image module wasn't playing nice with i18n. Although you could edit the content type to allow translations these weren't picked up and outputted by the module. Which is too bad if you have a multilingual website with some slogan or quote in the header-image. This I also fixed.

As an added bonus I added a field in which moderators can enter an optional path. By entering this path the header-image outputted to the block will become a link to the set path. When no path was entered, the header-image is just an Only local images are allowed..

While I was editting the module I decided to return a NULL when the node was set to unpublished. The reason I didn't like the css solution was simple; unpublished means unpublished and that's not the same as hidden by css. Smart visitors, but also Google check out the page source, and although the header-image might not be visible on screen, it's still in the code and therefore accessible. What if you have some news announcement in the header-image you've set to be published next week, but Google crawled your website and returns it as a result in Google images? Quite a leak!

Anyways, I will try to post my patch here this week for reviewing. But my svn is down right now so I can't promise anything.

I hope you'll like the new features and that it will be incorporated into the module.

Cheers,
Bartezz

CommentFileSizeAuthor
#8 headerimage.module.zip6.38 KBasap-2
#3 headerimage_i18n.zip21.59 KBBartezz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

simone.girlanda’s picture

I'm interested in i18n too.

I'm using an "Header Image" block to manage my footer, I did it to manage two footers, the italian and the english one.
Now to have it works I created two footer "header image" blocks and two pages, one for Italian and one for English.
It will be a more clear configuration to have only one block, with two page inside.

Bartezz’s picture

I will post my version of this module tomorrow. I added two main functionalities;

- i18n support
- respecting publishing settings so that headerimage.module works with scheduler

I have it running on a live site without problems myself but no guarantees :)

Cheers

Bartezz’s picture

FileSize
21.59 KB

Hi Simone,

Here's my edited version of headerimage.module. Like I said I've added i18n support and support for scheduler.
I also added support for a user definable path so that header images can become clickable.

I'm using it myself to have header images setup for promotional functions they headerimages are about special deals and can be clicked on to read more about the promotions/specials, I have them published and unpublished with scheduler.module.

I changed the headerimage table in the db by hand but have included an update function in the install file so it should install and run without problems if you run update.php.

I can't guarantee anything so backup your database before giving it a go (backup and migrate module is nice for this) but I have it running for months now without problems so I don't expect you to have problems with it!

Cheers

Sutharsan’s picture

Version: 5.x-1.1 » 6.x-1.x-dev
Assigned: Unassigned » Sutharsan
Status: Active » Needs work

The unpublished issue has been solved in 6.x The optional path is a feature I will not include in the module.
I will try to pick-up the node_load and i18n issues in the folowing days.

Bartezz’s picture

Hi Sutharsan,

Thanx mate! Hope you can use some of my coding...
Maybe the optional path can be a module setting so people can turn it on if they want it.
Like I wrote, it can come in handy if you use header images for promotional stuff instead of just 'decoration' and you want to attract the visitor to a certain page.

Cheers

Sutharsan’s picture

I don't want to touch the content building. Header Image is about selecting content not content building. I don't deny your requirement, but in this case a recipe (with cck fields and theming) in the handbook can be a solution. Would you be willing to write this?

Do you have a working version of your i18n and node_load changes for the 6.x version?

Bartezz’s picture

Hi Sutharsan,

Will dive into writing something for the handbook as soon as I have some more time.
Unfortunately my i18n and node_load fix is only D5. Haven't developed for D6 yet, sorry.
But I reckon there isn't that much of a difference, maybe for the i18n part.

Cheers

asap-2’s picture

Issue tags: +header image language
FileSize
6.38 KB

Hello, i'm a new Drupal user, and this is my first post here. I attach the module in 6.x version with multilanguage adaptation.

It works for me. Thanks for all.

Bartezz’s picture

Status: Needs work » Needs review

Completely forgot about this one :)
Thanx for that!

sense-design’s picture

Status: Needs review » Closed (won't fix)