[documentation] 2 Documentation Questions
Benjamin Melançon
pwgdarchive at gmail.com
Sun Oct 21 19:14:46 UTC 2007
In answer to #2, Taxonomy hierarchy:
in the taxonomy_save_vocabulary() function that takes an array, just add a line:
'hierarchy' => 1,
Where 0 is flat, no hierarchy, 1 is single hierarchy (normal), and 2
is multiple parentage, that is, a term can appear in more than one
place in the hierarchy by having more than one parent.
In an example from code I'm working on:
// Create the Places vocabulary
$edit = array('name' => t('Places'), 'multiple' => 1, 'required'
=> 0, 'hierarchy' => 2, 'relations' => 1, 'module' =>
'place_taxonomy', 'weight' => 5, 'taxonomy_location_enabled' => 1,
'description' => "This vocabulary is created by the place_taxonomy
module to store locations."); // , 'nodes' => array('forum' => 1)
taxonomy_save_vocabulary($edit);
-benjamin
http://AgaricDesign.com/
On 10/17/07, add1sun <drupal at rocktreesky.com> wrote:
> Hi Shai,
>
> Thanks for stepping up to help out with docs. That section does need lots
> of love. As for Question #, the first thing I'd recommend that you do is
> ask to be added to the docs team (http://drupal.org/node/23367) as this will
> allow you to edit nodes directly rather than leaving comments. You are
> correct that tables may be used in nodes as long as the Input Format is set
> to Documentation. Images may also be used with that filter.
>
> Once you are on the team you can edit the page as needed and leave a Log
> message about your changes. After the comments have been incorporated into
> the page please make an issue under the Documentation queue
> (http://drupal.org/project/issues/documentation) to have
> the comments deleted so we can keep the handbook tidy.
>
> I don't have time to look at the code for Question #2 right now but you may
> get better response to that in IRC or the Forums.
>
> Thanks!
> Addi (add1sun)
>
>
>
> On Oct 17, 2007, at 1:08 PM, Shai Gluskin wrote:
>
> Gang,
>
> In my first attempt to help out with Drupal documentation I've taken on
> making improvements to this page:
> http://drupal.org/node/115522
>
> [Background -- you can skip to the questions if you like]
>
> It's in the part of the manual about installation profiles. It shows people
> how they can perform configurations for various parts of their Drupal site
> with scripts instead of lots of clicking and waiting for screens to draw.
> And of course, the scripts can be easily saved and used for other sites etc.
> A much smaller solution than an installation profile, but a handy set of
> snippets indeed.
>
> Unfortunately, the page is very confusing, the examples not always full, and
> there is no explanation of what possible different values each attribute can
> take, whether that attribute is required and what precisely it does.
>
> What I've done so far is make the Add Taxonomy Vocabulary sample script much
> fuller, and I've also documented the script so people will know exactly
> what's what when they write their own.
>
> Here is what I've written so far:
> http://drupal.org/node/115522#comment-281758
>
> Two questions
>
> I couldn't figure out a good format to present the table I created that
> explains the relevant information for each attribute -- since forum comments
> don't allow tables. I presume that the nodes themselves allow table tags,
> yes? Any other ideas about how to present tabular information on a handbook
> page?
> The original example did not include setting the taxonomy hierarchy
> attribute and I can't figure out the syntax. Can someone help with that?
> Thanks,
>
> Shai
> --
More information about the documentation
mailing list