Closed (outdated)
Project:
Advertisement
Version:
6.x-2.2
Component:
ad module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2010 at 10:36 UTC
Updated:
19 Sep 2024 at 11:31 UTC
Jump to comment: Most recent
Comments
Comment #1
n_nelson350 commentedWell which contributed module are you using for image? Or have you developed a different module for that.
please give me the details in more...................
Reply at the earliest possible time.
Comment #2
m1n0 commentedFor image I use only upload module, advertisment module uses it and thru file attachment I upload the file
Comment #3
david.lukac commentedSubscribing
Comment #4
SweeneyTodd commentedI am in the process of changing the code that displays the ads from functions to template files (.tpl.php). This will allow preprocessor functions to work and easier theming of the ads. You should be able to use this to display your cck content. I hope to post back the files in the next couple of days. I will add another comment with a link to where I have posted (use my contact form to remind me if I forget).
The other solution would be to create a new ad type with the additional field as part of the ad instead of cck. This should be a matter of an hour or 2 to code, but not a great solution if you already have a load of data input for image ads.
Comment #5
SweeneyTodd commentedI have just posted the template file (and a patch for ad_image.module) for the image ad (http://drupal.org/node/852756#comment-3200338).
I have had a look at how to add cck fields to a template file as well - I haven't actually tried this out so let me know if it works. I found this article (http://drupalib.interoperating.info/node/99) which has a template referencing cck fields. It looks like the correct form of the reference is:
The ad-image-ad.tpl.php file should be copied to your theme folder before editing.
Note: for this case you do not need to edit the template_preprocess_ad_image_ad function but if you decide you need to, paste it into your theme template.tpl.php file and rename it MyTheme_preprocess_ad_image_ad. Edit this copy, not one in the module.
The problem with this is that $node is not passed to the template file, so it looks like the module code is going to have to be hacked to send it (not good practice, but the only way I can see at present).
If we ask the module maintainer nicely, maybe he will add $node to all the theme function definitions for a future release to extend what can be done by theming without hacking the module code. I will log a separate issue to request this.
In the ad_image.module file (the one which my patch has been applied to), find the theme_ad_image function and change the arguments array for ad_image_ad as follows:
Since the theme_ad_image_ad function is no longer used this should not cause a problem. If it does change the function definition to the following:
Anyway, this will make any node properties available as part of the ad template so you can output cck fields or (the real reason I worked on this) taxonomy terms.
Have fun!
Comment #6
anonymous07 commentedSubscribe
Comment #7
iztok commentedSubscribing.
Comment #8
n_nelson350 commentedUse of hook_form_alter can be done in this case for whatever changes has to be made in content type fields.
Regards,
S. Nelson
Comment #9
lrwebks commentedDrupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!