Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Any examples of actual slice use?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
AlanBCohen  
View profile  
 More options Sep 20, 8:42 am
From: AlanBCohen <alanbco...@gmail.com>
Date: Sun, 20 Sep 2009 05:42:37 -0700 (PDT)
Local: Sun, Sep 20 2009 8:42 am
Subject: Any examples of actual slice use?
I have been interested in recent discussions about slice-related
plugins.  They seem to be an interesting alternative to FormTiddler
and DataTiddler Plugins-based use.  But, I am still confused with the
implementation of such a system; I do better with learning from
working examples.
Is there someone who can post a real world example of a slice-based
TW?

Thank you,
Alan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Shulman  
View profile  
 More options Sep 20, 10:36 am
From: Eric Shulman <elsdes...@gmail.com>
Date: Sun, 20 Sep 2009 07:36:04 -0700 (PDT)
Local: Sun, Sep 20 2009 10:36 am
Subject: Re: Any examples of actual slice use?

> I have been interested in recent discussions about slice-related
> plugins.  They seem to be an interesting alternative to FormTiddler
> and DataTiddler Plugins-based use.  But, I am still confused with the
> implementation of such a system; I do better with learning from
> working examples.
> Is there someone who can post a real world example of a slice-based
> TW?

Slices are a TW-native syntax, and therefore don't require any plugins
to use the basic functionality (though, obviously, there are slice-
related plugins that provide enhancements).

Essentially, a 'tiddler slice' is a name-value pair, stored within the
*text* of the tiddler content, using specific forms of TW syntax.

You can define tiddler slices by entering a simple, two-column table
into a tiddler, where the first column of the table contains the names
of the slices, and the second column contains the values:

|name|value|
|name|value|
|name|value|
etc.

Note that, because each row of the TW table syntax is *line-based*, it
means that slice values can only contain one line of text, without any
newlines... otherwise it would 'break' the table syntax.

Use of slice tables is widespread, and can be seen at the top of most
published plugins, scripts, etc., which include a 'slice table' with
certain standardized slice names.  For example, here's the slice table
from TiddlyTools' SliceGridPlugin:

-----------------------------------
|Name|SliceGridPlugin|
|Source|http://www.TiddlyTools.com/#SliceGridPlugin|
|Documentation|http://www.TiddlyTools.com/#SliceGridPluginInfo|
|Version|1.2.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1.3|
|Type|plugin|
|Requires||
|Overrides||
|Description|Display/edit slices/fields in a grid (table) for a 'birds-
eye' view of your document|
-----------------------------------

