sali0023

Profile image populating the byline.

Vote 0 Votes

Is there a way to have a thumbnail of the author populate in the byline when a story is written by him/her? There is no way to put a custom image field in the user profile is there?

thank you!

Reported on Movable Type 4.3

5 Replies

| Add a Reply
  • Hi sali0023:

    What byline are you talking about? Are you talking about the webpages generated by Movable Type?

    --Dave Aiello

  • Sorry I wasn't clear. At the bottom of each individual entry and each entry blurb it says, in small type:


    By xxxx on June 13, 2011 7:47 PM | No Comments


    can there be a thumbnail down there?

  • It might not be obvious how to do this, but a good technique to use to find out how things like this are done is to look at the template sets that come with version 4 or 5 of Movable Type Pro, and find places in that code where the userpics are embedded.

    A good template set to look at is the Community Blog template set in MT 4.3x and the Userpic template module at the Global Templates level.

    The most important and relevant tags for you are:

    <$mt:AuthorUserpicURL$>
    <$mt:EntryAuthorUserpicURL$>

    Without looking at the template module that produces your example output, I would say that you need to include <$mt:EntryAuthorUserpicURL$> with the tags that are already there, and you will probably get the result you want.

    --Dave Aiello

  • Thank you Dave, that was just what I needed to find the answer. If anyone else is wondering...

    Make a template module - 'Userpic' and put the following code in it:

    <div class="user-pic">
    <mt:If name="userpic_type" eq="profile">
    <img src="<mt:If tag="AuthorUserpicURL"><$mt:AuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>" width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" />
    <mt:Else name="userpic_type" eq="commenter">
    <mt:IfCommenterIsAuthor><mt:ignore>IF NATIVE MTCS USER</mt:ignore>
    <a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:CommenterID$>"><img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>" width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
    <mt:Else>
    <mt:If tag="CommenterID"><mt:ignore>IF AUTHENTICATED USER (OPENID, VOX, LJ, ETC)</mt:ignore>
    <a href="<$mt:CommenterURL$>">
    <img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>" width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" />
    <mt:If tag="CommenterAuthIconURL"><span class="auth-icon"><img src="<$mt:CommenterAuthIconURL size="logo_small"$>" alt="<$mt:CommenterAuthType$>"/></span></mt:If>
    </a>
    <mt:Else><mt:ignore>ELSE ANONYMOUS COMMENTER</mt:ignore>
    <a href="<$mt:CommentURL$>"><img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
    width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
    </mt:If>
    </mt:IfCommenterIsAuthor>
    <mt:Else name="userpic_type" eq="userlist">
    <a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:AuthorID$>"><img
    src="<mt:If tag="AuthorUserpicURL"><$mt:AuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
    width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
    <mt:Else>
    <a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:EntryAuthorID$>"><img
    src="<mt:If tag="EntryAuthorUserpicURL"><$mt:EntryAuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
    width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
    </mt:If>
    </div>


    Then put this line of code anywhere you want the image to appear:

    <$mt:Include module="Userpic" userpic_size="36"$<>

  • Hi Sali,

    Or you could simply grab that logic from a new movable type community blog template set.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/
    ----------------------------------

    Open Melody Demo
    http://www.openmelodydemo.org/

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012