|
Home > Archive > Microsoft Content Management Server > September 2007 > Adding a caption to a custom summary control
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Adding a caption to a custom summary control
|
|
|
| BACKGROUND: We have a template with a custom control that uses a
collection of news release postings to create a summary page with the
headline, date, and snippet of the article. We have two additional
placeholders: one is for a summary image - the other is for a
corresponding caption. The desired layout is for the image and
caption to be inline with the story snippet wrapping around it. These
elements are under the headline and date. We have accomplished this
with a div surrounding the image and caption. The article summary
wraps around the div to the right or left based on a custim property
in each release..
PROBLEM: There is no fixed size for this summary thumbnail. Since the
image width varies with each image, we need the caption to wrap at the
end of the image. Currently, no width is set for the div and long
captions stretch past their images. To force this wrap, we would need
a dynamic way to have the div width match the width of the image used
for that summary.
Is there a way to pull the image width from the Single Image
Placeholder? If not, does any one have an alternative suggestion to
implement this?
| |
| Stefan Goßner [MSFT] 2007-09-24, 7:24 am |
| Hi Rob,
what you can do is to do a HttpWebRequest against the URL, consume the
response stream in an Image object and then check the size here.
Cheers,
Stefan
"Rob" <saxon_rm@mercer.edu> wrote in message
news:1190430258.414928.85430@r29g2000hsg.googlegroups.com...
> BACKGROUND: We have a template with a custom control that uses a
> collection of news release postings to create a summary page with the
> headline, date, and snippet of the article. We have two additional
> placeholders: one is for a summary image - the other is for a
> corresponding caption. The desired layout is for the image and
> caption to be inline with the story snippet wrapping around it. These
> elements are under the headline and date. We have accomplished this
> with a div surrounding the image and caption. The article summary
> wraps around the div to the right or left based on a custim property
> in each release..
>
> PROBLEM: There is no fixed size for this summary thumbnail. Since the
> image width varies with each image, we need the caption to wrap at the
> end of the image. Currently, no width is set for the div and long
> captions stretch past their images. To force this wrap, we would need
> a dynamic way to have the div width match the width of the image used
> for that summary.
>
> Is there a way to pull the image width from the Single Image
> Placeholder? If not, does any one have an alternative suggestion to
> implement this?
>
| |
| j.madgwick@wiganmbc.gov.uk 2007-09-26, 1:22 pm |
| Hi Rob,
We had a similar problem with the News section of our site. We have
used JavaScript to restrict the width of the caption after the image
has loaded in the browser:
http://www.wigan.gov.uk/News/Archiv.../LeighProms.htm
View the source of the page above and look for "function
amendCaptionSize".
Hope it helps,
John.
| |
| j.madgwick@wiganmbc.gov.uk 2007-09-26, 1:22 pm |
| Oh yeah, if you do use this JavaScript technique, make sure you put
the script in a PresentationModeContainer so it doesn't interfere with
the authoring controls.
On 26 Sep, 15:11, j.madgw...@wiganmbc.gov.uk wrote:
> Hi Rob,
>
> We had a similar problem with the News section of our site. We have
> used JavaScript to restrict the width of the caption after the image
> has loaded in the browser:
> http://www.wigan.gov.uk/News/Archiv.../LeighProms.htm
>
> View the source of the page above and look for "function
> amendCaptionSize".
>
> Hope it helps,
> John.
|
|
|
|
|