Finally got it figured out with the following code:

<$button> remove extraneous text
<$list filter="[tag[Railroads]]" variable="tid" >
<$list filter="[<tid>get[text]split[\define]splitregexp[.*>]]" 
variable="pap">
<$action-setfield $tiddler=<<tid>> text=<<pap>> />
</$list></$list></$button>



On Friday, November 20, 2020 at 11:11:08 AM UTC-7 History Buff wrote:

> Alright, I've made a lot of progress. I would now like to be able to 
> delete all of the previous defines and transcludes that I had at the 
> beginning of the text field. I want to create a button that would do this 
> automatically for me. I know it's going to use splitregexp, but I am 
> totally new to regular expressions and have no idea where to start. Below 
> is the code at the beginning of the text field for the tiddler that I 
> included the screenshot for:
>
> \define successor() [[Wichita Northwestern Railway]]
>
> \define proposedroute() From Anthony, through the counties of Harper, 
> Barber, Pratt, Stafford, Pawnee, Rush, Ellis, Rooks and Phillips, to 
> Hastings, Nebraska. Length: 275 miles.
>
> \define business() Hutchinson, Kansas; Pratt, Kansas
>
> \define term() 50 years
>
> \define directors() O. P. Byers, Hutchinson, Kansas; E. A. Smith, Kansas 
> City, Missouri; H. J. Duvall, Hutchinson, Kansas; A. C. Mallory, 
> Hutchinson, Kansas; R. A. Cox, Pratt, Kansas.
>
> \define capital() $150,000 - 1,500 shares at $100 each
>
> \define stockholders() Same as directors.
>
> \define signers() All the directors; December 3, 1912
>
> \define notes() See: The [[Wichita Northwestern Railway]] 
> Company<br><br>Amended Charters --- 1916-11-21; Vol. A-22, p. 199; 
> Increased Capital Stock --- 1917-01-04; Vol. A-22; pp. 274-280; Added more 
> counties to route --- 1918-04-03; Vol. A-23; pp. 445-447; Increased number 
> of directors --- 1919-11-24; Vol. A-25; p. 247; Included authority to 
> operate in Sedgwick County
>
> \define maplink() <a href="./maps/Anthony & Northern Railway.jpg" 
> target="_blank"> <img align="middle" src="./maps/Anthony & Northern 
> Railway.jpg" width="468"></a>
>
> \define paper() No
>
> <$list filter="[all[current]!has[notinbarnes]]">
>   <$transclude tiddler="Barnesbox">
>   </$transclude>
> </$list>
>
> <$list filter="[all[current]has[notinbarnes]]">
>   <$transclude tiddler="Infobox">
>   </$transclude>
> </$list>
>
> I would like to remove all of this text automatically because there are so 
> many tiddlers that I'd like to not do it manually. Any ideas for the 
> regular expression illiterate?
>
> Damon
>
> On Wednesday, November 18, 2020 at 9:16:35 PM UTC-7 History Buff wrote:
>
>> I'm always terrible at giving enough information and I apologize. After 
>> some thinking about it, I finally figured out a way to do it. I put the map 
>> link in a field named maplink and then put {{!!maplink}} in the appropriate 
>> area of the infobox table. Works like a charm. Whether you directly solve 
>> my issue or not, you always get me thinking in the right direction for 
>> which I thank you. Highest regards, sir.
>>
>> Damon
>>
>> On Wednesday, November 18, 2020 at 9:09:24 PM UTC-7 TW Tones wrote:
>>
>>> Damon,
>>>
>>> So as I understand it when you transclude  Infobox it is rendered with 
>>> the current tiddler set to the tiddler in which your code snipit is written 
>>> unless you take other steps to alter the currentTiddler, this is supported 
>>> by the idea that  you subsequently transclude the text field presumable of 
>>> the same tiddler.
>>>
>>> How does Infobox determine the correct map tiddler to link to?
>>>
>>> A global macro that references a field in the currentTiddler, will adapt 
>>> to local content.
>>>
>>> I do not have enough to help address your specific issues, but best of 
>>> luck. Feel free to ask more.
>>>
>>> Tones
>>>
>>> On Thursday, 19 November 2020 at 14:27:22 UTC+11 History Buff wrote:
>>>
>>>> You're right, I forgot to show my code which I now have below:
>>>>
>>>> <aside style="float: right; margin-top: 0;">
>>>> <$transclude tiddler="Infobox">
>>>> </$transclude>
>>>> </aside>
>>>>
>>>> <$transclude field=text mode=block/>
>>>>
>>>> I can't have a globally defined map link because each railroad has a 
>>>> unique map.
>>>>
>>>> I misspoke earlier. My infobox stylesheet is being used.
>>>>
>>>> Damon
>>>> On Wednesday, November 18, 2020 at 7:21:12 PM UTC-7 TW Tones wrote:
>>>>
>>>>> Buff,
>>>>>
>>>>> If you place \defines in a tiddler tagged $:/tags/Macro it can be used 
>>>>> by name globally, similarly css placed in a tiddler 
>>>>> tagged $:/tags/Stylesheet will also be usable globally, this is the 
>>>>> approach to use when you want to reuse.
>>>>>
>>>>> Remember when using the  <transclude field=text mode=block/>  it 
>>>>> assumes tiddler=<<currentTiddler>>, what is the current tiddler at the 
>>>>> time? 
>>>>> You do not show how you have coded the click here for map legend, but 
>>>>> it sounds like to need to set or reference the correct tiddler.
>>>>>
>>>>> I hope this is helping.
>>>>>
>>>>> Tones 
>>>>>
>>>>> On Thursday, 19 November 2020 at 10:15:33 UTC+11 History Buff wrote:
>>>>>
>>>>>> Tones,
>>>>>>
>>>>>> The aside element worked as long as it was above the transcluded 
>>>>>> body. The table didn't really work the way I wanted becuase, if the body 
>>>>>> text was very long, it wouldn't wrap around the infobox.
>>>>>>
>>>>>> Now the only issue I have remaining is the map within the infobox. 
>>>>>> The link to the map is defined with a define statement within the body 
>>>>>> text, but using the method you outlined above prevents the link from 
>>>>>> being 
>>>>>> seen by the infobox. Is there another way I can define the link to the 
>>>>>> map 
>>>>>> that would work with your using the <transclude field=text mode=block/>?
>>>>>>
>>>>>> On Tuesday, November 17, 2020 at 10:49:44 PM UTC-7 TW Tones wrote:
>>>>>>
>>>>>>> Ahhh,
>>>>>>>
>>>>>>> Yes, you need to find a way to have the text you require inside the 
>>>>>>> tiddler, as in your image, it is inside the tiddler.
>>>>>>>
>>>>>>>    - You can hide the default body with a field hide-body=yes on a 
>>>>>>>    give tiddler, 
>>>>>>>    - Then you introduce a replacement to display "the body" 
>>>>>>>    <$transclude field=text mode=block/> along side your extra content.
>>>>>>>       - Perhaps create a table
>>>>>>>       - or use the html aside tag.
>>>>>>>       
>>>>>>> Alternatively you could look at modifying the 
>>>>>>> current $:/core/ui/ViewTemplate/body tiddler to include your additional 
>>>>>>> content along side the existing <$transclude> therein.
>>>>>>>
>>>>>>> Tones
>>>>>>>
>>>>>>> On Wednesday, 18 November 2020 at 10:11:22 UTC+11 History Buff wrote:
>>>>>>>
>>>>>>>> Hey Tones,
>>>>>>>>
>>>>>>>> Yes, I did try changing the order using the tag pill. That's how I 
>>>>>>>> moved it from above the body text to below.  There was no order that 
>>>>>>>> would 
>>>>>>>> put it in the position that I wanted. It seems that each ViewTemplate 
>>>>>>>> takes 
>>>>>>>> up its own horizontal space within the tiddler and that space occupies 
>>>>>>>> the 
>>>>>>>> full width.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Damon
>>>>>>>>
>>>>>>>> On Tuesday, November 17, 2020 at 4:07:49 PM UTC-7 TW Tones wrote:
>>>>>>>>
>>>>>>>>> Damon,
>>>>>>>>>
>>>>>>>>> Have you tried changing the order of the items 
>>>>>>>>> tagged $:/tags/ViewTemplate using the tag pill?
>>>>>>>>>
>>>>>>>>> <<tag $:/tags/ViewTemplate>>
>>>>>>>>>
>>>>>>>>> Once you resolve it you can use the list-before or list-after 
>>>>>>>>> fields to set the order in place
>>>>>>>>> eg
>>>>>>>>> list-before $:/core/ui/ViewTemplate/body
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> Tones
>>>>>>>>>
>>>>>>>>> On Wednesday, 18 November 2020 at 07:57:44 UTC+11 History Buff 
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hello all,
>>>>>>>>>>
>>>>>>>>>> I'm trying to put some content into a ViewTemplate and am having 
>>>>>>>>>> some difficulties with positioning. The attached screenshot is a 
>>>>>>>>>> single 
>>>>>>>>>> tiddler from my railroad research wiki. The infobox on the right is 
>>>>>>>>>> transcluded material. The text to the right of that is in the body 
>>>>>>>>>> of the 
>>>>>>>>>> tiddler. The tabs and stuff at the bottom are part of a 
>>>>>>>>>> ViewTemplate. What 
>>>>>>>>>> I would like to do, is to put the infobox into a ViewTemplate, but 
>>>>>>>>>> when I 
>>>>>>>>>> do, it won't position like it is in the screenshot. It is either 
>>>>>>>>>> above the 
>>>>>>>>>> body text or below the body text and not to the right of it. Is 
>>>>>>>>>> there a way 
>>>>>>>>>> to accomplish this? 
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> Damon
>>>>>>>>>>
>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8426ad41-1492-429a-9f81-ccf81f4516c3n%40googlegroups.com.

Reply via email to