[pmwiki-users] Images in included pages

ABClf languefrancaise at gmail.com
Sat Jul 12 16:29:29 CDT 2014


(The solution to use Attach:{$Group}./image.jpg will work for wikis with
the default $UploadPrefixFmt, not for you; this solution here should work
in both cases of $UploadPrefixFmt.)

Indeed, thank you for watching Petko ;)

Well, everything that would make pmwiki smarter is welcome (I guess).
Here, it is true it would be nice if pmwiki can handle automagically the
basement of included attached files.




2014-07-12 17:53 GMT+02:00 Petko Yotov <5ko at 5ko.fr>:

> Peter Schwegler writes:
>
>> I have a page, with an attached image. When I view this page directly the
>> image is shown correctly. When I include this page in another page (also in
>> another group) all I see is "Attach:imagename" with the upload triangle.
>>
>> original page: group A.page A
>> this page is included in group B.page B
>>
>> I save my uploads in a directory per page ($UploadPrefixFmt='/$Group/$
>> Name)
>>
> ...
>
>  What do I need to change to see the image also in page B?
>>
>
> You can write in PageA.PageA one among:
>
>  Attach:GroupA.PageA/image.jpg
>  Attach:{$FullName}/image.jpg
>
> Then the image will be displayed in both PageA and PageB.
>
> (The solution to use Attach:{$Group}./image.jpg will work for wikis with
> the default $UploadPrefixFmt, not for you; this solution here should work
> in both cases of $UploadPrefixFmt.)
>
> It is possible to instruct PmWiki to automatically insert GroupA.PageA
> when including a page. Something like this in config.php may work:
>
>  SDV($QualifyPatterns["/(\\[\\[ *Attach:)([^\\/$
> UrlExcludeChars]+(\\|.*?)?\\]\\])/"],
>    PCCF("\$m[1].\$pagename.'/'.\$m[2]", 'qualify'));
>  SDV($QualifyPatterns["/\\b(Attach:)([^\\s\\/$UrlExcludeChars]+(\\s|[$
> UrlExcludeChars]|$))/"],
>    PCCF("\$m[1].\$pagename.'/'.\$m[2]", 'qualify'));
>
> This has not been extensively tested but should work in most cases for
> most attachments (pictures or not) in included pages.
>
> Maybe I should create a Cookbook recipe and let people test the snippet so
> we can improve it before eventually include it in the PmWiki core?
>
> Petko
>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>



-- 

---------------------------------------
| A | de la langue française
| B | http://www.languefrancaise.net
| C | languefrancaise at gmail.com
---------------------------------------
       @bobmonamour
---------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20140712/c2a1d2b1/attachment.html>


More information about the pmwiki-users mailing list