Hi there,
i've ported this module to drupal 6. could you please review the code and get back to me if you are happy / require any changes to the module.
its been updated to use the new D6 hook_schema() for the install files.
I've also altered how the image title is displayed on 'view'.
instead of using hook_nodeapi() to do a drupal_set_title() i've updated support for the new template_preprocess functions in drupal 6.
This exposes the image title to the page.tpl in the variable $node->title if it is available.
it is also improved so that the browser title bar text remains, as previously using drupal_set_title() with the image, completely wiped the title bar attribute.
I've included the $node->title text inside a tag in the variable which is being passed up also. This is merely for search engine optimisation reasons - so Google can still index your H1 text, as opposed to it only being an image tag.
For this reason in your style.css you should include
h1.title span{
display:none;
}
to display only the image on screen but allow the node title to be indexed by search engines still.
might be worth including this in the readme.txt
Thanks
Graham.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | image_title.admin_.inc_.patch | 1.54 KB | greg.harvey |
| #3 | image_title.info.patch | 628 bytes | greg.harvey |
| #3 | image_title.install.patch | 2.89 KB | greg.harvey |
| #3 | image_title.module.patch | 18.58 KB | greg.harvey |
| #3 | readme.txt.patch | 2.44 KB | greg.harvey |
Comments
Comment #1
greg.harveyUsing this patch and it works well. +1 from me.
BTW, I am working on additional functionality for 6.x which will hook in to the menu_router table allowing an image title on ANY PAGE, not just nodes. The sooner a proper 6.x-1.x-dev version is created using Graham's patch, the sooner I can contribute my work. =)
Comment #2
greg.harveyActually, I didn't have time to wait, so I've forged on. I think Graham's patch above is fine as a version 6.x-1.x-dev (a straight swap for the 5.x dev snapshot), but while I was at it I re-wrote a lot of the module. I also included a proper install file with a tested upgrade path from 5.x-1.x-dev to this version. Changes are:
I *think* that's all. Files are attached. Will provide a patch for the .install and .module files against latest dev snapshot, if required, but probably easier just to try out the attached files. On Drupal 6, copy them all to an image_title directory in a valid modules folder, rename removing the .txt extensions and install. If you're upgrading from D5 to D6, this upgrade path should work too. I tried it and it worked fine running update.php.
This would probably even qualify as a 6.x-2.x-dev release! =)
I'm off for a well-earned beer.
*** PLEASE USE MODULE IN COMMENT CODE #4 BELOW ***
Comment #3
greg.harveyAnd here are all the changes as patch files, ready to be applied to head. Note the readme was updated too.
*** MODULE PATCH IS OUT OF DATE - ONCE APPLIED, PLEASE DIFF AGAINST THE MODULE CODE IN COMMENT #4 BELOW AND APPLY THE CHANGES ***
Comment #4
greg.harveyMinor bugs:
- fixed the hook_cron to stop a PHP warning occuring
- removed a legacy call to an image.module function not used for anything
- added additional
ifstatement to file delete on save of new image_title, to make sure we don't delete the file we're uploading in case of some file corruptionFull module attached.
Comment #5
jonnyplunder commentedThanks for the D6 update, but is there any reason why the image title is displayed under the existing text title? I mean, no offence or anything, but if I wanted that then I'd just use an image tag in the content itself.
I'm still poking around, but I'm not seeing any way to make it so the image title replaces the text one.
Comment #6
greg.harveyYou're supposed to use CSS to hide the H1 title. It's still there for SEO. The reason to use this instead of an image in the body is this outputs the image in the $title variable, whereas an image in the body is just that - you have no additional control over where it appears - it will always be stuck in $content in your template.
Comment #7
joachim commented@greg.harvey -- sounds like some very cool work there! You should really apply for maintainership of this if it's abandoned and get this committed, as it's getting very hard to follow what's what in these attachments!
Comment #8
greg.harveyI probably should, since the issue queue appears to be dead.
Edit: T'is done: #555654: Request to take over Image Title
Comment #9
dksdev01 commentedHi All,
Drupal 6.x port will be available in next 12 hr.
http://drupal.org/node/683100
thanks, Deepak
Comment #10
greg.harveyThanks. Any chance of making it a formal release (6.x-1.0)? There's no need for the 6.x branch to not have an approved release. It's been working well in production on www.defaqto.com for over a year and there are no known issues. Leaving it as a dev snapshot will inhibit use (many people won't use dev snapshots as a point of policy).
Comment #11
dksdev01 commentedSure, will have that very soon. thanks, Deepak
Comment #12
whan commentedHi all
I have tried the patch for drupal -6 and it works !!!!!
Thanks
Comment #13
greg.harveyThe patch == 6.x-2.x-dev. You don't need the patch any more. =)