Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-02 23:38:23

jadehouse
Member
Registered: 2007-06-26
Posts: 75

Manual link list

I’m making a manual link feed and I need to know the best way to do this (quick example of how it would look — with sites listed under a title of the date they were added):

January 4th
site link added on january 4th
site link added on january 4th

January 9th
site link added on january 9th
site link added on january 9th

January 16th
site link added on january 16th
site link added on january 16th

This will all be done in one <ul>, with the date separation li(s) having a unique class.

Anyways, I’d really appreciate if I could get a hand with this. I’m having trouble figuring out how to.

Last edited by jadehouse (2007-10-02 23:39:05)

Offline

#2 2007-10-03 00:21:41

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Manual link list

On the feed template:

<txp:linklist form="feed-links" sort="date asc" wraptag="ul" limit="50" />

On the feed-links link-form:

<txp:if_different><li class="link-date"><txp:link_date format="%B %e" /></li></txp:if_different>
<li><txp:link /></li>

Cheers!

Offline

#3 2007-10-03 06:57:52

jadehouse
Member
Registered: 2007-06-26
Posts: 75

Re: Manual link list

Thank you a lot =) How would I add “Today” li heading/list in this same thing?

Offline

#4 2007-10-10 10:09:20

jadehouse
Member
Registered: 2007-06-26
Posts: 75

Re: Manual link list

Ok, so that worked great… unfortunately the design changed some and I can’t seem to manipulate the way you explained, Gocom, to fulfill the new template. Here’s the basic structure:

<div class=“set”> <ul> <li class=“link-date”>today</li> <li>links</li> </ul>
</div>

<div class=“set”> <ul> <li class=“link-date”>october 1st</li> <li>links</li> </ul>
</div>

How would it be possible to do this?

Offline

#5 2007-10-11 23:54:47

jadehouse
Member
Registered: 2007-06-26
Posts: 75

Re: Manual link list

OK, well I “ghetto rigged” it together doing this:

<txp:if_different></ul></div><div class=“set”><ul><li><txp:link_date /></li></txp:if_different>

<li><txp:link /></li>

and then I added an opening div and ul with display:none; above the <txp:linklist form=“feeds” /> and a closing ul and div below it (to finish the code in the form).

If someone knows a clean way to do this I’d really appreciate it. This will work for now though… god help me when I come back to it a year later and am totally confused and disturbed at what I did.

Last edited by jadehouse (2007-10-11 23:55:53)

Offline

#6 2007-10-12 17:16:28

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Manual link list

jadehouse wrote:

If someone knows a clean way to do this I’d really appreciate it.

So would I ;) When the if_different tag was first introduced, I remember spending days and days to figure out how to properly output opening and closing list tags (in an article list, listed by category). Even using if_first_article didn’t get me where I wanted, I always ended up with unclosed or empty list tags somewhere…

god help me when I come back to it a year later and am totally confused and disturbed at what I did.

Just bookmark this post of yours :)

Last edited by els (2007-10-12 17:18:07)

Offline

Board footer

Powered by FluxBB