akalsey
Jul 15 2002, 11:44 AM
I'm not sure exactly what you mean. Are you wanting to have the recent entries in the default template link to an anchor on the same page?
In the default templates, all of the entries already have anchors, so all you would need to do is change the recent entries link to point to that anchor.
In the template, under recent entries, change
CODE
<MTEntries lastn="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br />
</MTEntries>
To
CODE
<MTEntries lastn="10">
<a href="#<$MTEntryID pad="1"$>"><$MTEntryTitle$></a><br />
</MTEntries>
brent
Jul 14 2002, 08:18 PM
I was wondering if it was possible to have anchors added to "recent entries" by default? that seems to make more sense to me.....
toddg
Jul 18 2002, 08:43 PM
I am actually looking to do something similar to this.
I want to have a dynamic, date referenced, anchor tags across the top of my blog, linking to the same date lower in the page. I want to have the last 7 days included in the same page.
--
For example: (where 7/20 is the most recent date)
7/13 | 7/14 | 7/15 | 7/16 | 7/18 | 7/19 | 7/20
July 20, 2002
Title
body, body, body...
--
Any ideas? Thanks in advance!
--
Todd
girlie
Jul 19 2002, 05:27 AM
You would use pretty much the same code, without the br tag, and replacing MTEntryTitle with MTEntryDate. And you might need to add a sort_order attribute.
Just make sure that the MTEntries tag in the body of your page and the MTEntries tag at the top have the same number of entries specified with "lastn".
The only problem will be the | separating your entries, unless you want them like this:
| 7/13 | 7/14 | 7/15 | 7/16 | 7/18 | 7/19 | 7/20 |
There's a trick around here somewhere which came up about category separators before the glue attribute was added. It uses MTSetVar and MTGetVar. But unfortunately a) my link to it is at home and b) the link won't work due to the forum changes so I'll have to hunt it down again.
kadyellebee
Jul 19 2002, 06:00 AM
Hey Girlie -
Here's a thread that shows multiple different glue idea before glue was invented including a php solution, and the get/set var solution. There was one thread before this, but this one actually had more ideas in it.

I have a feeling I'm gonna get closely acquainted with long lists of search results to restock my bookmark list!!!!!

