How can I add dynamic content on a mojoBasePage ?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/30/2010 2:47:51 AM
Gravatar
Total Posts 6

How can I add dynamic content on a mojoBasePage ?

I have created my own feature, following the exemple of the EventCalendar feature.

So I have a feature (an ascx) with a link to a page, inheriting from mojoBasePage, including the content place holders :

<asp:Content ID="Content1" ContentPlaceHolderID="leftContent" runat="server" />
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">

Some custom controls
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightContent" runat="server" />
<asp:Content ID="Content4" ContentPlaceHolderID="pageEditContent" runat="server" />

I have created a new content and I went to the publication zone to publish it to all of my pages.

But I would like to publish it also on my custom page, but of course it does not appear in the list.

So I have added a new page to my site, pointing to the URL "~/MyCustomPage.aspx" and I published my content to that page. But nothing appear on my page (only my custom controls).

I have tried the same manipulation on the EventCalendar's EventDetail page without more success.

Is this a possible scenario ? And if yes how can I achive this ?

 

Additional and related question :

A workaround for me would to have this content defined directly on my skin master file. However, I do want to have the possibility to edit it throughout the site like a standard content. Is this possible ?

7/30/2010 10:02:57 AM
Gravatar
Total Posts 18439

Re: How can I add dynamic content on a mojoBasePage ?

The system is not really designed for your feature supporting pages to be just like CMS pages. However if you just want to show content from the left or right side of the cms page when you link to your supporting page, make sure you are passing the pageid in the link, and in your supporting page in page load or oninit you can set 2 properties on the mojoBasePage.

ShowPageLeftContent = true;
ShowPageRightContent = true;

Hope it helps,

Joe
 

8/1/2010 4:02:53 PM
Gravatar
Total Posts 6

Re: How can I add dynamic content on a mojoBasePage ?

That should be enough.

However, these properties are not available for me. Maybe I do not have the very latest version. I will check that tomorrow. In the meanwhile, I tried this :

   this.MPRightPane.Visible = true;
but it doesn't work.

I will check my version and I will keep you informed.

Thanks !

8/2/2010 9:24:32 AM
Gravatar
Total Posts 6

Re: How can I add dynamic content on a mojoBasePage ?

Hello Joe,

I have downloaded the latest version of MojoPortal (ie the version 2.3.4.8 - .NET 4.0) and I had look in the DLL mojoPortal.Web (version 1.0.3848.14031) where is defined the mojoBasePage, but I cannot find any properties looking like to ShowPageLeftContent or ShowPageRightContent.

Where is this defined ?

The only thing I have found is a setting for the blog feature.

Kind regards,

Pierre-Emmanuel

8/3/2010 7:40:27 AM
Gravatar
Total Posts 18439

Re: How can I add dynamic content on a mojoBasePage ?

Hi,

Sorry I told you the wrong thing before.

mojoBasePage has a method you can call from your inherited page page load event to show left and or right side content

LoadSideContent(true, true);

where the first param is whether to load left side content and the second is whether to load the right side content.

Hope it helps,

Joe

8/3/2010 2:28:50 PM
Gravatar
Total Posts 6

Re: How can I add dynamic content on a mojoBasePage ?

Hello Joe,

yes I had found this method when I digged bit deeper in the mojoBasePage code, but I stopped as it was not working as I was expected.

After your last message I checked it again to see why I was not getting the desired result and I think there is a bug in it. If you check at the very first line (line 762 in the v2.3.4.5 source code). I think there should be "CurrentPage" instead of "currentPage".

To workaround this, I just call "this.CurrentPage" first and then "LoadSideContent", so I get the private variable populated and it works like a charm !

Thanks for your help !

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