Mailing List Archive

Contributor Types and Roles
Hi All,

Presumably I'm missing some key documentation, but I have been unable to
locate anything substantial regarding Contributors, Contributor Types,
and Roles.

Basically, it boils down to a few questions:

1. Within a template, how does one find the Contributor Type for any
of the Contributors returned by $story->get_contributors()? So
far, I've only been able to find the Person object, then grab that
Person's first and last name.
1. Is there a list of what $attrs the
Bric::Util::Grp::Parts::Member::Contrib->get_data($attr) can
pull? So far I have failed to get this method to return
anything at all.
2. Bric::Util::Grp::Parts::Member::Contrib->get_roles() returns
nothing for me; apparently I have no Roles in my system. How does
one go about creating these Roles?
3. Bonus question: how does one SEARCH in the GitHub Wiki?

Thanks,
Nick
Re: Contributor Types and Roles [ In reply to ]
On Jun 1, 2011, at 1:05 PM, Nick Legg wrote:

> Hi All,
>
> Presumably I'm missing some key documentation, but I have been unable to locate anything substantial regarding Contributors, Contributor Types, and Roles.
>
> Basically, it boils down to a few questions:
>
> 1. Within a template, how does one find the Contributor Type for any
> of the Contributors returned by $story->get_contributors()? So
> far, I've only been able to find the Person object, then grab that
> Person's first and last name.

$contrib->get_grp->get_name

> 1. Is there a list of what $attrs the
> Bric::Util::Grp::Parts::Member::Contrib->get_data($attr) can
> pull? So far I have failed to get this method to return
> anything at all.

I don't think there are any.

> 2. Bric::Util::Grp::Parts::Member::Contrib->get_roles() returns
> nothing for me; apparently I have no Roles in my system. How does
> one go about creating these Roles?

In the Contributor Manager, in addition to the usual "Edit" link, there's one named "New" or something like that. It creates a new role.

Actually, this stuff might be completely different in 2.0. Poke around at an individual contributor profile in the admin interface. I'd tell you more precisely but I don't have Bricolage running anywhere at the moment…

> 3. Bonus question: how does one SEARCH in the GitHub Wiki?

NFI. Nothing about wikis here, alas.

https://github.com/search

Best,

David
Re: Contributor Types and Roles [ In reply to ]
On 6/1/2011 7:08 PM, David E. Wheeler wrote:
>> 1. Within a template, how does one find the Contributor Type for any
>> of the Contributors returned by $story->get_contributors()? So
>> far, I've only been able to find the Person object, then grab that
>> Person's first and last name.
> $contrib->get_grp->get_name
I hadn't noticed that grp was a property I could access in the
Bric::Util::Grp::Parts::Member class. That's exactly what I needed -
thanks!
>> 2. Bric::Util::Grp::Parts::Member::Contrib->get_roles() returns
>> nothing for me; apparently I have no Roles in my system. How does
>> one go about creating these Roles?
> In the Contributor Manager, in addition to the usual "Edit" link, there's one named "New" or something like that. It creates a new role.
>
> Actually, this stuff might be completely different in 2.0. Poke around at an individual contributor profile in the admin interface. I'd tell you more precisely but I don't have Bricolage running anywhere at the moment…
>
I haven't been able to find anything like that, but perhaps I'm looking
in the wrong place. I checked in Admin -> Publishing -> Contributor
Types and Admin -> Publishing -> Contributors. Speaking of which, both
of those features are broken on demo.bricolagecms.org. I've just filed
a bug for it here:
http://bricolage.lighthouseapp.com/projects/29601-bricolage/tickets/262
>> 3. Bonus question: how does one SEARCH in the GitHub Wiki?
> NFI. Nothing about wikis here, alas.
>
> https://github.com/search
It looks like GitHub wikis have no such feature, but one can use the
magic of Google as a workaround:
http://support.github.com/discussions/repos/3395-wiki-search

Thanks,
Nick
Re: Contributor Types and Roles [ In reply to ]
On Jun 2, 2011, at 5:31 AM, Nick Legg wrote:

> I haven't been able to find anything like that, but perhaps I'm looking in the wrong place. I checked in Admin -> Publishing -> Contributor Types and Admin -> Publishing -> Contributors.

Here's how it works:

In ADMIN -> PUBLISHING -> Contributor Types, you can add custom fields to a type. The default "Writer" and "Illustrator" contributor types, for example, each have a custom field named "Bio". Custom fields are optional; you only need to add them if you want some sort of additional data associated with a particular type of contributor. Maybe for "Photographer" you want a "Kit" field where you can select "Canon" or "Nikon".

Once you have a contributor type with a custom field, if you switch over to ADMIN -> PUBLISHING -> Contributors and search, you'll see that contributors of that type, in addition to having the usual "Edit" and "Log" links, will have a "New" link. If you click one, you'll get a new field, "New Role Name", where you can type in a new role. For a photographer, you might type "Sports", then click "Next".

Now you'll see the usual contributor profile, only in the Custom Fields section, you'll see two tabs: "Default" and "Sports". You can then select a different value for each. You can have "Canon" selected in the "Default" tab and "Nikon" selected in the "Sports" tab. This allows you to have one contributor but different metadata associated with that contributor's roles.

Then, when you edit a story and add a contributor, if the contributor has more than one role (and all have at least one, named "Default"), you can select in which role the contributor is associated with the story. So if our photographer has provided a photo of a rugby match, you might select "Sports". Then when the story is published, the template can fetch the contributor and the "Kit" field contents and list the photographer as a Nikon user.

The reason you haven't known how to do this, most likely, is that you have no custom fields in any of your contributor types. So the "New" link will never show up, and every contributor will have only the "Default" role.

I did notice one minor bug when looking at this stuff, though: If you go to edit a contributor of a type that has no fields, the "Custom Fields" section header still shows up, but is completely empty. It probably should not appear at all.

HTH,

David