Forum

Thread tagged as: Question, Runway, Blog

Blog Authors - Linking Their Name To A Custom Profile Page

Can someone point me to the docs that detail out the linking a Blog Author's name in post.php to a dedicated Authors Page - one that has the Biography from the control panel. I imagine this is author.html, but where is that linking from?

Leigh C

Leigh C 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's really up to you and how you want to build your site.

How would you like it structured?

The author functions are:

Leigh C

Leigh C 0 points

Hmm, that's where I was. I'll just start testing...I thought there was more direction on those options and examples. How would I link this author name:

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

To that same author's "bio page" that has the author.html template info?

Duncan Revell

Duncan Revell 78 points
Registered Developer

author.html is the default template used by perch_blog_author()

perch_blog_author() needs an author slug as a parameter to get the author's information.

In your post.html template, you can use <perch:blog id="authorSlug" type="hidden" /> - build up an anchor link around that to your author page.

Leigh C

Leigh C 0 points

Cool, thanks for the notes. I'll test that today.

Leigh C

Leigh C 0 points

So I've got that happening in the template, but where do I locate the syntax of the author slug itself. For example, I have the author's name linked to a page, but where? Do you have an example of that URL syntax, I don't see it on the docs page.

<perch:if exists="byline">
        By <a href="/what/should/this/be/<perch:blog id="authorSlug" type="hidden" />"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName"  /></a>
</perch:if>

Appreciate the help!

Duncan Revell

Duncan Revell 78 points
Registered Developer

That's the bit that's up to you - you said you're creating a dedicated author's page, so the url will point to that page and you will pass the slug in as a url parameter. As per this:

https://docs.grabaperch.com/functions/utilities/perch-get/

Leigh C

Leigh C 0 points

I see - I need to get my head around this then. Thanks for the help.

Leigh C

Leigh C 0 points

So when I display a list of the authors, I get a link to, for example:

https://domain.com/blog/archive.php?author=bob-smith

That page is broken. So I imagine I need to make a page and build up the template for how the authors details are displayed. But I must be missing something, where is the /blog/archive.php coming from. Can I change that?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That page is broken.

Broken how?

I imagine I need to make a page and build up the template for how the authors details are displayed.

Yes.

where is the /blog/archive.php coming from. Can I change that?

Presumably it's from a link in one of your templates. You should be able to update it there. If you're not sure which templates you're using, your can turn on debug and see a list.

Leigh C

Leigh C 0 points

Hi Drew -

  1. Broken - meaning a 404
  2. I'll debug and hunt