Microsoft Content Management Server - Placeholder rawcontent

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > November 2005 > Placeholder rawcontent





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 Placeholder rawcontent
Jimmy Jazz

2005-11-23, 5:52 pm

Hi,

I need to get the data from the placeholders on a posting so I can perform
some maunual formatting. I thouight this was the way but it appears not

Channel.Posting.Placeholder.Datasource.RawContent;

Jim
Stefan [MSFT]

2005-11-23, 5:52 pm

Hi Jimmy,

you should never use datasource.rawcontent.
See here for an explanation:
http://blogs.technet.com/stefan_gos.../24/119546.aspx

In addition your code below has a bug. Placeholders is a collection and not
an item.
You need to select the specific item to work on it.

Correct code would look like this:

HtmlPlaceholder htmlPh = Channel.Posting.Placeholders["phname"] as
HtmlPlaceholder;
string content = htmlPh.Html;

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Jimmy Jazz" <Jimmy Jazz@discussions.microsoft.com> wrote in message
news:390D8146-3559-424A-B304-5BC3259AE654@microsoft.com...
> Hi,
>
> I need to get the data from the placeholders on a posting so I can perform
> some maunual formatting. I thouight this was the way but it appears not
>
> Channel.Posting.Placeholder.Datasource.RawContent;
>
> Jim



Jimmy Jazz

2005-11-23, 5:52 pm

Many thanks again Stefan.

"Stefan [MSFT]" wrote:

> Hi Jimmy,
>
> you should never use datasource.rawcontent.
> See here for an explanation:
> http://blogs.technet.com/stefan_gos.../24/119546.aspx
>
> In addition your code below has a bug. Placeholders is a collection and not
> an item.
> You need to select the specific item to work on it.
>
> Correct code would look like this:
>
> HtmlPlaceholder htmlPh = Channel.Posting.Placeholders["phname"] as
> HtmlPlaceholder;
> string content = htmlPh.Html;
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <Jimmy Jazz@discussions.microsoft.com> wrote in message
> news:390D8146-3559-424A-B304-5BC3259AE654@microsoft.com...
>
>
>

Jimmy Jazz

2005-11-23, 5:52 pm

Hi Stefan,

I am using the telerik placeholder and it doesn't seem to work.

im

"Stefan [MSFT]" wrote:

> Hi Jimmy,
>
> you should never use datasource.rawcontent.
> See here for an explanation:
> http://blogs.technet.com/stefan_gos.../24/119546.aspx
>
> In addition your code below has a bug. Placeholders is a collection and not
> an item.
> You need to select the specific item to work on it.
>
> Correct code would look like this:
>
> HtmlPlaceholder htmlPh = Channel.Posting.Placeholders["phname"] as
> HtmlPlaceholder;
> string content = htmlPh.Html;
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <Jimmy Jazz@discussions.microsoft.com> wrote in message
> news:390D8146-3559-424A-B304-5BC3259AE654@microsoft.com...
>
>
>

Stefan [MSFT]

2005-11-23, 5:52 pm

Hi Jimmy,

you are mixing up terms!
The code below accesses a placeholder object - not a placeholder control.
A placeholder is the item in the database while a placeholder control is a
rendering and edit engine - with other words a window to a placeholder.

The code below works independendly from the placeholder control. But if I
understand you right you would like to access the content in the placeholder
control and not the content in the placeholder object, right?

Then please use the Html property of the placeholder control. This will also
work for as well the telerik control and the standard
HtmlPlaceholderControl.

But the namespace of the object is different and you would need to use the
ID plus .Html.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
news:098311AB-17FF-4517-9E73-5785AC06C4CB@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> I am using the telerik placeholder and it doesn't seem to work.
>
> im
>
> "Stefan [MSFT]" wrote:
>


Jimmy Jazz

2005-11-23, 5:52 pm

I got it now thanks Stefan

"Stefan [MSFT]" wrote:

> Hi Jimmy,
>
> you are mixing up terms!
> The code below accesses a placeholder object - not a placeholder control.
> A placeholder is the item in the database while a placeholder control is a
> rendering and edit engine - with other words a window to a placeholder.
>
> The code below works independendly from the placeholder control. But if I
> understand you right you would like to access the content in the placeholder
> control and not the content in the placeholder object, right?
>
> Then please use the Html property of the placeholder control. This will also
> work for as well the telerik control and the standard
> HtmlPlaceholderControl.
>
> But the namespace of the object is different and you would need to use the
> ID plus .Html.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
> news:098311AB-17FF-4517-9E73-5785AC06C4CB@microsoft.com...
>
>
>

