4

I am currently doing some research into SharePoint Page Layouts and building pages based on those layouts.

I currently have a page layout containing several RichImageFields and RichHtmlFields, but it seems that the first RichImageField is not displaying (doesn't even render out anything). As far as I can see, he's the same as the others:

    <div id="headerImage">
        <PublishingWebControls:RichImageField id="HeaderImage" FieldName="HeaderImage1" runat="server"/>
    </div>
    <div id="middleContent">
        <div id="left">
            <div id="about">
                <fieldset>
                    <legend>About</legend>
                    <PublishingWebControls:RichHtmlField ID="About" FieldName="AboutMedicInfo1" runat="server"/>
                </fieldset>
            </div>
            <div id="items">
                <h1>
                <SharePointWebControls:FieldValue FieldName="ItemsTitle1" runat="server"/></h1>
                <PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
                    <SharePointWebControls:TextField runat="server" FieldName="ItemsTitle1" />
                </PublishingWebControls:EditModePanel>
                <div id="Item1">
                    <fieldset>
                        <legend>
                        <SharePointWebControls:FieldValue FieldName="Item11" runat="server"/></legend>
                        <PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
                            <SharePointWebControls:TextField runat="server" FieldName="Item11" />
                        </PublishingWebControls:EditModePanel>
                        <PublishingWebControls:RichHtmlField ID="Item1" FieldName="Item1Content1" runat="server"/>
                    </fieldset>
                </div>
                <div id="Item2">
                    <fieldset>
                        <legend>
                        <SharePointWebControls:FieldValue FieldName="Item21" runat="server"/></legend>
                        <PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
                            <SharePointWebControls:TextField runat="server" FieldName="Item21" />
                        </PublishingWebControls:EditModePanel>
                        <PublishingWebControls:RichHtmlField ID="Item2" FieldName="Item2Content1" runat="server"/>
                    </fieldset>
                </div>
            </div>
        </div>
        <div id="center">
            <div>
                <PublishingWebControls:RichImageField id="HighLight1" FieldName="HighLight11" runat="server"/></div>
            <div>
                <PublishingWebControls:RichImageField id="HighLight2" FieldName="HighLight22" runat="server"/></div>
            <div>
                <PublishingWebControls:RichImageField id="HighLight3" FieldName="HighLight32" runat="server"/></div>
        </div>
        <div id="right">
            <div id="report">
                <PublishingWebControls:RichHtmlField ID="Report" FieldName="Report" runat="server"/>
            </div>
            <div id="webparts">
                <WebPartPages:WebPartZone runat="server" Title="Rechtsonder" ID="BottomRightControl"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone></div>
        </div>
    </div>
</div>

The funny thing is that I'm perfectly able to see the image when I'm in editing mode and when I'm viewing the Page Library items (after I added the specified field to the view).

Does anyone have any experience with this? Feel free to ask further questions if I might be unclear.

Kevin DB
  • 41
  • 1
  • 3

2 Answers2

4

Okay, I should have checked before posting my initial question. It turned out that my problem was because I was using the Page content type, instead of the Article Page or Welcome Page content types. The Page CT doesn't have the field that the image was looking for.

What I find really interesting is that it still let me select the image AND it stored the value somewhere... even though there was no official field for it. I suspect that the field in the library is there, since you would need it for your other content types.

Anyway, hoping that someone else may find this useful.

Matt
  • 41
  • 2
0

Make sure that you don't miss the two properties RichText="TRUE" and RichTextMode="FullHtml" of the image field definition to be like:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
     ID="{4ea31e74-f59d-4ddf-863c-607a01735f65}"
     Name="pls_H2_2_Image"
     DisplayName="Titel 2 Bild"
     Type="Image"
     Required="FALSE"
     RichText="TRUE"
     RichTextMode="FullHtml"
     Group="Custom">
  </Field>
</Elements>

I faced this issue before and this solution did it properly.