I have this wonderfull script from Eric:
<script>
var out="";
var txt=store.getTiddlerText("CoverList","Get Urls from the
Coverlist");
var items=txt.split("\n----\n");
if (!items[1]) items=txt.split("\n");
for (var i=0; i<items.length; i++) {
if (i>0 && i/5==Math.floor(i/5)) out += "|\n"; // start a new row
out += "|"+items[i];// add item to row
}
out += "|\n"; // end last row
return out;
</script>
I have tried all sorts of combinations to get the image markup to
surround items(Urls) fetched from the CoverList.
I did: out += "|[img["+items[i];// add item to row
and: out += "]]|\n";
But it only worked with one item, as soon as I added items to the
CoverList the table was broken..
regards Måns Mårtensson
out += "]]|[img[\n"; // end last row
return out;
</script>
I'd like the images to link to the images as well:
[img[Url][Url]]
Is this possible?
regards Måns Mårtensson
<script>
var out="|";
var txt=store.getTiddlerText("CoverList","Get urls from the
Coverlist");
var items=txt.split("\n----\n");
if (!items[1]) items=txt.split("\n");
var i = 0;
for (i=0; i<items.length; i++) {
if (i>0 && (i%2)==0 ) out += "\n| "; // start a new row
out += " [img["+items[i]+"]["+items[i]+"]] |" ; // add item to row
}
if ((i%2)!=0) out += "|"; // start a new row
return out;
</script>
Indeed it did :-)
Thanks a lot!!
I've even managed to make it spit out iframes!
See it working here:
http://maans.bplaced.net/TiddlyHome/kartotek/#Covers
and with iframes:
http://maans.bplaced.net/TiddlyHome/kartotek/#Medier
Thanks for helping me out again Mark. I apreciate it very much!
Regards Måns Mårtensson
Now a listitem consists of a title(to be shown in a select from
dropdown list) (equals)= fieldvalue newline: tooltip......
Ex:
Avatar=http://image.png
this is an image I found at flickr.com
I need the script only to fetch the data on the first line just after
the equalsign....
However this is out of my reach...
I've tried to look at the ListBoxPlugin code to see if there is some
code which might help me - and I believe some of this is what I need
to implement in the script Mark made for me:
{ // param is item value or 'label=value'
var parts=p.split("=");
var label=parts[0]; var v=parts[1]?parts[1]:parts[0];
items.push(label+"="+v);
}
or sth with this line: listtxt=this.getWikifiedData(listtxt);
if (listtxt.length)
var items=listtxt.split(listtxt.indexOf('\n----\n')!=-1?'\n----
\n':'\n');
If there is a simple solution for my problem - please give me a
hint :-)
Regards Måns Mårtensson
if ((i%5)!=0) out += "|"; // start a new row
return out;
</script>
Regards Måns Mårtensson
On 10 Mar., 08:05, Måns <humam...@gmail.com> wrote:
> Hmm
> I've broken the table when I changed my use of the hr-seperated list,
> to make it "fit the standards" of Eric's ListBoxPlugin.http://www.tiddlytools.com/#ListboxPlugin.