MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Change Discussion Board Tabs and Text  (Mono Support )

63245 put(a) pogledan, 5 odgovor(a) 31.8.2011. 14:45:18Kreirao(la) PatrickH

Povezane teme

PatrickH

PatrickH

31.8.2011. 14:45:18
Hi,

Can somebody tell me how to change the text and add /remove tabs in the Discussion
Board module?

I have been struggling to find anything and any help would be greatly appreciated.

Still have to say this is one of the best CMS systems I have come across and I am
enjoying getting to grips with it.
Ovaj sadržaj još nije ocijenjen. 
30 Reputacija 5 Ukupno objava
khorvat

khorvat

31.8.2011. 15:46:24
Hi,

can you please specify what exactly you want to change on the discussion board tabs ? What tabs you want to remove etc ?

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
PatrickH

PatrickH

1.9.2011. 9:18:58
Hi Khorvat,

Thanks for the speedy responce...

Initially I just want to change add new topic to ask a question and may want to remove the new topics tab?

I hope this makes sense as I am trying to set it up more as a Q&A board.

Cheers,
Ovaj sadržaj još nije ocijenjen. 
30 Reputacija 5 Ukupno objava
imarusic

imarusic

1.9.2011. 13:21:00
Hi PatrickH,

To do so you need to override MonoX DiscussionBoard and DiscussionTopics modules and add them to DiscussionContainer module.

Here is a code snippet for DiscussionBoard module:

1. DiscussionBoard Markup:

<%@ Control Language="C#"
    AutoEventWireup="True"
    CodeBehind="DiscussionBoard.ascx.cs"
    Inherits="YourNamespace.DiscussionBoard"
%>
     
     
<%@ Register Namespace="MonoSoftware.Web.Pager" Assembly="MonoSoftware.Web.Pager"
    TagPrefix="mono" %>
<%@ Register TagPrefix="MonoX" TagName="StyledButton" Src="/MonoX/controls/StyledButton.ascx" %>
<%@ Register Src="/MonoX/controls/CustomRadEditor.ascx" TagPrefix="mono" TagName="CustomRadEditor" %>
<%@ Register TagPrefix="MonoX" TagName="UserEntry" Src="/MonoX/controls/UserPicker.ascx" %>
 
<asp:UpdatePanel ID="upNewBoard" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
    <ContentTemplate>
        <div style="overflow: hidden;">           
            <asp:HyperLink ID="lnkLastActiveTopics" runat="server" CssClass="discussion-link" ></asp:HyperLink>
            <asp:HyperLink ID="lnkMyTopics" runat="server" CssClass="discussion-link" ></asp:HyperLink>                      
            <asp:UpdateProgress ID="upTop" runat="server" DisplayAfter="0" DynamicLayout="true">
                <ProgressTemplate>
                    <img src='<%= BaseSiteFullUrl %>/App_Themes/<%= Page.Theme %>/img/loading.gif' alt="Progress ..."
                        width="20px" class="progress" />
                </ProgressTemplate>
            </asp:UpdateProgress>
            <MonoX:StyledButton ID="btnNewBoard" runat="server" CssClass="discussion-button" />
        </div>
        <div class="discussion board-container">
            <asp:PlaceHolder ID="plhNewBoard" runat="server" Visible="false">
                <div class="input-form discussion-form">
                    <dl>
                        <dd>
                             <asp:ValidationSummary ID="summary" runat="server" DisplayMode="List" ShowSummary="true" />
                        </dd>
                        <dd>
                            <asp:Label ID="lblBoardName" runat="server" AssociatedControlID="txtBoardName"></asp:Label>
                            <asp:TextBox ID="txtBoardName" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="vldRequiredBoardName" runat="server" ControlToValidate="txtBoardName" Text="!" CssClass="validator ValidatorAdapter" Display="Dynamic" />
                        </dd>
                        <dd>
                            <asp:Label ID="lblBoardDescription" runat="server" AssociatedControlID="txtBoardDescription"></asp:Label>
                            <asp:TextBox ID="txtBoardDescription" runat="server" TextMode="MultiLine" Rows="10"></asp:TextBox>
                            <div>
                                <mono:CustomRadEditor Width="100%" ID="radBoardDescription"  EditModes="Design"
                                    runat="server" ToolBarMode="ShowOnFocus" StripFormattingOptions="AllExceptNewLines" ></mono:CustomRadEditor>
                            </div>
                        </dd>
                        <dd>
                            <asp:Label ID="lblEditors" runat="server" AssociatedControlID="ddlEditors"></asp:Label>
                            <div>
                                <MonoX:UserEntry runat="server" Height="200" Width="98%" ID="ddlEditors" UserFilterMode="ShowAllUsers" ExcludeMySelf="false" />
                            </div>
                        </dd>
                        <dd id="rowAutoSubscribe" runat="server">                       
                            <asp:CheckBox ID="chkSubscribe" runat="server" Checked="true" />
                            <asp:Label ID="labSubscribe" runat="server" AssociatedControlID="chkSubscribe"></asp:Label>
                        </dd>
                        <dd id="rowRoles" runat="server">
                            <asp:Label ID="labRoles" runat="server" AssociatedControlID="chkRoles"></asp:Label>
                            <asp:CheckBoxList ID="chkRoles" runat="server" CellSpacing="10" 
                                RepeatColumns="5" RepeatDirection="Horizontal" RepeatLayout="Table">
                            </asp:CheckBoxList>
                        </dd>
                        <dd>
                            <MonoX:StyledButton ID="btnSaveNewBoard" runat="server" CommandName="Save" CssClass="discussion-styled-button" />
                            <MonoX:StyledButton ID="btnCancelNewBoard" runat="server" CausesValidation="false" CssClass="discussion-styled-button" />
                        </dd>
                    </dl>
                </div>
            </asp:PlaceHolder>
            <asp:ListView ID="lvDB" runat="server">
                <LayoutTemplate>                   
                    <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>                       
                </LayoutTemplate>
                <ItemTemplate>
                </ItemTemplate>
            </asp:ListView>           
        </div>
        <div style="clear: both">
            <mono:Pager runat="server" ID="pager" PageSize="10" NumericButtonCount="5" AllowCustomPaging="true"
                AutoPaging="false">
                <PagerTemplate>
                </PagerTemplate>
            </mono:Pager>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

2. Code Behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace YourNamespace
{
    public partial class DiscussionBoard : MonoSoftware.MonoX.ModuleGallery.SocialNetworking.DiscussionBoard
    {
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            lnkLastActiveTopics.Visible = false;
             
        }
    }
}

You need to repeat this two steps for DiscussionTopics module and set the btnNewTopic text in code behind.

Please note that you need to replace "YourNamespace" with the one you use. When you finish those two user controls you need to add them to Discussion container.

Regards.

Ovaj sadržaj još nije ocijenjen. 
3016 Reputacija 428 Ukupno objava
PatrickH

PatrickH

1.9.2011. 13:45:06
Thanks for that - I will have a play... makes sense now

Cheers,
Ovaj sadržaj još nije ocijenjen. 
30 Reputacija 5 Ukupno objava