Question
I want to have in my topic A link to topic B + heading 1 from B. Must i use INCLUDE+regexp or INCLUDE+section or is there something easier like
[[B B.%H1%]] ?
Example, topic B contains
---+ This is B
...
Topic A should contain:
...
[[B]]This is B (where the text 'This is B' comes from topic B). One possibility is as I wrote:
[[B]]%INCLUDE{"B" pattern="..."}%but something shorter would be probably very useful, eg.
[[B B.%H1%]]
Environment
--
MartinDluhos - 02 Jan 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
You cannot specify anything with an object-like syntax.
You either have to get the first headline text using a formatted search or using INCLUDE.
If the B topic has a form, you can make a title field in the form.
In B you write
---++ %FORMFIELD{"title"}%
In A you write
[[B]] %FORMFIELD{"title" topic="B"}%
And then you can change the title by editing the field in the form of B.
With INCLUDE you do can solve the same task like this
TopicB:
---+ %STARTSECTION{"headline"}%This the Test Headline%ENDSECTION{"headline"}%
and in TopicA
[[TopicB]] %INCLUDE{section="headline" "TopicB"}%
Note that if the topic name is a
WikiWord then you do not need the [[]] notation.
If you want the headline to be a link then make topic linking like
[[TopicB][%INCLUDE{section="headline" "TopicB"}%]]
--
KennethLavrsen - 02 Jan 2007
An object oriented
ContentAccessSyntax is currently at the discussion stage; a logical step to make TWiki stronger as an
TWikiApplications platform.
--
PeterThoeny - 02 Jan 2007