Hi Andreas
Thanks for the help.
I've used the first option for referring the link (for the module's
pipeline) as you suggested:
<img src="/modules/mymodule/img-1.jpg"/>
Now my link contains the module information and it's working now.
Thanks to all again.
Andreas Hartmann wrote:
Hi Anish,
please take the time to read one or two articles on mailing list
quoting style. There are some links on the "Mailing Lists" page on the
Lenya website.
Anish schrieb:
I'm sorry actually I used placeholders like:
<map:match pattern="**/img-*.jpg"> <map:read
src="/home/anish//{2}/.jpg" type="image"/>
</map:match>
I used the same. This was a typing mistake in the mail.
I see, but that was only a side note anyway. Was there something
useful in the rest of my mail?
-- Andreas
Andreas Hartmann wrote:
Hi Anish,
please refrain from cross-posting to the dev list. This is a usage
question.
Anish schrieb:
Can anybody suggest how to use image reader in Lenya 2 (inside a
module)
e.g. in lenya 1.2.4, I wrote my pipeline in
publication-sitemap.xmap for reading an image as:
<map:match pattern="**/img-*.jpg"> <map:read
src="/home/anish/*.jpg" type="image"/>
</map:match>
I put name of the image in <img src="img-1.jpg"/> tag and It
worked where 1.jpg is the name of the image.
But now I want to achieve that inside a module (lenya 2.0.2). e.g.
I've a module named mymodule (..../lenya/src/modules/mymodule) I've
written the same pipeline in
..../lenya/src/modules/mymodule/sitemap.xmap like:
<map:match pattern="**/img-*.jpg"> <map:read
src="/home/anish/*.jpg" type="image"/>
</map:match>
Maybe that's a copy&paste error, but you can't use an asterisk in
the source URI, but rather the placeholder (I guess that would be
{2} in your case).
and created a module type page (say page1.html), on the same page I
want to access images using <img...../> tag.
If you want to deliver the image from a module, your link must
contain the module information. There are two options:
1) <img src="/modules/mymodule/img-1.jpg"/>
2) <img src="img-1.jpg?lenya.module=mymodule"/>
In option 1), the link has to be transformed using the proxy
transformer so that the URL will be compatible with arbitrary proxy
setups.
I guess in your case option 1) will be more suitable. The matcher in
the module sitemap doesn't need a prefix:
<map:match pattern="img-*.jpg">
<map:read src="/home/anish/{1}.jpg"/>
</map:match>
HTH,
-- Andreas
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
--
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]