Sometimes you use the FAQ module and want to keep things in order... and don't want it to change.
I finally figured out how to put the FAQ's in their original order and reverse original order
You have to modify a stored procedure and the /DesktopModules/FAQs/Settings.ascx
Edit Stored Procedure
dbo.FAQSearch (add 2 lines at end and don't forget the comma)
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/* -------------------------------------------------------------------------------------
/ FAQSearch
/ ------------------------------------------------------------------------------------- */
ALTER PROCEDURE dbo.FAQSearch
(
@ModuleId int,
@OrderBy int
)
AS
SELECT
f.ItemId,
f.ModuleId,
f.CategoryId,
f.Question,
f.Answer,
f.CreatedByUser,
f.CreatedDate,
f.DateModified,
f.ViewCount,
c.FaqCategoryName,
c.FaqCategoryDescription
FROM FAQs f
left outer join FAQsCategory c on
f.CategoryId = c.FaqCategoryId
where f.ModuleId = @ModuleId
ORDER BY
CASE WHEN @OrderBy=0 THEN f.DateModified END DESC,
CASE WHEN @OrderBy=1 THEN f.DateModified END ASC,
CASE WHEN @OrderBy=2 THEN f.ViewCount END DESC,
CASE WHEN @OrderBy=3 THEN f.ViewCount END ASC,
CASE WHEN @OrderBy=4 THEN f.CreatedDate END DESC,
CASE WHEN @OrderBy=5 THEN f.CreatedDate END ASC
Add 2 lines to /DesktopModules/FAQs/Settings.ascx
The beginning of your file should look like this
<%@ Control Language="vb" Inherits="DotNetNuke.Modules.FAQs.Settings" AutoEventWireup="false" CodeBehind="Settings.ascx.vb" %>
<%@ Register TagPrefix="dnn" TagName="SectionHead" Src="~/controls/SectionHeadControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<TABLE class="Normal" id="Table2" cellSpacing="3" cellPadding="3" border="0">
<TR>
<TD><dnn:label id="lblDefaultSorting" ControlName="lblDefaultSorting" Suffix=":" runat="server"></dnn:label></TD>
<TD><asp:dropdownlist id="drpDefaultSorting" runat="server" Width="150px" CssClass="Normal">
<asp:ListItem Value="0" resourcekey="OrderByDateNew">Date New</asp:ListItem>
<asp:ListItem Value="1" resourcekey="OrderByDateOld">Date Old</asp:ListItem>
<asp:ListItem Value="2" resourcekey="OrderByPopularityHigh">Popularity High</asp:ListItem>
<asp:ListItem Value="3" resourcekey="OrderByPopularityLow">Popularity Low</asp:ListItem>
<asp:ListItem Value="4" resourcekey="OrderBy.Text">Reverse Original Order</asp:ListItem>
<asp:ListItem Value="5" resourcekey="OrderBy.Text">Original Order</asp:ListItem>