Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Making nested lists
Destry wrote #336368:
The single block method does seem to add a bunch of
br
tags, messing up the spacing, and I’m not sure where those are coming from.
Textile, perhaps?
I’ll stick with the form approach. It makes more sense to Tuco.
It’s fine, I’m just thinking out loud.
Offline
Re: Making nested lists
Textile, perhaps?
Ah, perhaps. I am using escape="textile"
on the dd
output because I want formatting in there.
Please keep thinking aloud. We all benefit from it. I am marveled by (and grateful for) your mastery of character magic.
Offline
Re: Making nested lists
The last piece of the puzzle for me is to have control over the order of the individual links in each list. The Sort value field in the links form doesn’t seem to be having an effect. I’ve tried numbers and letters (a, b, c, …) but the link items just keep sitting in the same position. What am I missing?
Offline
Offline
Re: Making nested lists
linksort
worked. Thank you.
Offline
Re: Making nested lists
I’m adding this to the linklist
block to try and output the year for the link time stamp…
<txp:evaluate query='<txp:link_date format="%Y" />'><txp:link_date wraptag="Published <+>" /></txp:evaluate>
But it outputs the day, month, and year format as set in preferences (e.g. 12 May 1992).
Incidentally, the docs say ‘any valid strftime
string values’, but that seems to be deprecated now.
So I tried a value of YYYY
, which seems rather common (e.g W3CDTF reference), and that still outputs the full date.
Is there a way to force just the year to output for links only?
Offline
Re: Making nested lists
It’s because your link_date tag – the one that actually outputs the published string – doesn’t have a format
attribute. You don’t need that attribute in the evaluate query because it’s only testing for the existence of the tag’s content.
In fact you can probably get away with test="link_date"
instead of the query:
<txp:evaluate test="link_date">
Published <link::date format="%Y" />
</txp:evaluate>
Last edited by Bloke (2024-02-14 14:36:56)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Making nested lists
Do you really need <txp:evaluate />
here?
<txp:link_date format="%Y" wraptag="Published <+>" />
Offline
Re: Making nested lists
Oleg’s is even better. Forgot we could use the UFO thing directly without it. Nice one.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Making nested lists
I just copied the code from somewhere and adjusted the format. I have no clue what evaluate
was supposed to do. I didn’t even see there were two instances of link_date
there.
Your consolidation works as expected. Thanks.
Offline