Help - Search - Members - Calendar
Full Version: author avatar
Movable Type Community Forum > Additional Resources > Tips and Tricks
w1lp33
what i want to do is have the header of my MT posts contain a small picture specific to the author posting it, alone with the subject, author name, etc.  An example of what I mean can be found at http://www.penny-arcade.com.  If you would like to see how I have my site laid out, its http://www.littlebitter.com.  I have the template set out just the way I want, but I want to add the pictures to the left of the subject.  It needs to be author specific, so each author will have his or her picture displayed. any help would be REALLY appreciated, because im out of ideas...
almuhajabah
Create the image files that you want to use and save them under what's called a dirified version of the author name. For instance, John Doe becomes john_doe.

Then in your template, where you want to have the image displayed, use:

CODE
<img src="http://path.to/images/<$MTAuthorName dirify="1"$>.gif">
w1lp33
thanks, but what if the author name is only one word?

also, i tried just using "img src="http://path/to/<$MTEntryAuthor$>.jpg>
and on the page the image is coming up as http://path/to/.jpg

so its leaving out the tag
w1lp33
i figured it out. i made the file the same name as my username, then changed the code to be
CODE
<img src="path/to/<$MTEntryAuthor$>.jpg">
and now it works the way I want. sort of. the alignments a little screwy, but i can fix that. thanks for the help!
almuhajabah
A one-word username would just be converted to lowercase. Some people have multiple-word usernames and having spaces in a filename is problematic; that's why I suggested using the dirify attribute.

I'm glad you got the code straightened out.
w1lp33
couldnt have done it without you, thank you so much.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.