2012-01-11 44 views
1

我使用的是Plone v4.1.2,我想知道是否有一种方法可以在页面的行中包含多个作者?我有两位作者被列入所有权,但只有一位作者被列在了副标题中。是否可以将多个作者列入副标题?

我想署名看起来是这样的:由第一作者和第二作者

- 最后修改2012年1月11日下午1时53分 - 历史

更新 - 谢谢大家对您的回复。我设法通过这个(我从来没有用过tal之前)的方式搞砸了。我按照Giaccamo的建议编辑了plone.belowcontenttitle.documentbyline,并在途中学习了一些关于tal的内容。这里是做什么,我需要的代码(这将替换现有TAL:创建者构造):

<span> 
     by 
     <span class="documentCreators" 
      tal:condition="context/Creators" 
      tal:repeat="creator context/Creators" 
      i18n:translate="text_creators"> 
      <span tal:define="cond1 repeat/creator/start; cond2 repeat/creator/end" 
       tal:condition="python: not cond1 and not cond2" >, </span> 
      <span tal:define="cond1 repeat/creator/start; cond2 repeat/creator/end" 
       tal:condition="python: not cond1 and cond2" > and </span> 
      <tal:i18n i18n:translate="label_by_author"> 
      <a href="#" 
      tal:attributes="href string:${context/@@plone_portal_state/navigation_root_url}/author/${creator}" 
      tal:content="creator" 
      tal:omit-tag="python:view.author() is None" 
      i18n:name="author">Roland Barthes</a> 
      </tal:i18n> 
     </span> 
    </span> 

这使用户ID上署名,而不是全名。我试图获得全名,但经过一段时间没有成功,我决定我可以用userid。

回答

5

为了浏览多个作者,你需要编码的一点点:

那件页称为viewlets

该特定视图被称为plone.belowcontenttitle.documentbyline

您可以使用z3c.jbot覆盖viewlet模板。看看this howto的使用情况。另一种选择是通过网页自定义模板this tutorial

+0

好吧,我要试试这个。它看起来有点吓人,但我从来没有害怕尝试。 – Andy 2012-01-12 18:26:10

2

你可以使用贡献者而不是业主领域。它们默认列在docByLine中。 hth,我

+0

谢谢,我不知道所有贡献者都被列出。我以前从未使用过贡献者。不过,我想让他们在旁边。但我可以借用一些处理贡献者的代码,所以这很有帮助! – Andy 2012-01-12 18:24:57

+0

css应该这样做,如:.documentAuthor {display:none; } .documentContributors {float:left; } .documentContributors:after {content:' - ';保证金:0 0.5em 0 0.25em; } – 2012-01-12 20:39:39

相关问题