andrewducker (
andrewducker) wrote2011-11-09 10:27 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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:
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.
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.
no subject
I don't want patronising "Don't do it" responses. If I don't have something better to replace what I'm doing then I'm not going to change it just because you don't like the look of it. All you do is piss off the people you're ranting at without educating them or improving the situation.
As it is, Sven's given me an actually useful answer which will be in the post tomorrow.
no subject
For the record, I never say that sort of thing 'because I don't like the look of it'. I say these things based on experience and knowledge.
I don't see Sven's answer -- what was it?
no subject
I'm not sure why you can't see Sven's answer - it's about halfway down this page:
http://andrewducker.livejournal.com/2577217.html
If I've messed up security somewhere then please let me know!