How to get tiddler macro to refer to itself and/or section within current tiddler?

105 views
Skip to first unread message

Mark S.

unread,
Jun 12, 2013, 7:21:23 PM6/12/13
to tiddl...@googlegroups.com
I'm trying to do something like:

<<tiddler
  {{story.findContainingTiddler(place).getAttribute("tiddler")+"##SECTION1"
   }}
>>

or like

<<tiddler
  [[{{story.findContainingTiddler(place).getAttribute("tiddler")+"##SECTION1"
   }}]]
>>

So far this hasn't worked.  If I use a parameter, I can get the expression to evaluate. But to use a parameter, I have to already provide the name of the current macro, so I haven't achieved what I want.

And while I'm asking, I would also like to know what attribute(s) to use to retrieve tags, fields, section contents, and tiddler text.

Thanks!
Mark

Mat

unread,
Jun 18, 2013, 8:26:46 AM6/18/13
to tiddl...@googlegroups.com
Bump.


And while I'm asking, I would also like to know what attribute(s) to use to retrieve tags, fields, section contents, and tiddler text.

tiddler macro on tw.org may give some clues on this.

<:-)

PMario

unread,
Jun 18, 2013, 12:15:08 PM6/18/13
to tiddl...@googlegroups.com
I think, it would be easier, if you tell us, what you want to achieve. You said, your code doesn't do, what you want. So how should we know, what you want?

Some guesswork: If you put this into any tiddler it will display the hidden "section" text

<<tiddler {{tiddler.title + "##section"}}>>

/%
! section
some text
!%/

-m

PMario

unread,
Jun 18, 2013, 12:28:24 PM6/18/13
to tiddl...@googlegroups.com
Some more info about transcluded content:

http://hoster.peermore.com/recipes/TeamWork/tiddlers.wiki#%5B%5BCreate%20New%20Tiddler%20with%20a%20transcluded%20script%5D%5D%20TestAddTagTranscluded%20TransclusionsInsideTables%20TransclusionWithStoreGetTiddlerText

Access tiddler elements see the <<view>> macro: http://tiddlywiki.org/#view

The view macro is intended to be used with templates but it also works as a macro ... but ...
be carefull with <<view element wikified>> it is very easy to create endless loops. Make sure you have a working backup :)

<<view text text>> is save

possibe elements:
have fun!
mario

PMario

unread,
Jun 18, 2013, 12:36:05 PM6/18/13
to tiddl...@googlegroups.com

Mark S.

unread,
Jun 18, 2013, 1:17:23 PM6/18/13
to tiddl...@googlegroups.com
Hey! I didn't bump this thread!

In terms of the code, what I have done so far is to change my strategy. At first I wanted <<tiddler...>> to work inside a template. With some advice from Eric, I changed it to a macro="tiddler..." format.

What I have found so far is that apparently for evaluated expressions {{}} to work inside of  "macro=" ,  it needs to use single quotes. And it only works inside of "macro=" and nowhere else in the template tiddler.

Also, "tiddler.title" doesn't work inside the template tiddler. Thus the long expression

  {{story.findContainingTiddler(place).getAttribute("tiddler")+"##SECTION }}

is still required. What I would have liked was to use the name right inside the ViewTemplate, but as far as I can tell what I had to do instead was transclude a separate tiddler, passing it the evaluated name to work with.

My overall goal is to create a TiddlyWiki that will allow me to view receipts stored as PDF's. Ideally I would be able to view the PDF and its related text side-by-side in a tiddler. I could copy OCR'd text from the PDF to the corresponding tiddler, and tweak it a bit as needed. This is mostly working, except that currently I can't float the embedded PDF and the text side-by-side. They have to be one above the other. I need to work out details for sub-directories, and for dragging and dropping the PDF's.

This same system would allow me to create photo albums. The TW would work as an overlay, providing the ability to search and display images. It would not, of course, actually store the contents of the images.

Thanks,
Mark
 
Reply all
Reply to author
Forward
0 new messages