Help - Search - Members - Calendar
Full Version: Archives by user
Movable Type Community Forum > Additional Resources > Tips and Tricks
dianamonnerat
I'm designing a multiple users weblog and I'm still figuring out the archives. I was thinking about setting archives by date, by category and by user, but I have no idea of how I do this archives by user and even if it's possible. Is it? If it is, what's the code I need to add in my main site?

Thanks.
bschoate
I haven't tried this myself, but here's how I would do it:

Create another individual entry archive template. Name it "Author Archives".  Then go to your blog configuration, specifically the "Archiving" set of options.  You should see your "Author Archives" template listed there. To the right (in the 3rd column), there is a field for a mini-template for naming the file. Use something like this:

CODE
<MTEntryAuthor dirify="1">/<MTEntryID pad="1">.html


That will create another set of individual archives and will put them in a directory that is named after the author's name.
kadyellebee
I've written two different tutorials on how I have done this at TheRedKitchen -

Master Author Archives - uses a single template which can be edited as authors are added or deleted from the author base of your weblog.  The comments also suggest a way to contract and expand the page based on which author is selected.

Master Author Archives with MySQL - This version is automated so that whenever an author is added with permission to post to a specified blog, they are automatically added to the lists and archives are shown for them.

If you have questions when you are looking at these, feel free to post back smile.gif

Kristine
dianamonnerat
Ok, so I got the first tutorial, it was easy to understand and everything. But I didn't get the second one at all. I have no idea of waht MySQL is (although I know it was used to install my Movable Type). I also don't know the MySQL thing name and password, so I don't know how to set its database. I also don't know anything abut PHP, just HTML. What do you think I should do? Just gave up and follow the first tutorial?
ABoyCalled3
bschoate and kadyellebee,

Thanks for responding to dianamonnerat's question -- I was trying to figure out the exact same thing myself. I looked over both responses and I'm pretty sure that bschoate's will do what I want. I've followed the suggested steps, but now I'm stuck on two questions:

1. Should I have made it a Category Archive rather than an Individual Archive, since I want it to function more like a category (just a listing of each author's submissions in order by date)?

2. How can you associate multiple archive templates? I want to have pages for individual entries and have the entries archived by month, category, and author. Within Movable Types's Blog Config > Archiving section the instructions read:

QUOTE
When you associate multiple templates with a particular archive type--or even when you associate only one--you can customize the output path for the archive files using Archive File Templates.


But I can only select one radio button at a time, which seems to make it impossible to associate multiple templates. Everything seemed so clear....
kadyellebee
dianamonnerat - I would say that the first tutorial would be better for you, because it would help to have some PHP knowledge for making sure the paths match yours and that kinda think for the 2nd tutorial.

And ABoyCalled3?  I'm not sure about your first question; since Brad came up with the suggestion of sorting the files, he might have a better idea.  I see how his idea will put the files into a directory structure for each other, but I'm not sure how you will integrate this into your pages - it won't automatically make a directory for you of what's in the files.

But I can help with the 2nd part - You can use a different archive filename (like what Brad typed out) for the other template, so that it will publish to a different location than the default.  Otherwise, they will just publish over top of each other.  The radio button is just to define which of the templates is the default.  So when you use MTArchiveLink archive_type="Category"  it knows which location to go to smile.gif

Kristine
ABoyCalled3
Thanks, again, for the response -- I think I may be starting to get the hang of this thing. What I've created (using your suggestions) seems to be very close to what I want to have on my site.

For my Author Archive template (archive type is set to individual and it is not set up as the default) I have the following direction to my Archive File Template:

CODE
auth_<$MTEntryAuthor dirify="1"$>.html


(I wanted the Author URL to look like the default Category URL)

In my Main Index I have the following code pointing to the Author Archives:

CODE
<div class="side">
<a href="<$MTBlogArchiveURL$>auth_name1.html">Name1's Stuff</a><br />
<a href="<$MTBlogArchiveURL$>auth_name2.html">Name2's Stuff</a><br />
<a href="<$MTBlogArchiveURL$>auth_name3.html">Name3's Stuff</a><br />
<a href="<$MTBlogArchiveURL$>auth_name4.html">Name4's Stuff</a><br />
</div>


Within the header on the Author Archive template I've edited the following line:

CODE
<title><$MTBlogName$>: <$MTEntryAuthorNickname$>'s Archive</title>


Otherwise it's essentially the default Category template.

Here's the problem: while the title works fine (shows Name1, Name2, etc. appropriately), the archive only displays the work submitted by Name4. No idea why this is happening.

To test if it would make sense to create one archive per author I changed the code for

CODE
<MTEntries>


to read

CODE
<MTEntries author="<$MTEntryAuthor$>">


This fixed the Name1, 2, 3, and 4 all displaying only Name4's work, but it limited the number of entries displayed to one.

Confused? Oh yeah, I'm confused.
ABoyCalled3
Sorry about following up my own post, but I've figured out one more thing, enough that it feels like I should have this figured out by now but I'm just not quite there.

The problem seems to be in the Author Archive file, the secondary Individual Archive template (the standard Individual Archive file is set as primary). The code for the Author Archive file is the exact same as the Category Archive with two changes:

1.
CODE
<title><$MTBlogName$>: <$MTEntryAuthorNickname$>'s Archive</title>


This one works. At the top of the browser, where titles are displayed, it says Name1's Archive.

2.
CODE
<MTEntries author="<$MTEntryAuthor$>">


or

CODE
<MTEntries author="<$MTEntryAuthor dirify="1"$>">


Either one of these will give me only the last entry by the author, but not the author's entire output. What I've learned since my last post is that if I actually make the code read:

CODE
<MTEntries author="Name1">


Then I get Name1's entire output, my desired outcome. Please help me figure out what I'm doing wrong. I believe that if I make archive templates for each author then I'll probably be able to get what I want -- and an answer that's likely to be fine for me, since my site has only four authors -- but as an alternative for those who have numerous authors and who aren't comfortable with PHP, I get the sense that having to create an Author Archive template for each author isn't such a good answer.

Anyone find the last jigsaw piece?
akalsey
You can't use MT tags as attribute values to other MT tags. MT processes the tags all at once, so it doesn't understand one tag inside of another like that.

Brad's working on an update to his authors plugin that will handle what you are trying to do.
kadyellebee
What Adam said is correct.  If you don't want to wait for a plugin, you might try looking at the other links I shared to see if one of those formats would work for you.

Sorry!
Kristine
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.