Hi,

I've searched all over for this, but I'm sure it must be answered elsewhere.

I used the biblio module for my library but want to change to cck. It's easy to do everything, except add multiple authors in one text box.

Ideally i'd like to have multiple authors like this:

Lastname1, Firstname1; Lastname2, Firstname2; Lastname3, Firstname3

And then be able to play with those values in Views.

Is there any way of doing this with CCK?

Thanks,

James

Comments

markus_petrux’s picture

Status: Active » Fixed

If you want to play with author names separatelly, then you need to store them in separate fields, I think.

Maybe you could use a text field configured to allow multiple values, or maybe you could use a freetagging widget from content taxonomy module. If you want to display the names separated by semi-colons, then you need to override theme functions or templates. Install the advanced_help module or look at the CCK handbook for hints on how to format fields.

halfiranian’s picture

Status: Fixed » Active

Thanks Markus,

I've managed to store them as separate values in the same textfield (by allowing multiple values), but the problem is when combining with Views.

There is a problem formatting the fields.

I can either format the multiple ones, through theme_content_view_multiple_field or format the whole row, through a views template.

What I want to do though, is have each value as its own link (which then goes to an author argument), whether in a multiple value textfield or if there's only one value.

Have I lost you?

Anyway, at line 253 in content_handler_field_multiple.inc there's a line that says:

// TODO: could we use generic field display ?

which suggests maybe this isn't possible yet...

Cheers

markus_petrux’s picture

Status: Active » Fixed

Not exactly. I think you could implement a field formatter that tells CCK to manage multiple values (*). Then you can select this formatter from the field options form in views, and that's it, I think.

See the CCK Formatters module. There is a formatter here for Text fields that manages multiple values and lists the values using a comma separated list. If it doesn't work for you as-is, then you may want to create your own.

halfiranian’s picture

Thanks markus, I modified a CCK Formatter module and now I have the result I need!

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

federico’s picture

What I want to do though, is have each value as its own link (which then goes to an author argument), whether in a multiple value textfield or if there's only one value.

I need the same, I installed the CCK Formatters module, but links are still to "multiple authors" and not to "individual authors" (my case is different, but similar to your example).

I modified a CCK Formatter module

Could you tell us what did you modify? Thanks in advance.