Behaves as Page (menu item) type - PageTemplate with Transformation blank

J Shaw asked on October 16, 2015 23:00

Hi, this is probably a stupid question, but I have a PageType for News items that has a Page Template with a CMSRepeater and a transformation to display the data. They work great until I check the advanced setting "Behaves as Page (menu item) type." I want to check this option so that the new items show in my sitemap and also so I can use the Head element to pass open graph tags.

If I leave "Behaves as Page (menu item) type" unchecked, my page works but the head element does not pass through the og tags and the page does not display in my sitemap.

If I check "Behaves as Page (menu item) type," then my og tags pass work and the page shows in my sitemap, BUT the page is blank.

Thanks,

John

<!-- PageTemplate (ASPX) -->
<div class="main">
    <article class="news-story">
        <div class="container">
          <cms:CMSRepeater ID="rptNews" runat="server"
                Path="./%" 
                OrderBy="NodeLevel, NodeOrder, NodeName"
                ClassNames="MySite.News"
                SelectedItemTransformationName="MySite.News.Detail"
                RelationshipWithNodeGuid="00000000-0000-0000-0000-000000000000" 
                RelationshipName="isrelatedto" 
                CacheDependencies="##DEFAULT##" 
                ShowEditButton="Ffalse" 
                ShowDeleteButton="False" >
            </cms:CMSRepeater>
        </div>
    </article>
</div>

<!-- End Page Template -->

<!-- Transformation -->

<h2><%# Eval("NewsTitle") %></h2> 
<div class="details-wrapper">
    <div class="pub-date">
      Originally Published: <%# DateTime.Parse(Eval("NewsReleaseDate").ToString()).ToShortDateString() %><br />
    </div>
</div>
<%# Eval("NewsText") %>

<!-- End Transformation -->

Correct Answer

Brenden Kehren answered on October 16, 2015 23:13

Have you read what that property is for?

Secondly, you can create OG Tags by using a HEAD HTML webpart and dynamically setting the properties, I do it all the time and it works flawlessly. There's an awesome post by Joel Dahlin about it.

I'm also compelled to ask, any particular reason you're using ASPX mode?

0 votesVote for this answer Unmark Correct answer

Recent Answers


J Shaw answered on October 20, 2015 22:45

Thanks @Brenden, appreciate the help.

I had previously read that linked page but was not sure why the head element and add page to sitemap would not work without selecting "Behave as Page". I can think of plenty of places you would want a custom page type without needing to write custom code to add to the sitemap or use the head element.

As for using ASPX mode, I am doing a rush project and using a mixture of ASPX and Portal allowed me to develop as quickly as possible. Once the site launches, I plan on refactoring pages using the Portal template as it sounds like that is the Kentico preferred method. Personally I prefer the quickness of using Visual Studio and I am not very fond of the design tab, but it sounds like using the Portal mode give you more functionality in the long run.

Thanks again for your help.

John

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.