osdir.com
mailing list archive

Subject: RichText image captions - msg#00005

List: web.kupu.devel

Date: Prev Next Index Thread: Prev Next Index
Hello,
I'm trying to understand how image captioning works in Kupu and implement RichText captions for one of my clients.
It looks like captions are applied by some sort of transform based on the description element of the image.  I found kupu/plone/html2captioned.py and I'm slowly wrapping my head around it...
1) What do I have to do to my custom-types to make their RichText fields able to embed images with with captioning?  It seems that this doesn't work on all RichText fields
2) I have a custom image type that has a RichText body field in addition to description.  I think I could achieve this by creating a new transform similar to html2captioned.py and but configured to pull the caption from my custom RichText fields on the images.  Does that sounds like a sane approach?
Thanks--David Siedband
Open Source Software DeveloperOceanic Sky (US)  /  Zentraal (NL)
http://oceanicsky.com




_______________________________________________
kupu-dev mailing list
kupu-dev@xxxxxxxxxxxxx
http://codespeak.net/mailman/listinfo/kupu-dev
Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: kupu zmi_docs#images link broken

"Diego Municio" <dmunicio@xxxxxxxxx> wrote: > With 3.1rc1 kupu1.4.9 also ocurrs > > 2008/4/2, Diego Municio <dmunicio@xxxxxxxxx>: >> Sorry, I am using Plone 3.0.6 with kupu 1.4.8 >> >> 2008/4/2, Diego Municio <dmunicio@xxxxxxxxx>: >> >> > Hi, >> > >> > When I see page template kupu_library_tool/kupu_config when I >> > click "image captioning documentation" links the following >> > message appears: " We're sorry, but that page doesn't exist?". >> > >> > Is this a reported bug? I couldn't find it in the trac... >> > >> > Any comment? >> > >> > Can you report this in Plone trac so I don't forget to fix it. Thanks

Next Message by Date: click to view message preview

Re: RichText image captions

"David Siedband" <siebo.lists@xxxxxxxxx> wrote: > I'm trying to understand how image captioning works in Kupu and > implement RichText captions for one of my clients. > > It looks like captions are applied by some sort of transform based on > the description element of the image. I found > kupu/plone/html2captioned.py and I'm slowly wrapping my head around > it... > > 1) What do I have to do to my custom-types to make their RichText > fields able to embed images with with captioning? It seems that this > doesn't work on all RichText fields > > 2) I have a custom image type that has a RichText body field in > addition to description. I think I could achieve this by creating a > new transform similar to html2captioned.py and but configured to pull > the caption from my custom RichText fields on the images. Does that > sounds like a sane approach? > Did you also find kupu_captioned_image.pt? It seems to me that would be the place to modify things rather than creating a new transform. In the template options/fullimage should be the object, so if your custom type has some custom field e.g. richcaption then change the captioning expression to something like: tal:content="options/fullimage/getRichcaption|options/caption|nothing" and that ought to do it. Actually it looks like that should preserve structure: options/caption is already html quoted. I don't think I documented all the values passed to that template in options. They are: class (class attribute from the pre-transform html) originalwidth (width attribute from the pre-transform html) originalalt (alt attribute from the pre-transform html) url_path (base relative url of the object) caption (object description with newlines converted to <br>) image (the scaled image) fullimage (the original unscaled image) tag (tag for the scaled image) isfullsize (True iff image is fullimage) width (width of the scaled image)

Previous Message by Thread: click to view message preview

kupu zmi_docs#images link broken

Hi, When I see page template kupu_library_tool/kupu_config when I click "image captioning documentation" links the following message appears: " We're sorry, but that page doesn't exist…". Is this a reported bug? I couldn't find it in the trac... Any comment?

Next Message by Thread: click to view message preview

Re: RichText image captions

"David Siedband" <siebo.lists@xxxxxxxxx> wrote: > I'm trying to understand how image captioning works in Kupu and > implement RichText captions for one of my clients. > > It looks like captions are applied by some sort of transform based on > the description element of the image. I found > kupu/plone/html2captioned.py and I'm slowly wrapping my head around > it... > > 1) What do I have to do to my custom-types to make their RichText > fields able to embed images with with captioning? It seems that this > doesn't work on all RichText fields > > 2) I have a custom image type that has a RichText body field in > addition to description. I think I could achieve this by creating a > new transform similar to html2captioned.py and but configured to pull > the caption from my custom RichText fields on the images. Does that > sounds like a sane approach? > Did you also find kupu_captioned_image.pt? It seems to me that would be the place to modify things rather than creating a new transform. In the template options/fullimage should be the object, so if your custom type has some custom field e.g. richcaption then change the captioning expression to something like: tal:content="options/fullimage/getRichcaption|options/caption|nothing" and that ought to do it. Actually it looks like that should preserve structure: options/caption is already html quoted. I don't think I documented all the values passed to that template in options. They are: class (class attribute from the pre-transform html) originalwidth (width attribute from the pre-transform html) originalalt (alt attribute from the pre-transform html) url_path (base relative url of the object) caption (object description with newlines converted to <br>) image (the scaled image) fullimage (the original unscaled image) tag (tag for the scaled image) isfullsize (True iff image is fullimage) width (width of the scaled image)
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by