3

I have a page layout with the web part zone. The webpart zone is supposed to have 2 webparts - CSWP and Content Editor webpart.

I need to place the CSWP above the Content Editor. I need to set the ZoneIndex for the webparts so that they are aligned vertically but I am unable to do so.

I have also added Orientation="Vertical attribute in the web part zone.

The following is my code for reference:

<WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager"></WebPartPages:SPProxyWebPartManager>

    <WebPartPages:WebPartZone runat="server" title="Zone 1" ID="FirstZone" width="100%" Orientation="Vertical"><ZoneTemplate>

   <spsswc:ContentBySearchWebPart runat="server" AlwaysRenderOnServer="False" ResultType="" NumberOfItems="5" ShouldHideControlWhenEmpty="False" DataProviderJSON="{&quot;SourceID&quot;:&quot;94af56ee-2b04-4331-af03-905d39db71fb&quot;,&quot;SourceName&quot;:&quot;Service News Webpart&quot;,&quot;QueryTemplate&quot;:&quot;*&quot;,&quot;ClientType&quot;:&quot;ContentSearchRegular&quot;,&quot;QueryGroupName&quot;:&quot;Default&quot;,&quot;QueryPropertiesTemplateUrl&quot;:&quot;querygroup://webroot/_catalogs/masterpage/SFWServiceNewsInstanceLandingPage.aspx?groupname=Default&quot;,&quot;IgnoreQueryPropertiesTemplateUrl&quot;:false,&quot;SourceLevel&quot;:&quot;SPSite&quot;,&quot;CollapseSpecification&quot;:&quot;&quot;,&quot;FallbackSort&quot;:[{&quot;p&quot;:&quot;RefinableDate00&quot;,&quot;d&quot;:1}],&quot;FallbackSortJson&quot;:&quot;[{\&quot;p\&quot;:\&quot;RefinableDate00\&quot;,\&quot;d\&quot;:1}]&quot;,&quot;RankRules&quot;:null,&quot;RankRulesJson&quot;:&quot;null&quot;,&quot;AsynchronousResultRetrieval&quot;:false,&quot;SendContentBeforeQuery&quot;:true,&quot;BatchClientQuery&quot;:true,&quot;FallbackLanguage&quot;:-1,&quot;FallbackRankingModelID&quot;:&quot;&quot;,&quot;EnableStemming&quot;:true,&quot;EnablePhonetic&quot;:false,&quot;EnableNicknames&quot;:false,&quot;EnableInterleaving&quot;:false,&quot;EnableQueryRules&quot;:true,&quot;EnableOrderingHitHighlightedProperty&quot;:false,&quot;HitHighlightedMultivaluePropertyLimit&quot;:-1,&quot;IgnoreContextualScope&quot;:true,&quot;ScopeResultsToCurrentSite&quot;:false,&quot;TrimDuplicates&quot;:false,&quot;Properties&quot;:{&quot;TryCache&quot;:true,&quot;Scope&quot;:&quot;{Site.URL}&quot;,&quot;UpdateLinksForCatalogItems&quot;:true,&quot;EnableStacking&quot;:true,&quot;ListId&quot;:&quot;00000000-0000-0000-0000-000000000000&quot;},&quot;PropertiesJson&quot;:&quot;{\&quot;TryCache\&quot;:true,\&quot;Scope\&quot;:\&quot;{Site.URL}\&quot;,\&quot;UpdateLinksForCatalogItems\&quot;:true,\&quot;EnableStacking\&quot;:true,\&quot;ListId\&quot;:\&quot;00000000-0000-0000-0000-000000000000\&quot;}&quot;,&quot;UpdateAjaxNavigate&quot;:true,&quot;SummaryLength&quot;:180,&quot;DesiredSnippetLength&quot;:90,&quot;PersonalizedQuery&quot;:false,&quot;FallbackRefinementFilters&quot;:null,&quot;IgnoreStaleServerQuery&quot;:false,&quot;RenderTemplateId&quot;:&quot;DefaultDataProvider&quot;,&quot;AlternateErrorMessage&quot;:null,&quot;Title&quot;:&quot;&quot;}" BypassResultTypes="True" ItemTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/SFW_ServiceNewsWP_Content_Item.js" GroupTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Group_Content.js" ResultsPerPage="5" SelectedPropertiesJson="[&quot;Title&quot;,&quot;Path&quot;,&quot;Description&quot;,&quot;EditorOWSUSER&quot;,&quot;LastModifiedTime&quot;,&quot;CollapsingStatus&quot;,&quot;DocId&quot;,&quot;HitHighlightedSummary&quot;,&quot;HitHighlightedProperties&quot;,&quot;FileExtension&quot;,&quot;ViewsLifeTime&quot;,&quot;ParentLink&quot;,&quot;FileType&quot;,&quot;IsContainer&quot;,&quot;SecondaryFileExtension&quot;,&quot;DisplayAuthor&quot;,&quot;NewsPageSummary&quot;,&quot;NewsPageRollupImage&quot;,&quot;NewsArticlePageDate&quot;,&quot;NewsPageImage&quot;]" HitHighlightedPropertiesJson="[&quot;Title&quot;,&quot;Path&quot;,&quot;Author&quot;,&quot;SectionNames&quot;,&quot;SiteDescription&quot;]" AvailableSortsJson="null" ShowBestBets="False" ShowPersonalFavorites="False" ShowDefinitions="False" ShowDidYouMean="False" PreloadedItemTemplateIdsJson="null" QueryGroupName="Default" RenderTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/SFW_ServiceNewsWP_Content_List.js" StatesJson="{}" ServerIncludeScriptsJson="null" Title="Content Search" FrameType="None" SuppressWebPartChrome="False" Description="" IsIncluded="True" ZoneID="FirstZone" PartOrder="2" FrameState="Normal" AllowRemove="True" AllowZoneChange="True" AllowMinimize="True" AllowConnect="True" AllowEdit="True" AllowHide="True" IsVisible="True" DetailLink="" HelpLink="" HelpMode="Modeless" Dir="Default" PartImageSmall="" MissingAssembly="Cannot import this Web Part." PartImageLarge="" IsIncludedFilter="" ExportControlledProperties="True" ConnectionID="00000000-0000-0000-0000-000000000000" ID="g_9576a00b_b01a_4206_b236_d36e7d1ccc20" ChromeType="None" ExportMode="All" __MarkupType="vsattributemarkup" __WebPartId="{9576A00B-B01A-4206-B236-D36E7D1CCC20}" WebPart="true" Height="" Width=""></spsswc:ContentBySearchWebPart>

   <WebPartPages:ContentEditorWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{12518184-ED0D-4012-BD2B-20155B25C3BD}" >
   <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
   <Title>View More Link</Title>
   <FrameType>None</FrameType>
   <Description />
   <IsIncluded>true</IsIncluded>
   <PartOrder>4</PartOrder>
   <FrameState>Normal</FrameState>
   <Height />
   <Width />
   <AllowRemove>true</AllowRemove>
   <AllowZoneChange>true</AllowZoneChange>
   <AllowMinimize>true</AllowMinimize>
   <AllowConnect>true</AllowConnect>
   <AllowEdit>true</AllowEdit>
   <AllowHide>true</AllowHide>
   <IsVisible>true</IsVisible>
   <DetailLink />
   <HelpLink />
   <HelpMode>Modeless</HelpMode>
   <Dir>Default</Dir>
   <PartImageSmall />
   <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
   <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
   <IsIncludedFilter />
   <ExportControlledProperties>true</ExportControlledProperties>
   <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
   <ID>g_e3854598-cb85-4646-bb74-888577036873</ID>
   <ContentLink  xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
   <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><!          [CDATA[<div id="dvViewMore"></div>]]></Content>
  <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"   />
  </WebPart>
  </WebPartPages:ContentEditorWebPart>
  </ZoneTemplate></WebPartPages:WebPartZone>

Please do the needful.

Your Answer

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

Browse other questions tagged or ask your own question.