I have been searching for an answer on this for 2 days and figured I would post it here to see if someone has an answer.
I am trying to create an easy way for someone to create a gallery who doesn't understand HTML or PHP and cannot remember the BG tag. I have a site with BG and CCK. I have created a new content type for pictures, given it a title field and a folder field (the name of the folder in which the pictures can be found).
My problem is with the output. I have a third text field that has filtered text and the default value of [bg| print $node->field_picture_folder[0]['view'] ]. I initially get the error of "warning: opendir(/Users/Ryan/Sites/drupal-5/files/ print $node->field_picture_folder[0]['view'] )". After rearranging the input formats, it doesn't display anything.
My question, is there a way to call the folder name for the BG tag from an input field?
Comments
Comment #1
jcjohnson commentedI am trying to do the same thing. I can get the bg tag to show up a gallery by using my template file for the content type. But I only get the tag showing up in plain text without the gallery. However, you could try this in your node-(content type).tpl.php instead of the default value stuff.
print '[bg | '.$field_folder_name[0]['view'].']';
Comment #2
jcjohnson commentedCorrection, the code should be
$BGTag = '[bg|'.$field_folder_name[0]['view'].']';
print check_markup($BGTag);
Comment #3
neptunus commentedGive the folder name to the Brillant Gallery with a CCK text form:
You will need:
- CCK module
- CCK Computed Field module http://drupal.org/project/computed_field
- Brillant Gallery module
Edit your content type.
Add a text field to your content type called: field_folder_name type: text
Add a computed field called filed_foldername_bg
Edit this field:
Computed Code:
$node_field[0]['value'] = $node->field_folder_name[0]['value'];
Display this field:
$display = '[bg|'.$node_field_item['value'].']';
Save!
That's all!
Comment #4
whitespirit commentedHello,
I can see the computed field display, the code is ok. But it's the [bg...] code and the brilliant gallery isn't display. Have you got a solution ?
Thanks.
PS: sorry if my english is bad !