Adding a non-editable link to content type, CCK field?

Events happening in the community are now at Drupal community events on www.drupal.org.
Susan Rust's picture

Hey SDUG folks, we have a little coding question. We have a content type that needs to be pre-populated with a fixed link. What is the best way to have a CCK field or other wrapper so this particular content type is published with the link embedded on the node? Thanks!

Comments

...

Bill Bostick's picture

The non-coding way is to add a link field to the content type, set the content type's default value for the field, and use field permissions (part of cck, but you have to enable it) to protect the field from edits.

Field Permissions

Susan Rust's picture

Hey Bill - We hate turning that module on though sometimes it's just the right thing! But thanks.

kscheirer's picture

Then you should add it to the node's tpl file directly. Bill's way is better if you want the link to actually be part of the node though, and generally behave like other cck fields.

custom tpl file

Susan Rust's picture

Hi Koat Rack Karl -- cool, made custom tpls for the content type (there were three) and hardwired a link. Perfect solution, thanks!

the problem

manoloka's picture

the problem I see with this approach is that will only work for new nodes. all the existing nodes won't show the link (text or whatever you want to show).

Mmmm ... I can't believe there isn't any "CCK custom field" module similar to the "Views custom field" http://drupal.org/project/views_customfield

I've used Token Field

manoloka's picture

I've used Token Field http://drupal.org/project/token_field for that purpose

San Diego DUG

Group categories

Event Classifications

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: