Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

Link Feed Templates

After much faffing around with Javascript and the like, the templating is now in.

It's not for people that don't understand code at all, but I can't see much of a way to make it simpler.

The current default template looks like this:
<ul class="links">
#foreach($link in $links)
<li class="link"><A href="$link.URL">$link.Title</A>
#if($link.Description)<BR><span class="link-description">$link.Description</span>#end
<BR><span class="link-tags">(tags:#foreach($tag in $link.Tags) <A href="$tag.TagURL">$tag.Tag</A>#end )</span>
</li>
<BR><BR>
#end
</ul>

which basically says:
  • Start a list
  • For each link in the collection of links:
    • Create a new list item and put the link title in it, and make that title a hyperlink to the URL of the link.
    • If the link has a description, then put it in, on a new line.
    • Add a new line, and then put in each tag, turning it into a hyperlink back to the site that the links came from (i.e. delicious or pinboard)
    • end the list item
  • end the list


If you're going to play around with it then use the "Test" input and output settings, so that you're not constantly scraping the source links/posting to your journal. If you completely mess it up then hit the "Reset Templates" button to restore the original template.

Next up - a template for the subject line/title.
Original post on Dreamwidth - there are comment count unavailable comments there.
Subscribe

  • Interesting Links for 25-02-2021

    '10-year prison sentences for breaching COVID-19 entry requirements into the United Kingdom'. How Governmental Decree is undermining the Rule of…

  • Interesting Links for 24-02-2021

    The bitcoin blockchain is helping keep a botnet from being taken down (tags: bitcoin malware ) Firefox enables Total Cookie Protection to stop…

  • instagram cross-post

    Castle, Arthur's Seat, North Berwick Law. (A nice walk up Wester Craiglockhart Hill in 20mph winds) Original is here on instagram.…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 19 comments

  • Interesting Links for 25-02-2021

    '10-year prison sentences for breaching COVID-19 entry requirements into the United Kingdom'. How Governmental Decree is undermining the Rule of…

  • Interesting Links for 24-02-2021

    The bitcoin blockchain is helping keep a botnet from being taken down (tags: bitcoin malware ) Firefox enables Total Cookie Protection to stop…

  • instagram cross-post

    Castle, Arthur's Seat, North Berwick Law. (A nice walk up Wester Craiglockhart Hill in 20mph winds) Original is here on instagram.…