I'm sure this is simple but I can't wrap my head around it.

Using D6.6, CCK 6.x-2.1, FileField 6.x-3.0alpha5, ImageField, ImageCache,

Each page will have a unique link to a pdf of a brochure.

I have a CCK fileField that links to a pdf or doc that the user uploads using the fileField_file. That part works fine.

Here's the customization: Instead of the 16x16 icon with the actual file name, I need a 96 x 96 icon (which I have waiting) and a generic name, say "view brochure" handing the css is easy, but how do I get customization?

I'm surprised at how difficult this is to crack.

Much Thanks in Advance!

Comments

Screenack’s picture

Am I going about this all wrong?

Do I want to create each Document as a node itself with the following CCK fields:
An image imageField
An uploaded file (fileField)

And then I would have a link to this file, and this link will appear as a graphic that links back to the document.

Is that right?

flabat’s picture

is the icon the same for all files/nodes?

if so, a custom node-content.tpl.php will do the trick

Screenack’s picture

Do you mean for all nodes of type "brochure" then, yes, they'll have the same icon.

And then for White Papers, News Releases, etc.

Would Contemplate come into play here?

So, the icon will match category -- which I'm guessing would bring taxonomy into play?

WorldFallz’s picture

If you have a taxonomy term to each type of file, you can do this easily with the http://drupal.org/project/taxonomy_image module (i did something similar with it).

Alternatively, you can theme it in -- and yes contemplate is one way to do that. The other would be to do it in the node.tpl.php file as the other responder suggested.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Screenack’s picture

I've been warned this is an awesome community -- and I am deeply thankful for everyone's help!

I want to love drupal -- my head is there, but not my heart, yet. I see the verdant pastures, I'm just not in them yet.

To recap the above
One good approach is to create a content type, say "document" that, using CCK and node title, captures

  1. Uploaded file "FileField"
  2. Document name (titile)
  3. Taxonomy / category (i.e., "white paper" "brochure" "sell sheet" etc) (Not sure how to do that within the modified zen theme)
  4. An associated graphic (which I might be able to do with taxonomy_images...)

And then, I can link to these nodes as teasers, right?

Two wrote that I should modify the appropriate node.tpl.php, but, I wasn't clear whether you mean the source node or the node from which these items display.

So, here is the "brand-me-as-a-dolt" question: how do I link to these nodes from the nodes that refer to them? I think I understand how to do so with views -- but is that my only option? Do I then need a view per page? If so, then I'll need to mix views and node content and necessary block conditionals. Oy my head hurts. I know I'm over-thinking this.

Here's my goal:
I'd like the code to render something like:

<div class="doclib"> 
    <p class="imglink"><a href="link/to/node/document"><img src="link/to/node/graphic" /></a></p>
    <p class="caption"><a href="link/to/node/document">View [%category-title]</a></p>
</div>

† detail: the "docLib" css is float;left, clear:right, so as to create a horizontal list, but I suspect that's unimportant here.

Thanks again!

WorldFallz’s picture

I did almost exactly as you are proposing-- using cck, views, and taxonomy_image.

Yes, once you create a node for each document, you would then use views to list them in all sorts of ways. However, you don't need to create one view for each type of document-- you can create a single view with an argument for the document type (which would be the taxonomy vocabulary you use for the document type). You can then list the different documents with urls such as '/documents/brochures' and '/documents/sell-sheets' using just one view.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Screenack’s picture

In a platonic way, be assured. Thanks!

Awesome. I have to plow through a fog of perfunctory business meetings but now I'm jazzed to check this out.

How do I assign a category to a "document" node -- or any node, really? Google isn't helping me here, and I don't know if the zen theme (garland for admin) hides access to a taxonomy/category widget.

WorldFallz’s picture

In a platonic way, be assured. Thanks!

LOL, no worries.

How do I assign a category to a "document" node...

In d6, enable the taxonomy module (at admin/build/modules), then navigate to admin/content/taxonomy and click on the "add vocabulary" tab. Give it a name (ie document type), select the "document" content type (or whatever you called it), and add some terms.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Screenack’s picture

Sometimes drupal is like a hot knife through butter, other times its like my head against a brick wall

I've done a ton of poem-inspiring stuff with nodes and views 2 and I love it. HOWEVER, I still can't get a graphic link and caption to point to a file on a disk, i.e.,:

<p><a href="file/on/disk.pdf"><img src="somegraphic" /></a></p>
</p><a href="file/on/disk.pdf">Grab your marvellouse file here</a></p>

I can use a views 2 tpl to get one field to override to the second line above (annoyingly requiring a strip_tag call) but I can't (apparently) reference the value of 'field_doc_image' from within the field-specific template override. I suppose I can write a conditional in the table tpl over ride, but, really, didn't we link graphics to downloaded files in 1995? Why is this so hard?

I've tried the taxonomy_image module, which isn't allowing me to successfully upload my file (no permissions errors reported) but that feels like a curve ball.

Why is something so basic so esoteric? Yes, I'm sure it's me -- sorry for venting -- Help!

Screenack’s picture

WorldFallz’s picture

i still think taxonomy_image is the best way to do this (i would work through the issue to get it working), but when you want to create links it's best to use the l() function:

l('<img src="image.png"/>', 'files/somefile.pdf', NULL, NULL, NULL, FALSE, TRUE);

You should be able to insert that code by theming the view field.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz