<div dir="ltr">Thanks again<div><br></div><div>the problem is that the page variable being used ( {*$UpDirUpFile} ) is set by thumblist recipe software</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 5 Apr 2022 at 22:07, Dominique Faure <<a href="mailto:dominique.faure@gmail.com">dominique.faure@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In fact, a name-spaced image attachment doesn't render as such when<br>
the name comes from a variable because those are evaluated in the<br>
context of the current page which is the only one available in PmWiki.<br>
So, when the Attach:... markup is handled, the variable content has<br>
already been processed into the page content and the inserted spaces<br>
are seen as an "end of markup" separation.<br>
<br>
When dealing with the following page content:<br>
<br>
  ptv: aaa bbb.txt<br>
  ...<br>
  Attach:{$:ptv}<br>
<br>
The markup rules apply one after the other on it, transforming the page to:<br>
<br>
  ptv: aaa bbb.txt<br>
  ...<br>
  Attach:aaa bbb.txt<br>
<br>
Which results to:<br>
<br>
  ptv: aaa bbb.txt<br>
  ...<br>
  <Resulting HTML of handling of Attach:aaa> bbb.txt<br>
<br>
The solution here would be to provide a protected/encapsulated<br>
variable content such as:<br>
<br>
  Attach:[=aaa bbb.txt=]<br>
<br>
But since the regular PmWiki's content protection markup is acting<br>
before the variable evaluation while rendering the page, the<br>
encapsulation should occur earlier, therefore:<br>
<br>
  ptv: [=aaa bbb.txt=]<br>
  ...<br>
  Attach:{$:ptv}<br>
<br>
Should do the trick.<br>
<br>
On Tue, Apr 5, 2022 at 6:26 AM Simon <<a href="mailto:nzskiwi@gmail.com" target="_blank">nzskiwi@gmail.com</a>> wrote:<br>
><br>
> Thanks for the examples<br>
><br>
> Attach:{$:gifPTVspaced}<br>
><br>
><br>
> is the problem.<br>
><br>
><br>
> But longer story:<br>
><br>
> the problem arose because the Site.ImageTemplate page I created stopped working (I haven't got to the bottom of that yet).<br>
><br>
><br>
> It turns out I was debugging the default-default image page template generated by thumblist2-actions.php (after searching for the strong "Back to Gallery")<br>
><br>
><br>
> there is a line in there -<br>
><br>
> %p center% {*$PrevLink} [[{*$FullName}?action=browse | $[Back to gallery] ]] {*$NextLink}\\\\<br>
><br>
> Attach:{*$UpDirUpFile}<br>
><br>
><br>
> but my ImageTemplate also has the same problem<br>
><br>
><br>
> ngā mihi<br>
><br>
><br>
> Simon<br>
><br>
><br>
><br>
> On Mon, 4 Apr 2022 at 22:46, Dominique Faure <<a href="mailto:dominique.faure@gmail.com" target="_blank">dominique.faure@gmail.com</a>> wrote:<br>
>><br>
>> Cf. <a href="https://www.pmwiki.org/wiki/Test/AttachWithSpaces" rel="noreferrer" target="_blank">https://www.pmwiki.org/wiki/Test/AttachWithSpaces</a><br>
>><br>
>> What is the exact challenge?<br>
>><br>
>> On Mon, Apr 4, 2022 at 11:26 AM Simon <<a href="mailto:nzskiwi@gmail.com" target="_blank">nzskiwi@gmail.com</a>> wrote:<br>
>> ><br>
>> > We now have the cool markup Attach:[=some file name with spaces=]<br>
>> > but I have a challenge when the file name is already in a variable, e,g,<br>
>> ><br>
>> >     [[Attach:{*$UpDirUpFile} | download]]<br>
>> ><br>
>> > Does anyone have any suggestions for how I can solve this?<br>
>> ><br>
>> > ngā mihi<br>
>> ><br>
>> > Simon<br>
>> > _______________________________________________<br>
>> > pmwiki-users mailing list<br>
>> > <a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
>> > <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" rel="noreferrer" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br>
</blockquote></div>