Jimmy Jazz

2005-11-28, 7:49 am

Hi Stefan,

I am also using Telerik for image placeholders as well and need the src
attribute to format in my control. The HTML Placeholder does not have this
attribute.

"Stefan [MSFT]" wrote:

> Hi Jimmy,
>
> you are mixing up terms!
> The code below accesses a placeholder object - not a placeholder control.
> A placeholder is the item in the database while a placeholder control is a
> rendering and edit engine - with other words a window to a placeholder.
>
> The code below works independendly from the placeholder control. But if I
> understand you right you would like to access the content in the placeholder
> control and not the content in the placeholder object, right?
>
> Then please use the Html property of the placeholder control. This will also
> work for as well the telerik control and the standard
> HtmlPlaceholderControl.
>
> But the namespace of the object is different and you would need to use the
> ID plus .Html.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
> news:098311AB-17FF-4517-9E73-5785AC06C4CB@microsoft.com...
>
>
>

Stefan [MSFT]

2005-11-28, 7:49 am

Hi Jimmy,

I haven't used the Telerik Control for this, but I assume you need to use
the identical methods to format your output.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
news:584FEE8E-F3B9-4D65-816A-0AF5F986A322@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> I am also using Telerik for image placeholders as well and need the src
> attribute to format in my control. The HTML Placeholder does not have this
> attribute.
>
> "Stefan [MSFT]" wrote:
>


Jimmy Jazz

2005-11-28, 7:49 am

Hi Stefan,

good: string Url =
((ImagePlaceholder)(CmsHttpContext.Current.Posting.Placeholders["Image"])).Src;

that way will not work as a incrrect cast excetion is thrown as the telerik
editor is a HtmlPlaceholder and that does not have a .src attribute

Jim

"Stefan [MSFT]" wrote:

> Hi Jimmy,
>
> I haven't used the Telerik Control for this, but I assume you need to use
> the identical methods to format your output.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
> news:584FEE8E-F3B9-4D65-816A-0AF5F986A322@microsoft.com...
>
>
>

Stefan [MSFT]

2005-11-28, 7:49 am

Hi Jim,

if your placeholder object is an Html Placeholder you need to extract the
content from the Html tag.
Check the content and then extract the URL from where it is stored. Maybe
Telerik saves the link directly as an <img...> tag in the HtmlPlaceholder
object.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
news:94A45BB7-1A3B-451C-A98D-007381122C8A@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> good: string Url =
> ((ImagePlaceholder)(CmsHttpContext.Current.Posting.Placeholders["Image"])).Src;
>
> that way will not work as a incrrect cast excetion is thrown as the
> telerik
> editor is a HtmlPlaceholder and that does not have a .src attribute
>
> Jim
>
> "Stefan [MSFT]" wrote:
>


Jimmy Jazz

2005-11-28, 7:49 am

Hi Stefan,

I took the src substring from the html set theat to the ImageUrl but it did
not work any other ideas/

"Stefan [MSFT]" wrote:

> Hi Jim,
>
> if your placeholder object is an Html Placeholder you need to extract the
> content from the Html tag.
> Check the content and then extract the URL from where it is stored. Maybe
> Telerik saves the link directly as an <img...> tag in the HtmlPlaceholder
> object.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
> news:94A45BB7-1A3B-451C-A98D-007381122C8A@microsoft.com...
>
>
>

Stefan [MSFT]

2005-11-28, 7:49 am

Hi Jim,

how does the resulting Url (the string you assigned to the ImageUrl) look
like?

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
news:23E9692E-2FEC-4B60-889D-F911440BA8C9@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> I took the src substring from the html set theat to the ImageUrl but it
> did
> not work any other ideas/
>
> "Stefan [MSFT]" wrote:
>


Jimmy Jazz

2005-11-28, 7:49 am

Hi Stefan,

I got it now there was a trailing " char I never spotted.

Thanks very much,

Jim

"Stefan [MSFT]" wrote:

> Hi Jim,
>
> how does the resulting Url (the string you assigned to the ImageUrl) look
> like?
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "Jimmy Jazz" <JimmyJazz@discussions.microsoft.com> wrote in message
> news:23E9692E-2FEC-4B60-889D-F911440BA8C9@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com