Author - Add a field to the options

  • I've got a blog with an author badge that has the 'given name', 'family name', and 'biography'. But can I add another field for their "title" in the company?

    I want to use the title with the name, such as "Bob Smith, CEO"

    1. How to I add a custom field to the Authors edit page in the CMS

    2. How do I then display that along with the other info.

    Here is what I have now:

    1. <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" />

    So I imagine it's something like....

    1. <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" />, <perch:blog id="authorRole" />

    ...where I would set the 'authorRole' in the edit template for editors.


  • I think you've answered it yourself. Just add the code as you suggested into the author.html template.

    Then in post.html template, add it again, remember to make it hidden field like the others...

    1. <perch:if exists="authorGivenName">
    2. by <span class="p-author"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" />, <perch:blog id="authorRole" type="hidden" /></span>
    3. </perch:if>
  • The default Author template is in the perch/template/blog folder and it's called "author.html'. I believe you could then add a select field to achieve this or even add a category.

    If it helps, I tend to set up my own custom fields or collections (for Runway sites) and ignore the internal author functionality. Blog ties a Perch user's name to the post and I (and others) have found that just doesn't work well in the real world. In the real world I've found that editors often post on the behalf of someone else and so this functionality becomes rather restricting.

  • Thanks @JawW for pointing that out. I think I had it on the wrong directory and was editing another author.html. Oops.

    Yep ellimondo I was going to do just that, but I realized having the field in that logical place in the Author template makes the most sense for this purpose. Thanks!