Access to the tiddlers inside a CompoundTiddler?

Are there wikitext techniques to access the tiddlers inside a Compound Tiddler?

I’m trying to make certain static changes to a wiki with a known structure, adding or removing some tags, adding or deleting some tiddlers. I’m trying to determine the best way to supply the configuration for that. I’m about to open another topic to ask about that. One possibility I thought of was to have tiddlers in a Compound Tiddler that I might clone, or which might hold information about other changes.

But I don’t know how to access those inner tiddlers. Clearly it can be done from JS, as the TestCase widget must have access to these. But can it be done in wikitext?

The testcase-widget creates an independent store, which is “outside” the basic store by intention. So we are able to test functionality without side effects in the main store.

If you create a TestCase tiddler, you will have a More → import tiddlers function, that is able to transfer tiddlers from the test-store to the main store. See screenshot

Thank you. I probably wasn’t clear. I was looking for something like programmatic access, similar to the way plugintiddlers and subtiddlerfields reach inside a plugin to extract information from nested tiddlers. Is there something similar for CompoundTiddlers?

/bump

This is another older topic I’m hoping might get a little more attention. Thank you @pmario for your response, but I’m still curious as to whether this basic idea is possible.

@jeremyruston: is there any wikitext mechanism to directly access the tiddlers in a CompoundTiddler? I would love to use them as a series of instructions for changes to the main wiki, without incorporating them directly into the main wiki. The context for this is given in Design question: how to configure tool to alter wikis with a specific structure?, While this is simply one of the three techniques I’ve considered, I think it’s the one I would like the best. But I simply don’t know if it’s possible.

There is no mechanism at present that allows direct access to the tiddlers in a compound tiddler.

However, I think it would be feasible to extend the existing subtiddler handling of the transclude, view and set widgets so that compound tiddlers could be targeted instead of plugins. It would not break backwards compatibility so it wouldn’t need to be a v5.4.0 thing.

1 Like

Thank you. I’ll try to look to see what it would take. Unless I’m missing something, it would also need to involve extending or cloning plugintiddlers and subtiddlerfields as well, unless we wanted to use it only to target subtiddlers with known names.

Would it be most useful if I tried this in a standalone plugin to iron out any wrinkles in the API first or would you prefer I tried to create a PR directly with these changes?

Hi @Scott_Sauyet I had a quick look at the code, and tentatively think the only thing that will need updating is the getSubTiddler method in wiki.js to be able to read subtiddlers from compound tiddlers.

I should have added that subtiddlerfields will automatically get the new functionality. We might indeed also want to extend the plugintiddlers operator. In any event, I’d be happy for this to go into the core.

Ok, I’ll look at this as soon as I have a free evening. Thanks!