November Happy Hour will be moved to Thursday December 5th.

Bug? Page with same property name of contained block -- property renders in both places

Vote:
 

I have a PageType with a ContentArea property called "Content".  Within that page type, I have a FooterBlock property.  FooterBlock also contains a ContentArea property called Content.  If I drag a block in to the FooterBlock Content, the block appears in BOTH places.  The issue isn't just in the editor, as when I save, the page shows the block in both places to the public as well.

#72033
Jun 05, 2013 21:54
Vote:
 

Since both properties named content are saved to your Page in tblContentProperty and the only differences are what fkPropertyDefinitionID and ScopeName they have. And the only differences to your properties in tblPropertyDefinition would be the fkConfentType (your Pagetype Id or your Block Id). I guess that EPiServer might mix things up.

Could you verify in the database whether the content is saved on both rows in tblContentProperty or otherwise which row?

Have a look at my blog for some clues on how the property structure is stored in the database when working with blocks on pages:

http://talk.alfnilsson.se/2013/06/03/the-quest-of-findpageswithcriteria-with-a-block-property-in-episerver-7-cms/

It might give some ideas if it is the GUI reading wrong or if it is saved wrong.

Also, how do you render the Block? Using EPiServer:Property or something else?

#72044
Edited, Jun 06, 2013 13:07
Vote:
 

Unfortunately I have not managed to replicate your behaviour in all patches of EPiServer 7 unpatched, and tried with patches 1, 2 and 3.

This is my code:

    [ContentType(DisplayName = "MyBlock", GUID = "e713fa1a-52c8-49ca-9b17-3181c29ff5c3", Description = "")]
    public class MyBlock : BlockData
    {
        public virtual ContentArea Content { get; set; }
    }

And on my PageType:

public virtual MyBlock MyBlock { get; set; }

public virtual ContentArea Content { get; set; }

I'm trying to drop Blocks in MyBlock.Content as well as Content, the block is only places in that ContentArea I dropped it in.

When I try to render the different ContentAreas I try like this on the .aspx page representing a Page Template:

To render the ContentArea on the Page:

<EPiServer:Property runat="server" PropertyName="Content" />

And to render the ContentArea on the block:

<EPiServer:Property runat="server" PropertyName="MyBlock.Content" />

What does your code look like, which EPiServer version are you running? What are your values in the rows in the database table tblProperty?

#72055
Edited, Jun 06, 2013 22:32
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.