开发者

Using panels3, how can I output a mutivalue cck field using tokens?

开发者 https://www.devze.com 2023-02-25 15:44 出处:网络
In my website, I have a custom content type called \"projects\". This type as a User Reference Field called \"Project Author(s)\" and another user Reference Field called \"Project Supervisor(s)\". The

In my website, I have a custom content type called "projects". This type as a User Reference Field called "Project Author(s)" and another user Reference Field called "Project Supervisor(s)". These fields are mutivalue fields (can have 1 to unlimited values) and belong to a FieldGroup called "Project Info".

I also have installed the Content Profile Module, which enables me to add cck fields to user profile pages. So, I added two Custom Fields to user profile content type called "First name" and "Last Name".

Using panels3, I created a custom content pane with a table (code below)

    <table width="100%" border="0" cellspacing="1">
  <tr>
    <td width="100px"><strong>Author(s)</strong>
    </td>
    <td>%node:field_project_authors-link</td>
  </tr>
  <tr>
    <td><strong>Supervisor(s)</strong></td>
    <td>%node:field_project_supervisors-link</td>
  </tr>
  <tr>
    <td><strong>Cooperation</strong></td>
    <td>%node:field_project_coop-link</td>
  </tr>
</table>

Problem: Although %node:field_project_authors, %node:field_project_supervisors and %node:field_project_coop are muti value fields, only the first item (delta) is shown.For instance, if Project A has 2 authors (john and marie) only john is shown.

Same happens when I try to show user's first name and last name instead of %node:field_project_authors. Only the first author's names are shown. (I'm using author's user reference as relationship)

Question: How can I show all values (deltas) of a mutivalue cck field?

Side-notes:

1)In my first approach, I used views2 to pull authors and supervisors from the database and then add them to panels but I had a lot of issues regarding formatting and duplicated information that I couldn't really address.< br /> 2) I'm open to any suggestions that you think might solve this issue. I'm even open to hardcode 开发者_高级运维it in PHP if you can point me in the right dirrection (i'm pretty new to Srupal so...)

Thanks in advance


Well, only way I could achieve this was with PHP by acessing the $node object.

0

精彩评论

暂无评论...
验证码 换一张
取 消