Hello,
This is my first post - and I'm a real beginner, so please feel free to shout at me and tell me where I'm going wrong...
I am using WYSIWYG with the FCKeditor and Insert modules. It all works brilliantly for inserted images, and for listing all of my files at the bottom of the page as Generic Files.
However, I want to be able to insert equally pretty file icons and links, into my body area. When I use Insert for this, I simply get a text link, sans filetype icon etc.
Any idea what I can do?
All help is much appreciated, but please bear with me... I'm learning! :)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | insert_709010.patch | 955 bytes | alexpott |
| #5 | insert_709010.patch | 1.46 KB | alexpott |
Comments
Comment #1
madcapp commentedComment #2
madcapp commentedObviously my request so badly worded / nonsensical, no one can offer me any help...
Anybody?!
Tis much appreciated...
Comment #3
quicksketchHey madcapp, welcome to d.o. Sorry this took so long but as a maintainer I'm preoccupied with a lot of other things besides support requests. Basically what you're requesting requires theming, support for which I don't usually provide in the issue queue (I teach classes on theming as part of my day-job, so surely you'd understand there's a line between what's free and what's not for me).
Basically what you need to do here is the templates provided by Insert and override them in your theme. To do this:
- Copy the "insert-link.tpl.php" file from insert/templates directory into the theme you're using on your site.
- Clear your caches as admin/settings/performance from within your Drupal site.
- Change your copy of insert-link.tpl.php to include icons or any other markup you want to add.
When it comes to what exactly you need to do in that file, I'm afraid that's definitely out of scope. I'd suggest looking at the theming that FileField provides and try to emulate it in your own template.
Comment #5
alexpottHi quicksketch
Thanks for the excellent insert module (and a few others :) )...
Here's a different approach as I have a situation were we want to choose between a "text link to a file" and "icon + text link to a file". Basically in filefield.inc it defines it's own style - "generic file" (so it's that as the usual field display options). The only downside to this patch is that it requires the field name to attached to the widget array - which feels like a bit of a hack!
Feel free to close this again if you think this is out of scope.
Comment #6
alexpottHere is a simpler and better patch for 2 reasons:
1. No longer has the line of code that feels like a bit of a hack
2. Doesn't insert a load of unnecessary div's into the content.
Comment #7
gooddesignusa commentedThanks alexpott for the patch I'm going to try it out because that sounds like something I need. I'll try to post back after.
Comment #8
Scott J commentedI haven't tried it yet, but I think that filetype icons is one thing that the http://drupal.org/project/filefield_styles module is trying to achieve.
Comment #9
BrandTim commented#6 patch works great for me.
Tim Knittel
Comment #10
ellanylea commented#6 patch works for me too!
Would be great to commit into next stable version of Insert.
Many thanks!
Comment #11
quicksketchI probably won't be including this as a built-in feature of Insert. Though as has been noted, this is fairly easy to accomplish through theming. I'm marking this fixed as a support request.
Comment #13
adamcadot commentedHi, I'm relatively new to Drupal and was wondering if anyone could assist me. Since the patch in #16 gives me an error, I need to find a way to implement this in the latest version. I know how to modify tpl.php files but not very good at the php part of the template.php file. I've watched Lullabot's Advanced Theming video but I'm not sure how to accomplish this.
Thanks
Comment #14
adamcadot commented^- nevermind