$data['vocabulary']

Created on 18 June 2022, over 2 years ago
Updated 3 February 2025, 26 days ago

Dear Sirs,
i have found difficulty in adding a custom token type for the 'Vocabularies' kind.

Task:

Invoke all the tags for a desired vocabulary.

Issue:

By choosing

<option value="vocabulary">Vocabularies [needs: vocabulary]</option>, it demands $data['vocabulary'] be declared.

Do not understand how to code it correctly.

Proposed resolution:

By means of the "custom" (token type), correct snippet would be:

<?php
 $result = "";
 $vocabulary= taxonomy_vocabulary_machine_name_load('tags');
 if ($terms = taxonomy_get_tree($vocabulary->vid)) {

   foreach ($terms as $term) {

     $taxonomy[] = $term->name;
     $result = implode(',',$taxonomy) ;

    }
return $result;

}
?>

Anyway, i wish i would understand how to declare through the Vocabularies option.

💬 Support request
Status

Closed: outdated

Version

2.1

Component

Miscellaneous

Created by

🇷🇺Russia allexim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024