WYSIWYG configuration / image handling / editor role management
This page is a placeholder / pointer to the thoughtful “WYS(is not always)WYG(but it can be)” documentation by Andrew Mallis on Google Docs, which deals with configuration options of WYSIWYG editors, role management, image handling and file organisation for a better user experience.
The discussed configuration is also available via distribution profile on gitHub.
Read moreTaxonomy Term Path
If you want to save files attached to a node inside a special file structure you can use this snippet with the filefield_paths module.
If you add a taxonomy_field to a node and tag it with foo and bar, this snippet generates foo/bar/
"field_texturen" is a sample name here, replace with your fields name.
WORKING CODE
if(isset($data['node'])) {
$field_data = field_view_field('node', $data['node'], 'field_texturen');
foreach($field_data['#items'] as $key => $term_data) {
//save names as lowercase
$terms[] = strtolower($term_data['taxonomy_term']->name);
}
//implode
$path = implode('/', $terms);
}
if(!empty($path)) {
return $path . '/';
}One may think this should work too, but it does not.
THIS ONLY WORKS ON NODE UPDATE.
//are we inside a node
if(arg(0) == 'node' && is_numeric(arg(1)) ) {
$field_data = field_view_field('node', node_load(arg(1)), 'field_texturen');
foreach($field_data['#items'] as $key => $term_data) {
//save names as lowercase
$terms[] = strtolower($term_data['taxonomy_term']->name);
}
//implode
$path = implode('/', $terms);
}
if(!empty($path)) {
return $path . '/';
}