Kristine
pielmorena
Jul 19 2002, 06:20 AM
Okay, if you only have one post per day, the following should work:
For the anchor list:
CODE
<MTEntries lastn="7" sort_order="ascend">
| <a href="#<$MTEntryID$>"><$MTDate format="%m/%d"$></a> |</MTEntries>
For the list of titles below, with excerpts:
(I didn't add the sort code, you can do that if you like by using the MTEntries code above)
CODE
<MTEntries lastn="7">
<a name="<$MTEntryID$>"></a><a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br /><br />
<$MTEntryExcerpt$><p>
</MTEntries>
That should do it.
Let me know if this works. Sounds like something I might want to implement in the future on my own site.
girlie
Jul 19 2002, 02:26 PM
Kristine - ironically, in *that* thread I posted the link to the thread I was thinking of - and of course, now THAT link doesn't work! DOH!
kadyellebee
Jul 19 2002, 04:33 PM
Girlie - but you had actually copied and pasted the code into this newer thread from the older thread, AND there was one other solution, so the newer thread was actually more helpful. :D
Tee hee!
Kristine
girlie
Jul 19 2002, 08:25 PM
I know, hehe - now I'll have to rewrite my tips entry on that one! :D
toddg
Jul 21 2002, 03:51 PM
Hey everyone!
Thanks for the advice on the code. so far I have gotten the links across the top anchoring to the date headers.
I am using this:
CODE
<MTEntries lastn="7" sort_order="ascend">
<a href="#<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%m/%d"$></a> |
</MTEntries> <a href="archive.html">Archive</a>
<p>
<MTEntries lastn="7">
<MTDateHeader>
<div class="date">
<a name="<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%B %d, %Y"$></a>
</div>
</MTDateHeader>
The only problem is that I am getting multiple dates (same) if there ar e multiple entries for that date.
Example:
06/10 | 06/22 | 06/22 | 06/23 | 07/07 | 07/20 | Archive
Any ideas on how to modify this so it is just the last Seven days (not individual entries...but the last seven date headers)

Thanks Again!
--
Todd
girlie
Jul 21 2002, 04:47 PM
Hmmm, yes pielmorena pointed out it would only work if you had one entry per day.
Are you using daily archives? That, combined with an MTArchiveList tag instead of an MTEntries tag, is the only way I can think of to get one entry per day.
crys
Jul 21 2002, 05:06 PM
hmm how 'bout this
CODE
<MTEntries days="7" sort_order="ascend">
<MTDateHeader>
<a href="#<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%m/%d"$></a> |
</MTDateHeader>
</MTEntries> <a href="archive.html">Archive</a>
<p>
<MTEntries days="7">
<MTDateHeader>
<div class="date">
<a name="<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%B %d, %Y"$></a>
</div>
</MTDateHeader>
girlie
Jul 21 2002, 05:16 PM
Ooooh, aaaahhh, I think you're on to something!!
(smacking myself for not thinking clearly enough - but it's not my fault really, an evil man has been distracting me!)
:0
toddg
Jul 21 2002, 05:46 PM
Crys:
That works assuming I post everyday.
Hmmm...
Girlie:
I am currently using individual archives since I was going to allow comments on each post.
But...design will rule out.
I'll try the daily archive and see if that might do it. Ideally I would have 7 days up there even if they are not the last 7 calendar days.
Thanks again.
--
Todd
girlie
Jul 21 2002, 06:00 PM
Well, wait - just change the days to lastn in Crys's code - I don't understand why it wouldn't work? It will give you just the date header for the days on which you do make a post!
(Hey, you can just hit "Delete" on one of those double posts to get rid of it!)
Edit: I just slapped the code into my
test blog and it seemed to work just beautifully - and I don't have an entry every day in it.
Edit
again - I think I'm beginning to get it. You want the last 7 non-consecutive days, huh?
toddg
Jul 21 2002, 08:36 PM
Girlie:
yeah I do. I am probably not being very clear (guess I have to work on that before I actually start publishing my blog)
I tried both sets of code and I got the last 7 days (consecutive/calendar) and I did the modified which brought up the last 7 Entries...
so, I need to figure out a way to combine the two sets..
Date="7" and lastn="*" to get it to come together.
Is that possible?
Heh...I always did have to be difficult.
--
Todd
toddg
Jul 22 2002, 01:15 PM
Ok, so I had the idea of using the MTArchive tag for the info across the top, but I am not sure of what <$ tags have to go in there...
Can I use the Dateheader information in there? (as that is what I want the anchor to anchor to...
OR, is it possible to modify the calendar tags...
OR, can you multisort the DateHeader for Days="7" and lastn="*"??
Thanks again.
--
Todd
bmk
Jul 22 2002, 01:21 PM
I'm pretty lost on what you guys are doing here. :)
BUT! If you are looking to combine
days to show and
lastn... (a
dayslastn if you will

) then you can accomplish this with:
CODE
<MTArchiveList archive_type="Daily" lastn="N">
<MTEntries>
...
</MTEntries>
</MTArchiveList>
Now, how that works into your current goal, I'm not sure. Just thought I'd throw it out because it's a gem!
toddg
Jul 22 2002, 02:35 PM
Okay! That is great. and guess what?! It worked!
BUT...(hehe) the links across the top are in reverse order and sort_order does not seem to work...
--
Example:
(what the code did)
07/22 | 07/21 | 07/20 | 07/07 | 06/23 | 06/22 | 06/10 | Archive
(what I want)
06/10 | 06/22 | 06/23 | 07/07 | 07/20 | 07/21 | 07/22 | Archive
--
Any ideas?!
--
Thanks
girlie
Jul 22 2002, 03:07 PM
Eh, ahhh sort_order doesn't work on MTArchiveList as far as I know. You'd have to change your blog config I think to get the order you want.
But then you could add sort_order to your MTEntries tags instead to override the blog default on them.
toddg
Jul 22 2002, 03:16 PM
hmmm...
would that mean just adding the sort order to the MTEntries under the archive list?
Or what would I need to change in the blog config???
Thanks again.
--
Todd
girlie
Jul 22 2002, 04:07 PM
Duh, I guess I should pay attention to the code being posted!!! Yes, try adding the sort_order attribute to the MTEntries list under the MTArchiveList.
Sorry about that, I'm really too distracted these days!! :(
toddg
Jul 22 2002, 08:12 PM
Ok, so this is what I tried...
CODE
<MTArchiveList archive_type="Daily" lastn="7">
<MTEntries sort_order="ascend">
<MTDateHeader>
<a href="#<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%m/%d"$></a> |
</MTDateHeader>
</MTEntries>
</MTArchiveList> <a href="archive.html">Archive</a>
<p>
<MTArchiveList archive_type="Daily" lastn="7">
<MTEntries>
<MTDateHeader>
<div class="date">
<a name="<$MTEntryDate format="%B %d, %Y"$>"><$MTEntryDate format="%B %d, %Y"$></a>
</div>
</MTDateHeader>
No dice...still shows in the reverse format...
any ideas?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.