Most of the slices in this table are optional, and are provided by
convention, for informational purposes only.  However, a few of the
slices are used programmatically by the TW core, or by various
plugins, or even by some server-side utilities (such as the automatic
TiddlyHub index - see http://plugins.tiddlywiki.org).

Specifically, the "CoreVersion" value is used to indicate the
*minimum* version of the TW core that is required by a plugin in order
for it to operate.  During document startup, if this value is more
recent than the core version in use in that document, then the plugin
will not be loaded (and an 'error' is reported in the
[[PluginManager]]

Similarly, during load time the TW core uses the "Requires" slice to
adjust the normal alphabetic order in which plugins are invoked.  If a
given plugin depends upon one or more functions defined in some other
plugins, then listing those other plugins in the Requires slice tells
the TW core to invoke those plugins first, before invoking the code
from the dependent plugin.

The TW core also uses slices to define 'systemServer' tiddlers, which
can be optionally created to store and re-use the location of remote
TW documents from which you can import other tiddlers when using the
backstage 'import' (or [[ImportTiddlers]]) interface.

For example, here's the entire contents of [[TiddlyToolsServer]] as
found on http://www.TiddlyWiki.com):
-----------------------------------
|''URL:''|http://www.tiddlytools.com/|
|''Description:''|Small Tools for Big Ideas!|
|''Author:''|EricShulman|
-----------------------------------
The URL and Description slices are used in the "select a pre-defined
feed" droplist presented in the import interface, and the Author slice
is provided just for user-readable information.

Of course, defining slices for use by the TW core is only half the
fun!  The other half is using your own custom slice tables to create
and embed simple text 'variables' in your own tiddler content by using
the <<tiddler TiddlerName>> macro to *transclude* single slice
values.  To reference a particular slice in a specific tiddler, you
can write:
   <<tiddler [[TiddlerName::slicename]]>>

For example, you could create a tiddler called [[Abbrevs]], containing
a slice table like this:
-----------------------------------
|CDC|United States Center for Disease Control|
|disease|pneumonoultramicroscopicsilicovolcanoconiosis||
etc.
-----------------------------------
and then write (in another tiddler):
-----------------------------------
The <<tiddler Abbrevs::CDC>> is reporting several recent cases of
<<tiddler Abbrevs::disease>> occurring in people other than coal
miners.
-----------------------------------

... and, with the addition of InlineJavascriptPlugin or
<<forEachTiddler>>, you can retrieve and use slice values
*programmatically* as well, by reference to the TW core function:
   var slicetext=store.getTiddlerSlice("TiddlerName","slicename");

For example, the following inline script generates a listing of all
'systemServer' definition in the document:
-----------------------------------
<script>
   var out=[];
   var tids=store.getTaggedTiddlers('systemServer');
   for (var i=0; i<tids.length; i++) {
      var url=store.getTiddlerSlice(tids[i].title,'URL');
      var desc=store.getTiddlerSlice(tids[i].title,'Description');
      var fmt='| [[%0]]|%1|%2|';
      out.push(fmt.format([tids[i].title,url,desc]);
   }
   return out.join('\n');
</script>
-----------------------------------
which produces TW syntax output that looks like this:
   | [[TiddlerName1]]| http://...|some descriptive text|
   | [[TiddlerName2]]| http://...|some other text|
   | [[TiddlerName3]]| http://...|you get the idea...|
that renders as a nice summary table of information.

These are, of course, only a few of the numerous ways that slices can
be applied in TW documents.  I'm sure that once you start
expermenting, you'll quickly come up with several other use-cases that
fit your particular purposes.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlanBCohen  
View profile  
 More options Sep 20, 1:53 pm
From: AlanBCohen <alanbco...@gmail.com>
Date: Sun, 20 Sep 2009 10:53:13 -0700 (PDT)
Local: Sun, Sep 20 2009 1:53 pm
Subject: Re: Any examples of actual slice use?
Thanks, Eric,
You've given me a lot to think about.
Alan

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlanBCohen  
View profile  
 More options Sep 20, 10:24 pm
From: AlanBCohen <alanbco...@gmail.com>
Date: Sun, 20 Sep 2009 19:24:53 -0700 (PDT)
Local: Sun, Sep 20 2009 10:24 pm
Subject: Re: Any examples of actual slice use?
Here is my first attempt to use slices in an application.  The
retrieval isn't working.  Based on Eric's information, I'm guessing I
have a typo in the retrieval tiddler.  I'd appreciate some help in
correcting it.
First, I'm defining data tiddlers with the tag of 'address', with a
structure like (without the {{{}}}):
{{{First: Alan
Last: Cohen
Middle: B.
Street: 123 Main St.
City: Somewhere
State: HI
Postal: 12345
Phone1: xxx-xxx-xxxx
Email1: m...@myisp.edu}}}

Then, I'm trying to product a list of first and last names, sorted by
last name using a tiddler with:

<<forEachTiddler
 where
    'tiddler.tags.contains("address")'
 sortBy
   'tiddler.title::Last'
   ascending
 write
   '"|"+tiddler.title::First+"|"+tiddler.title::Last+"|"+tiddler.tags
+"|\n"'


The error message is 'ReferenceError: title is not defined'

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlanBCohen  
View profile  
 More options Sep 20, 10:34 pm
From: AlanBCohen <alanbco...@gmail.com>
Date: Sun, 20 Sep 2009 19:34:04 -0700 (PDT)
Local: Sun, Sep 20 2009 10:34 pm
Subject: Re: Any examples of actual slice use?
I should also make clear that the forEachTiddlerPlugin is installed
and working to produce other lists in this TW file.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Shulman  
View profile  
 More options Sep 21, 12:23 am
From: Eric Shulman <elsdes...@gmail.com>
Date: Sun, 20 Sep 2009 21:23:30 -0700 (PDT)
Local: Mon, Sep 21 2009 12:23 am
Subject: Re: Any examples of actual slice use?

> <<forEachTiddler
>  where
>     'tiddler.tags.contains("address")'
>  sortBy
>    'tiddler.title::Last'
>    ascending
>  write
>    '"|"+tiddler.title::First+"|"+tiddler.title::Last+"|"+tiddler.tags
> +"|\n"'

To render a slice value using TW wiki syntax, you can write:
   <<tiddler [[TiddlerName::slicename]]>>

To programmatically retrieve the value of a slice, use:
   store.getTiddlerText("TiddlerName::slicename","");
   (note: the 2nd param is the default text to use if the tiddler
slice does not exist)

Thus, for your use-case:

<<forEachTiddler
 where
    'tiddler.tags.contains("address")'
 sortBy
   'store.getTiddlerText(tiddler.title+"::Last","")'
   ascending
 write
   '"|"+store.getTiddlerText(tiddler.title+"::First","")
+"|"+store.getTiddlerText(tiddler.title+"::Last","")+"|"+tiddler.tags
+"|\n"'

enjoy,
-e


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlanBCohen  
View profile  
 More options Sep 21, 6:37 am
From: AlanBCohen <alanbco...@gmail.com>
Date: Mon, 21 Sep 2009 03:37:23 -0700 (PDT)
Local: Mon, Sep 21 2009 6:37 am
Subject: Re: Any examples of actual slice use?
Thanks again, Eric.  I'll play with this when I get home tonight.
Alan

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile  
 More options Sep 21, 5:37 pm
From: Mike <eris...@gmail.com>
Date: Mon, 21 Sep 2009 14:37:18 -0700 (PDT)
Local: Mon, Sep 21 2009 5:37 pm
Subject: Re: Any examples of actual slice use?
I don't have much time, but you may be able to find some good examples
here:
http://www.strm.us/TidlyWiki/Examples_TWGG/fETTaskManager.html

The other examples in the following link give some good
InlineJavascript examples to do the same.

http://groups.google.com/group/tiddlywiki/browse_thread/thread/d2d3a8...

Hope that helps,

Mike

On Sep 21, 5:37 am, AlanBCohen <alanbco...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wolfgang  
View profile  
 More options Sep 21, 7:40 pm
From: wolfgang <wolfgangl...@gmail.com>
Date: Mon, 21 Sep 2009 16:40:18 -0700 (PDT)
Local: Mon, Sep 21 2009 7:40 pm
Subject: Re: Any examples of actual slice use?
An other default use of is with the color slices of the ColorPalette
shadowed tiddler.
Or as in this special case, where the author uses the ColorPalette for
background images too (switching different images with a color palette
change):

http://mwanz.tiddlyspot.com/#ColorPalette

Regards..


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlanBCohen  
View profile  
 More options Sep 21, 10:27 pm
From: AlanBCohen <alanbco...@gmail.com>
Date: Mon, 21 Sep 2009 19:27:20 -0700 (PDT)
Local: Mon, Sep 21 2009 10:27 pm
Subject: Re: Any examples of actual slice use?
Thanks to Mike and Wolfgang for their additional information.
Alan

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lyallp  
View profile  
 More options Sep 22, 8:04 am
From: lyallp <lyall.pea...@gmail.com>
Date: Tue, 22 Sep 2009 05:04:05 -0700 (PDT)
Local: Tues, Sep 22 2009 8:04 am
Subject: Re: Any examples of actual slice use?
I also whipped up a Slice plugin....

http://www.remotely-helpful.com/TiddlyWiki/ImprovedSlicesPlugin.html#...

I use it all the time in my own tiddlywiki, an example is as follows,
in conjunction with my Encryption Plugin (http://www.remotely-
helpful.com/TiddlyWiki/TiddlerEncryptionPlugin.html)

I encrypt the WebSiteNameLoginPassword tiddler, using the encryption
plugin. If I don't decrypt, the WebSiteNameLoginId tiddler does not
show passwords.

So, I can pass around my tiddlywiki and if I don't hand out the
password, people can see the sites I use but not the usernames or
passwords.

I use includes elsewhere as well, but this is the main one.

Tiddler name: WebSiteNameLoginId
--------------------------------------------
|!Company:|SiteNamel|>|>|
|!Site:|http://www.site.url.com|>|>|
|!Authentication:|<<tiddler "WebSiteNameLoginPassword::Login01">>|
<<tiddler "WebSiteNameLoginPassword::Login01+1#1">>|<<tiddler
"WebSiteNameLoginPassword::Login01+3#1">>|
|!Authentication:|<<tiddler "WebSiteNameLoginPassword::Login02">>|
<<tiddler "WebSiteNameLoginPassword::Login02+1#1">>|<<tiddler
"WebSiteNameLoginPassword::Login02+3#1">>|
|!Notes:|This is a demo site.|>|>|

Set password in WebSiteNameLoginPassword
--------------------------------------------

Tiddler name: "WebSiteNameLoginPassword"
--------------------------------------------
|!Slice|!User|!Password|!Last Changed|!Notes|
|Login01|username|aPassword|12/09/2009||
|Login02|secondUsername|AnotherPassword|12/09/2009||
--------------------------------------------

...Lyall

On Sep 22, 11:27 am, AlanBCohen <alanbco...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wolfgang  
View profile  
 More options Sep 22, 8:13 am
From: wolfgang <wolfgangl...@gmail.com>
Date: Tue, 22 Sep 2009 05:13:57 -0700 (PDT)
Local: Tues, Sep 22 2009 8:13 am
Subject: Re: Any examples of actual slice use?

> --------------------------------------------
> |!Slice|!User|!Password|!Last Changed|!Notes|
> |Login01|username|aPassword|12/09/2009||
> |Login02|secondUsername|AnotherPassword|12/09/2009||
> --------------------------------------------

How nice would be if the now to GridPlugin renamed SliceGridPlugin -
be able to recognize and edit such multi column tables inline..

http://www.tiddlytools.com/#GridPluginInfo

:-)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Baird  
View profile  
 More options Nov 10, 7:25 am
From: Simon Baird <simon.ba...@gmail.com>
Date: Tue, 10 Nov 2009 22:25:26 +1000
Local: Tues, Nov 10 2009 7:25 am
Subject: Re: [tw] Re: Any examples of actual slice use?

On the topic of things that use slices...

MPTW can display tiddler slices in tagging lists. For example go to the link
below and click 'slices'. It's one of the small buttons above the list. You
can do a neat contacts list in this way.
http://mptw.tiddlyspot.com/#systemConfig

--
simon.ba...@gmail.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google