1

I have created a custom pagelayout. Inside this pagelayout I have a imagefield. Is it possible to set a fixed width and height?

<PublishingWebControls:EditModePanel ID="EditModePanel4" runat="server" PageDisplayMode="Display">
                    <div class="article-content">
                        <div class="newsArticleImage" style="float:right;padding:5px;">
                            <PublishingWebControls:RichImageField ID="newsArticleImage" runat="server" FieldName="PublishingRollupImage" />
                        </div>
                        <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" runat="server"/>
                    </div>
                </PublishingWebControls:EditModePanel>
2

Add rendition id (id value is visible on http://SITE/_layouts/15/ImageRenditionSettings.aspx) RenditionId="1" to RichImageField

<PublishingWebControls:RichImageField ID="newsArticleImage" runat="server" FieldName="PublishingRollupImage" RenditionId="1"/>

OR

add display width and display height to RichImageField

DisplayWidth="500" and DisplayHeight="500" (500 is 500px just for example)

<PublishingWebControls:RichImageField ID="newsArticleImage" runat="server" FieldName="PublishingRollupImage" DisplayWidth="500" DisplayHeight="500"/>

More on msdn

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.publishing.webcontrols.richimagefield.displaywidth.aspx

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.publishing.webcontrols.richimagefield.displayheight.aspx

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.publishing.webcontrols.richimagefield_members.aspx

|improve this answer|||||
  • DisplayWidth="500" and DisplayHeight="500" works – Ola Sep 7 '15 at 6:52
0
 .yourClass {
    width:100px;
    height:100px;
 }

I recall from some years ago CssClass="yourClass" on the RichImageField had some issues.

You can also target the IMG with a CSS selector

 .newsArticleImage > IMG {
    width:100px;
    height:100px;
 }

Note that your (not-required) ID="newsArticleImage" gives all the Images the same ID

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.