Microsoft Content Management Server - RenderPhServerControl and hyperlinks

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2007 > RenderPhServerControl and hyperlinks





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 RenderPhServerControl and hyperlinks
mullkv@googlemail.com

2007-02-15, 7:20 am

Hi All,

i am using the control that Stefan built : RenderPhServerControl and
it works well.

The only problem I seem to have is that when I use an image in one of
the source placholders, and have an anchor (hyperlink) on that image,
the RenderPhServerControl does not pick up the hyperlink... my
generated code is:

<img src='/NR/rdonlyres/82833115-AD26-4C13-92CB-43EFB9F45FE3/2063/
tab_press.gif' alt='Stop Press' border=0></a>

The image is correct but as you can see all that appears in terms of
the hyperlink is the closing </a> tag.

Does the control support hyperlinks? Or am I doing something wrong?

Many Thanks

Kevin Mullins

Stefan Goßner [MSFT]

2007-02-15, 7:20 am

Hi Kevin,

this control extracts the complete placeholder content.
It seems that this is exaclty the html content inside the html placeholders.

Cheers,
Stefan


<mullkv@googlemail.com> wrote in message
news:1171540626.630455.39090@s48g2000cws.googlegroups.com...
> Hi All,
>
> i am using the control that Stefan built : RenderPhServerControl and
> it works well.
>
> The only problem I seem to have is that when I use an image in one of
> the source placholders, and have an anchor (hyperlink) on that image,
> the RenderPhServerControl does not pick up the hyperlink... my
> generated code is:
>
> <img src='/NR/rdonlyres/82833115-AD26-4C13-92CB-43EFB9F45FE3/2063/
> tab_press.gif' alt='Stop Press' border=0></a>
>
> The image is correct but as you can see all that appears in terms of
> the hyperlink is the closing </a> tag.
>
> Does the control support hyperlinks? Or am I doing something wrong?
>
> Many Thanks
>
> Kevin Mullins
>



mullkv@googlemail.com

2007-02-15, 1:17 pm

Thanks Stefan,

The problem seemed to be in the Render event of the PH control, the
code that I had was:

CODE =3D=3D=3D=3D=3D
case
"Microsoft.ContentManagement.Publishing.Extensions.Placeholders.ImagePlaceh=
older":
ImagePlaceholder imgph =3D null;
try
{
imgph =3D (ImagePlaceholder)p.Placeholders[_PlaceholderName];
}
catch
{
imgph =3D null;
}
if (imgph =3D=3D null)
{
writer.Write("<table border=3D1 width=3D100%><tr><th>Placeholder
'"+_PlaceholderName+"' not found on Posting '"+_PostingPath+"'!</th></
tr></table>");
return;
}

writer.Write("<img src=3D'"+imgph.Src+"' alt=3D'"+imgph.Alt+"'
border=3D0></a>"); <<--THIS LINE
break;
=3D=3D=3D/CODE

I fixed it by checking to see if imgph had a href value - indicating
an hyperlink on the image and preappending that to the writer.write
line, and striping the trailing </a> if it didn't.

Might not be the best way, but seems to work for me.

Thanks again.

Kevin





On 15 Feb, 13:05, "Stefan Go=DFner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Kevin,
>
> this control extracts the complete placeholder content.
> It seems that this is exaclty the html content inside the html placeholde=

rs.
>
> Cheers,
> Stefan
>
> <mul...@googlemail.com> wrote in message
>
> news:1171540626.630455.39090@s48g2000cws.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
> - Show quoted text -



Stefan Goßner [MSFT]

2007-02-15, 1:17 pm

Hi Kevin,

it seems you found a bug in my code.
;-)

Cheers,
Stefan


<mullkv@googlemail.com> wrote in message
news:1171545670.362055.281880@h3g2000cwc.googlegroups.com...
Thanks Stefan,

The problem seemed to be in the Render event of the PH control, the
code that I had was:

CODE =====
case
"Microsoft.ContentManagement.Publishing.Extensions.Placeholders.ImagePlaceholder":
ImagePlaceholder imgph = null;
try
{
imgph = (ImagePlaceholder)p.Placeholders[_PlaceholderName];
}
catch
{
imgph = null;
}
if (imgph == null)
{
writer.Write("<table border=1 width=100%><tr><th>Placeholder
'"+_PlaceholderName+"' not found on Posting '"+_PostingPath+"'!</th></
tr></table>");
return;
}

writer.Write("<img src='"+imgph.Src+"' alt='"+imgph.Alt+"'
border=0></a>"); <<--THIS LINE
break;
===/CODE

I fixed it by checking to see if imgph had a href value - indicating
an hyperlink on the image and preappending that to the writer.write
line, and striping the trailing </a> if it didn't.

Might not be the best way, but seems to work for me.

Thanks again.

Kevin





On 15 Feb, 13:05, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Kevin,
>
> this control extracts the complete placeholder content.
> It seems that this is exaclty the html content inside the html
> placeholders.
>
> Cheers,
> Stefan
>
> <mul...@googlemail.com> wrote in message
>
> news:1171540626.630455.39090@s48g2000cws.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
> - Show quoted text -




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com