content templates

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
6/19/2013 8:23:41 AM
Gravatar
Total Posts 29
Thomas N. TALESIS SARL Conseil / Expertise en développement DOTNET

content templates

I made some code to create pages based on the content templating mecanism (implemented for setting up initial content of new sites).

it works very well, but I have the following issues that I would like to share:

1. I need the method mojoSetup.CreatePage to be public. Is this possible ? 

2. After the calls to the CreatePage, we need some cache invalidation. 

I've tried all of the following:

                CacheHelper.ResetSiteMapCache(siteSettings.SiteId); // seems the most evident
                //CacheHelper.ClearSiteSettingsCache(siteSettings.SiteId);
                //CacheHelper.ResetThemeCache();

but it does not work. or it work with a time delay. ( I mean I create page ONE, I see nothing, I create page TWO, i see page ONE but not yet page TWO, and so on...!)

can you please advice about this issue ?

3. I suggest we add the ability to specify a moduleGuid in the template file, so modules instances may be shared between pages.

Don't you agree? I can do it and send it to you.

4. I couldn't find a way to specify some secific (but generic) moduleSettings attributes, without writing specific code. We could have a  dedicated attribute or XML node under the contentFeature tag to do this. Would it be possible also. And can I help ?

Best regards, 

Thomas

 

6/20/2013 12:04:20 PM
Gravatar
Total Posts 18439

Re: content templates

Hi Thomas,

It has been requested in the past and it is a planned feature to be able to create pages from templates. If you would like to work on that it would be fine with me since it isn't something I can get to soon. Please contact me privately and maybe we can schedule a skype to talk about it.

I would think most of the classes we use for the initial content could be re-used but I think for this purpose templates should be in a different site specific location beneath /Data/Sites/[SiteID]/contentconfig/

So a different config class to load the files into objects from there, just copy paste modify the one for initial content, a way for the user to browse and select a template, etc.

Ideally there should also be a UI for somehow creating templates that can generate the xml file and save it to disk, but maybe it does not need to be done right away but we should definitely improve the documentation for the file format as time permits and options are added.

I think it should be possible also to apply a template to an empty page that has already been created, so page creation and adding modules should be in 2 logical steps. Really page templates like we use in initial content cannot work the same way if a user is to choose a template to create a page it cannot keep creating new pages with the same url defined in the xml. During setup we know there are no conflicting pages. Maybe page creation should stay as it is in the UI but integrate into the existing Admin/Controls/PageContentWizard.ascx which is shown to editors on an empty page after initial page creation. Currently it has a list of features to create a new instance but we could also show a "Add Content From Template" option there.

1 . Sure

2. The one we use in PageSettings.aspx should work: 

CacheHelper.ResetSiteMapCache();

3. We can talk about that if you want to implement a away to configure global instances from templates.

4. I think we already have this, here is an example xml file for one of the content instances on our demo site that shows use of ModuleSettings

<?xml version="1.0" encoding="utf-8" ?>
<feeds>
    <feed 
        feedName="mojoPortal"
        sortRank="500"
        feedUrl="http://www.mojoportal.com/blog19rss.aspx"
        webUrl="http://www.mojoportal.com/"
        />
    <moduleSetting settingKey="UseScrollerSetting" settingValue="true" />
    <moduleSetting settingKey="RSSFeedAllowExternalImages" settingValue="true" />
        
    
</feeds>

Best,

Joe

6/20/2013 5:44:12 PM
Gravatar
Total Posts 29
Thomas N. TALESIS SARL Conseil / Expertise en développement DOTNET

Re: content templates

Hello Joe, 

1. ok thanks I can rely on it.

2. I had already tried the CacheHelper.ResetSiteMapCache(); with the problems I've described... and I've finaly found that adding : 
            HttpContext.Current.Items["MenuPages"] = null;
did the job I wanted.... I don't know why... ( I may come back on this later...)

3. yes that's exactly what I want. For the moment, I planned to generate the 1 page where the feature is instaciated, then request the pageSettings just created, and then request the Modules, and then request/select the rigth feature, and then take its ModuleGuid, and then  publish it on the Other page….  

Such a work requires lots of codes and looses some facilities linked to external templates because the code is too much coupled with the templates contents.

So yes, my question/intention was to defined some predefined Guid for the feature instances inside the template.

Actually templates I use are generated on the fly, (some identifiers are replaced by values, roles, parameters, etc.. ).. this is powerfull and easy to maintain..!) If we combined well all this ... it can be nice.

I contact you directly for planning something (waiting a schedule info before). 

4. YES! it seems it is what I want, Good news...(even if I've lost time to code something that worked)

that will save me time for the needs I have.

 

Thank for all your answers; 

Best, 

Thomas.

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