Closed (won't fix)
Project:
Semantic CCK
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2011 at 13:42 UTC
Updated:
17 Jan 2011 at 23:11 UTC
Title of this issue may be misleading ... sorry.
I would like to add two attributes to a cck field: class and id. This is a cck field (nodegoto) where the user selects other nodes that would be of interest to the reader of the current node.
Class would be imgtip
ID would be the path to a screenshot of the selected node (having the name nid.jpg)
For links within the text of the article, the markup looks like this:
[a href="/node/226" id="/sites/default/files/snapshot/226.jpg" class="imgtip"] text in the article[/a]
Can / could Semantic CCK provide this capability for the CCK fields selected from a dropdown (there will be multiple selections)
Comments
Comment #1
rjay commentedFirst of all,
/sites/default/files/snapshot/226.jpgis not a valid ID (slashes are not allowed in IDs), and I'm not sure why you would want a file path in an ID anyways (I'm guessing you have some javascript which does something with it?). You should find another way to output the file path with valid XHTML.Secondly, Semantic CCK can be used to modify the markup surrounding field values, but it does not modify the field values themselves, which is what it sounds like you're trying to do.
You may want to consider using a Node Reference field for selecting related content. That seems like it would be much easier than what you're attempting. If you don't go that route, then you would need to create a field template override (see http://drupal.org/node/206980) or create a custom field value formatter in order to output each value using your customized
<a>tag. Those are more advanced topics, so I'd recommend trying the Node Reference field first.Have a look at the CCK Formatters module and the CCK Extras module, as they may also be of help to you. I believe some of the search modules (eg. Search Lucene, Acquia Search) also provide Related Content blocks.
Comment #2
rkodrupal commentedthanks for getting back. yes the nodegoto cck field is a node reference ... user selects as many related articles as they want and the links appear on the originating page.
the javascript i use to pop up the screenshots needs two field attributes ... it came with class='this-is-a-popup-hotlink' and rel='heres-what-you-popup'. i switched to class and id (being unaware of any xhtml violations). any 2nd attribute would work (e.g., freddys-attribute), but wysiwyg support is nice for data entry. Wysiwyg doesn't natively support rel.
i'll take a peek at your other suggestions.
rgds