|
Home > Archive > Microsoft Content Management Server > October 2004 > Placeholder content deleted when creating connected page
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 content deleted when creating connected page
|
|
| Oscar Hallberg 2004-10-28, 7:48 am |
| Hi!
I have some strange problems with connected pages, that I haven't seen
before. If anyone could help that would be great!
Description of the problem:
----------------------------
I have two templates that are connected, let's call them Template_A
and Template_B.
If I browse to a posting of Template_A and create a connected page in
another channel, then I am asked to choose which one of Template_A and
Template_B I want to use for my new, connected posting. If I choose
Template_A in this case (in other words, the same template as the
"original" posing), then one of the placeholders is empty when I am
redirected to the edit page.
If I do the same thing, but instead of Template_A choose Template_B
for my new, connected posting, then the same placeholder will be
filled with strange charachters (something like "=%&"#"...you know
what I mean).
Anyone have a clue??
| |
| Angus Logan [MVP] 2004-10-28, 7:48 am |
| Hi Oscar,
Are you doing anything tricky in your code like showing/hiding the
placeholder(s) depending on the template?
Regards
--
________________________________________
Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Oscar Hallberg" <oscar.hallberg@ehandel.sigma.se> wrote in message
news:d32ffb3f.0410280344.7d262ce6@posting.google.com...
> Hi!
>
> I have some strange problems with connected pages, that I haven't seen
> before. If anyone could help that would be great!
>
> Description of the problem:
> ----------------------------
>
> I have two templates that are connected, let's call them Template_A
> and Template_B.
>
> If I browse to a posting of Template_A and create a connected page in
> another channel, then I am asked to choose which one of Template_A and
> Template_B I want to use for my new, connected posting. If I choose
> Template_A in this case (in other words, the same template as the
> "original" posing), then one of the placeholders is empty when I am
> redirected to the edit page.
>
> If I do the same thing, but instead of Template_A choose Template_B
> for my new, connected posting, then the same placeholder will be
> filled with strange charachters (something like "=%&"#"...you know
> what I mean).
>
> Anyone have a clue??
| |
| Stefan [MSFT] 2004-10-28, 7:48 am |
| Hi Oscar,
this can happen with badly written custom placeholder controls or badly
written workflow events.
Usually default content should only be deployed in
OnPopulatingDefaultContent which will only fire when the original posting is
created.
If content is updated in the CmsPosting_Creating/Created event handler or in
CreateAuthoringChildControls or LoadPlaceholderContentForAuthoring then this
will happen.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Oscar Hallberg" <oscar.hallberg@ehandel.sigma.se> wrote in message
news:d32ffb3f.0410280344.7d262ce6@posting.google.com...
> Hi!
>
> I have some strange problems with connected pages, that I haven't seen
> before. If anyone could help that would be great!
>
> Description of the problem:
> ----------------------------
>
> I have two templates that are connected, let's call them Template_A
> and Template_B.
>
> If I browse to a posting of Template_A and create a connected page in
> another channel, then I am asked to choose which one of Template_A and
> Template_B I want to use for my new, connected posting. If I choose
> Template_A in this case (in other words, the same template as the
> "original" posing), then one of the placeholders is empty when I am
> redirected to the edit page.
>
> If I do the same thing, but instead of Template_A choose Template_B
> for my new, connected posting, then the same placeholder will be
> filled with strange charachters (something like "=%&"#"...you know
> what I mean).
>
> Anyone have a clue??
| |
| Oscar Hallberg 2004-10-29, 5:50 pm |
| Well, actually we are using your AllTagsHtmlPlaceholderControl. Maybe
I am using an old version or maybe something was "forgotten" when
translating it to VB...
| |
| Stefan [MSFT] 2004-10-29, 5:50 pm |
| Here is the latest version:
///
/// This source code is freeware and is provided on an "as is" basis
without warranties of any kind,
/// whether express or implied, including without limitation warranties
that the code is free of defect,
/// fit for a particular purpose or non-infringing. The entire risk as to
the quality and performance of
/// the code is with the end user.
///
using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Microsoft.ContentManagement.Publishing;
using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
using Microsoft.ContentManagement.WebControls.Design;
using Microsoft.ContentManagement.WebControls;
namespace Stefan.PlaceholderControls
{
/// <summary>
/// Summary description for AllTagsHtmlPlaceholderControl.
/// </summary>
[
ToolboxData("<{0}:AllTagsHtmlPlaceholderControl
runat=server></{0}:AllTagsHtmlPlaceholderControl>"),
SupportedPlaceholderDefinitionType(typeo
f(HtmlPlaceholderDefinition))
]
public class AllTagsHtmlPlaceholderControl : HtmlPlaceholderControl
{
public AllTagsHtmlPlaceholderControl()
{
//
// TODO: Add constructor logic here
//
}
private string UnEscape(string input)
{
return input.Replace("~LT~","<").Replace("~GT~",">");
}
private string Escape(string input)
{
return input.Replace("<","~LT~").Replace(">","~GT~");
}
protected override void
LoadPlaceholderContentForAuthoring(Place
holderControlEventArgs e)
{
EnsureChildControls();
if (WebAuthorContext.Current.Mode ==
WebAuthorContextMode.AuthoringReedit)
base.Html = UnEscape(((HtmlPlaceholder)(base.BoundPlaceholder)).Html);
else
base.LoadPlaceholderContentForAuthoring(e);
}
protected override void
LoadPlaceholderContentForPresentation(Pl
aceholderControlEventArgs e)
{
EnsureChildControls();
base.Html = UnEscape(((HtmlPlaceholder)(base.BoundPlaceholder)).Html);
}
protected override void
SavePlaceholderContent(PlaceholderContro
lSaveEventArgs e)
{
EnsureChildControls();
((HtmlPlaceholder)(base.BoundPlaceholder)).Html = Escape(base.Html);
}
}
}
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Oscar Hallberg" <oscar.hallberg@ehandel.sigma.se> wrote in message
news:d32ffb3f.0410290520.35c5d851@posting.google.com...
> Well, actually we are using your AllTagsHtmlPlaceholderControl. Maybe
> I am using an old version or maybe something was "forgotten" when
> translating it to VB...
| |
| Stefan [MSFT] 2004-10-29, 5:50 pm |
| Hi Oscar,
I have just tested the control below and the content is not lost using this
code.
If you still experience the problem, please test check your workflow events.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eZ4MhtbvEHA.1564@TK2MSFTNGP09.phx.gbl...
> Here is the latest version:
>
> ///
> /// This source code is freeware and is provided on an "as is" basis
> without warranties of any kind,
> /// whether express or implied, including without limitation warranties
> that the code is free of defect,
> /// fit for a particular purpose or non-infringing. The entire risk as
to
> the quality and performance of
> /// the code is with the end user.
> ///
>
> using System;
> using System.IO;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.ComponentModel;
> using Microsoft.ContentManagement.Publishing;
> using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
> using Microsoft.ContentManagement.WebControls.Design;
> using Microsoft.ContentManagement.WebControls;
>
> namespace Stefan.PlaceholderControls
> {
> /// <summary>
> /// Summary description for AllTagsHtmlPlaceholderControl.
> /// </summary>
> [
> ToolboxData("<{0}:AllTagsHtmlPlaceholderControl
> runat=server></{0}:AllTagsHtmlPlaceholderControl>"),
> SupportedPlaceholderDefinitionType(typeo
f(HtmlPlaceholderDefinition))
> ]
> public class AllTagsHtmlPlaceholderControl : HtmlPlaceholderControl
> {
> public AllTagsHtmlPlaceholderControl()
> {
> //
> // TODO: Add constructor logic here
> //
> }
>
> private string UnEscape(string input)
> {
> return input.Replace("~LT~","<").Replace("~GT~",">");
> }
>
> private string Escape(string input)
> {
> return input.Replace("<","~LT~").Replace(">","~GT~");
> }
>
> protected override void
> LoadPlaceholderContentForAuthoring(Place
holderControlEventArgs e)
> {
> EnsureChildControls();
> if (WebAuthorContext.Current.Mode ==
> WebAuthorContextMode.AuthoringReedit)
> base.Html = UnEscape(((HtmlPlaceholder)(base.BoundPlaceholder)).Html);
> else
> base.LoadPlaceholderContentForAuthoring(e);
> }
>
> protected override void
> LoadPlaceholderContentForPresentation(Pl
aceholderControlEventArgs e)
> {
> EnsureChildControls();
> base.Html = UnEscape(((HtmlPlaceholder)(base.BoundPlaceholder)).Html);
> }
>
> protected override void
> SavePlaceholderContent(PlaceholderContro
lSaveEventArgs e)
> {
> EnsureChildControls();
> ((HtmlPlaceholder)(base.BoundPlaceholder)).Html = Escape(base.Html);
> }
>
> }
> }
>
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> MCMS FAQ:
>
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
>
http://www.gotdotnet.com/community/...t+S
erver
> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Oscar Hallberg" <oscar.hallberg@ehandel.sigma.se> wrote in message
> news:d32ffb3f.0410290520.35c5d851@posting.google.com...
>
>
|
|
|
|
|