Header image soon scheduler and i18n friendly?

Created on 15 December 2008, almost 16 years ago
Updated 5 June 2023, over 1 year ago

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 .

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

📌 Task
Status

Closed: won't fix

Version

1.0

Component

Miscellaneous

Created by

🇳🇱Netherlands Bartezz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024