custom feature setting link

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.
8/3/2012 3:55:50 PM
Gravatar
Total Posts 199

custom feature setting link

after working with the documentation I developed a custom feature that is very basic.

everything works great and I can add it to the page but I cannot get the settings link to display next to the title. 

The feature does have settings and I can only access them from the edit page then go setting from there.

do I have to create a setting link manually inside the page and if so is there documentation on that because I can not find it??

Thanks

8/7/2012 10:18:25 AM
Gravatar
Total Posts 18439

Re: custom feature setting link

Does your feature have the ModuleTitleControl in it?

<portal:ModuleTitleControl ID="Title1" runat="server" />

It should create the setting link for you if the user has edit permission and isn't in a role that not allowed to view feature instance settings

Hope that helps,

Joe

8/7/2012 3:40:23 PM
Gravatar
Total Posts 199

Re: custom feature setting link

Joe thank your for your response, still having trouble.

I am using the ASP.net development server and have not tested on IIS yet.

I did update the beginning of the code to be as follows (see below) and then I rebuilt my custom project then rebuilt the entire solution all and ran it.  no settings link appeared when logged in as admin.

After the change I am thinking I have something cached because the title looks like it is hard coded with the text "Your Title".

 

 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FormWithSettings.ascx.cs" Inherits="digital.Web.UI.FormSettings.FormWithSettings" %>

<portal:OuterWrapperPanel ID="pnlOuterWrap" runat="server">
<mp:CornerRounderTop id="ctop1" runat="server" />
<portal:InnerWrapperPanel ID="pnlInnerWrap" runat="server" CssClass="panelwrapper mymodule">

<asp:UpdatePanel ID="upGallery" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<portal:ModuleTitleControl ID="Title1" runat="server" />
<portal:OuterBodyPanel ID="pnlOuterBody" runat="server">
<portal:InnerBodyPanel ID="pnlInnerBody" runat="server" CssClass="modulecontent">

 

8/9/2012 11:19:22 AM
Gravatar
Total Posts 18439

Re: custom feature setting link

I would not wrap the standard panels nor the ModuleTitle inside updatepanel, I would put updatepanel as an innermost panel inside InnerBodyPanel.

Also make sure your code behind class is inheriting from SiteModuleControl rather thsan UserControl

Hope that helps,

Joe

8/9/2012 4:02:11 PM
Gravatar
Total Posts 199

Re: custom feature setting link

ok - I really appreciate you sticking with me on this but I seem to still be missing something.

I moved the update panel inside the InnerBodyPanel and made sure I am inheriting from SiteModuleControl as it was already.  Rebuilt everything and it runs fine just no setting links.  It renders the title with the text "YOUR TITLE" and I can not find out where it is getting that from.

Is there an CODE BEHIND example on the site somewhere so I can see if that will run?

 

-----------------------------------------------------------------------------

My code behind as follows:

---------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Globalization;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using mojoPortal.Web;
using mojoPortal.Web.Framework;
using mojoPortal.Web.UI;
using Resources;

namespace digital.Web.UI.FormSettings
{
public partial class FormWithSettings : SiteModuleControl
{

private string setting1 = string.Empty;
private string setting2 = string.Empty;

protected void Page_Load(object sender, EventArgs e)
{

LoadSettings();
PopulateLabels();

if (!Page.IsPostBack)
{
PopulateControls();
}

}

protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = "Hello Web I'm a plain old UserControl ";
}

protected void chkAutoPostBackTest_CheckedChanged(object sender, EventArgs e)
{
lblCheckboxResult.Text = "You posted back.";
}

protected void ddColors_SelectedIndexChanged(object sender, EventArgs e)
{
lblDropDownResult.Text = ddColors.SelectedValue;
}

private void PopulateControls()
{
TextBox1.Text = "Click the button";

}

private void PopulateLabels()
{

//if (setting1.Length > 0) { lblText1.Text = setting1; }
//if (setting2.Length > 0) { lblText2.Text = setting2; }
}

private void LoadSettings()
{

if (this.ModuleConfiguration != null)
{
this.Title = this.ModuleConfiguration.ModuleTitle;
this.Description = this.ModuleConfiguration.FeatureName;
}

if (Settings.Contains("setting1"))
{
setting1 = Settings["setting1"].ToString();
}

if (Settings.Contains("setting2"))
{
setting2 = Settings["setting2"].ToString();
}

}
}
}

--------------------------------------------------------------

my page as follows

------------------------------------------------------------------

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FormWithSettings.ascx.cs" Inherits="digital.Web.UI.FormSettings.FormWithSettings" %>

<portal:OuterWrapperPanel ID="OuterWrapperPanel1" runat="server">
<mp:CornerRounderTop id="CornerRounderTop1" runat="server" />
<portal:InnerWrapperPanel ID="InnerWrapperPanel1" runat="server" CssClass="panelwrapper mymodule">

<ContentTemplate>
<portal:ModuleTitleControl id="ModuleTitleControl1" runat="server" />
<portal:OuterBodyPanel ID="OuterBodyPanel1" runat="server">
<portal:InnerBodyPanel ID="InnerBodyPanel1" runat="server" CssClass="modulecontent">

<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">

<div class="settingrow">
<asp:CheckBox ID="chkAutoPostBackTest" runat="server" Text="Auto Postback" AutoPostBack="true"

OnCheckedChanged="chkAutoPostBackTest_CheckedChanged"  />

<asp:Label ID="lblCheckboxResult" runat="server" />
</div>

<div class="settingrow">
AutoPostBack Dropdown
<asp:DropDownList ID="ddColors" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddColors_SelectedIndexChanged">
<asp:ListItem Text="Blue" Value="Blue"></asp:ListItem>
<asp:ListItem Text="Green" Value="Green"></asp:ListItem>
<asp:ListItem Text="Red" Value="Red"></asp:ListItem>
<asp:ListItem Text="Yellow" Value="Yellow"></asp:ListItem>
</asp:DropDownList>
<asp:Label ID="lblDropDownResult" runat="server" />
</div>

<div class="settingrow">
<asp:TextBox ID="TextBox1" runat="server" CssClass="widetextbox"></asp:TextBox>
<portal:mojoButton ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>

</asp:UpdatePanel>

</portal:InnerBodyPanel>
</portal:OuterBodyPanel>
</ContentTemplate>

<portal:EmptyPanel id="EmptyPanel1" runat="server" CssClass="cleared" SkinID="cleared"></portal:EmptyPanel>
</portal:InnerWrapperPanel>
<mp:CornerRounderBottom id="CornerRounderBottom1" runat="server" />
</portal:OuterWrapperPanel>

 

8/10/2012 12:25:22 PM
Gravatar
Total Posts 18439

Re: custom feature setting link

You need to move <ContentTemplate> inside of UpdatePanel, it must wrap all the controls inside updatepanel having it where you have it is probably breaking things.

ie it should be like this:

<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>

other controls here

</ContentTemplate>
</asp:UpdatePanel>

ContentTemplate should not exist anywhere except there.

Hope that helps,

Joe

8/13/2012 11:35:15 AM
Gravatar
Total Posts 199

Re: custom feature setting link

Thanks Joe!  Got it working and found it was a combination of what you suggested and some bad post build events.

I am now going to start adding some complexity to this feature.  Learning more everyday and as always I really appreciate the quick responses :-)

Take Care

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