Initial Site Conent

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/28/2009 12:22:45 PM
Gravatar
Total Posts 16

Initial Site Conent

 I am trying to use the initial content feature to generate some content.  However, even though I am specifying a parent GUID, the pages do not get associated with the specified parents.

 

Here is a sample of my initial content config xml:

<?xml version="1.0" encoding="utf-8" ?>
<siteContent>
<pages>
<page
pageGuid="29a0e2d7-0592-4988-99a5-e782ad6aecf1"
resourceFile="Resource"
name="Home Page"
title=""
url="~/home.aspx"
menuImage="home.gif"
parentGuid="00000000-0000-0000-0000-000000000000"
pageOrder="1"
requireSSL="false"
visibleToRoles="All Users;"
editRoles="Content Administrators;"
createChildPageRoles="Content Publishers;"
pageMetaKeyWords=""
pageMetaDescription=""
>
<contentFeature
featureGuid="177a7371-282c-415a-ac28-28a01f726630"
contentTitle="Home Page"
contentTemplate="Home.config"
location="center"
sortOrder="1"
cacheTimeInSeconds="360"/>

</page>

<page
pageGuid="b1ffb7bc-cb43-421b-900d-23f96e0e4b97"
resourceFile="Resource"
name="page1"
title=""
url="~/page1.aspx"
menuImage="home.gif"
parentGuid="29a0e2d7-0592-4988-99a5-e782ad6aecf1"
pageOrder="1"
requireSSL="false"
visibleToRoles="All Users;"
editRoles="Content Administrators;"
createChildPageRoles="Content Publishers;"
pageMetaKeyWords=""
pageMetaDescription=""
>
<contentFeature
featureGuid="fc4b7d5a-0ca2-4f88-a064-478cd6c47431"
contentTitle="About"
contentTemplate="About.config"
location="center"
sortOrder="1"
cacheTimeInSeconds="360"/>
<contentFeature
featureGuid="7e152402-e4bd-415e-b97c-ac076eb08037"
contentTitle="History"
contentTemplate="History.config"
location="center"
sortOrder="2"
cacheTimeInSeconds="360"/>

</page>

</pages>
</siteContent>

 

I am looking at the source code (just updated to the latest version) and I see where the page guid is re-generated instead of using what is provided in the xml.  

[mojoSetup.cs, line 576

foreach (ContentPage contentPage in appPageConfig.ContentPages)
{

//if (!PageSettings.Exists(contentPage.PageGuid))
//{
PageSettings pageSettings = new PageSettings();
//pageSettings.PageGuid = contentPage.PageGuid;
pageSettings.PageGuid = Guid.NewGuid();
pageSettings.SiteId = siteSettings.SiteId;
pageSettings.SiteGuid = siteSettings.SiteGuid;

.......

 

 

 

 

Why did this change? Was there a limitation that was found?  Do you plan on fixing this?  I would be willing to help if I know what the background on this feature was.

Thanks,

David

 

 

5/28/2009 12:39:36 PM
Gravatar
Total Posts 18439

Re: Initial Site Conent

Hi David,

You are right there is a bug there. I think this is an issue where I ran into a problem and came up with a cheap solution and got side tracked and forgot about coming back to it to make a better solution.

The issue as I recall is that in using the multi sites feature, these same content templates are used when creating default content for child sites. So we get a clash because the pageguid is already in use in the first site and can't be used again in child sites. 

I will change the logic to only generate a new page guid if there is already an exsiting page with the same guid. I will add logic to check if the parentGuid is a page in the current site or not.

It still will not be a perfect solution because it will really only work correctly in the first site in terms of hooking up the parent page. 

Best,

Joe

5/28/2009 12:56:46 PM
Gravatar
Total Posts 18439

Re: Initial Site Conent

I just fixed this so it will work correctly hooking up parent pages at least in the initial site. Its fixed in svn trunk now.

Best,

Joe

5/28/2009 12:59:06 PM
Gravatar
Total Posts 16

Re: Initial Site Conent

 Great,

 

Thank you for the fast response.

You must sign in to post in the forums. This thread is closed to new posts.