+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / How does Archived function Work

How does Archived function Work

4 posts, 0 answered
  1. NK
    NK avatar
    82 posts
    Registered:
    15 Apr 2010
    19 Jul 2010
    Link to this post
    Hello,

    I am a newbie with Sitefinity. I just wonder how does the Archived function work. I saw it, after clicking Site Map-All Pages, View only pages with status:...... | Archive | View all.

    I would like to archive web pages but I do not know how?


    Please help!



    Thanks,
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Jul 2010
    Link to this post
    Hello NK,

    Archive status is no more in use. It was working when page workflow was turned on - allowPageWorkflow="True" and ArchivePage was internaly called. Currently you may set Archive status only programmatically

    var cmsManager = new CmsManager();
    Guid pageID = new Guid("40b75e9d-4205-45aa-89c6-db43373ce41e");
    ICmsPage cmsPage = (ICmsPage)cmsManager.GetPage(pageID, true);
    cmsPage.Status = PageStatus.Archived;
    cmsManager.SavePage(cmsPage);
      
    //check status
    ICmsPage cmsPage1 = (ICmsPage)cmsManager.GetPage(pageID, true);
    PageStatus s = cmsPage1.Status;


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. NK
    NK avatar
    82 posts
    Registered:
    15 Apr 2010
    20 Jul 2010
    Link to this post

    Ivan,
    Thank you for response. If the Archive funtion is no longer in used, how do I make it to be hidden from the navigation?


    Thanks,
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Jul 2010
    Link to this post
    Hi NK,

    First this is a post for Sitefinity 4.0 and you should use threads for 3.x edition instead.

    Modify Sitefinity/Admin/ControlTemplates/Pages/AllPagesList.ascx  to hide Archived button.

    <%@ Control Language="C#" %>
      
    <%@ Register Assembly="Telerik.Workflow" Namespace="Telerik.Workflow.WebControls" TagPrefix="cc1" %>
    <%@Register TagPrefix="cc1" Namespace="Telerik.Cms.Web.UI" Assembly="Telerik.Cms.Web.UI" %>
      
      
    <script type="text/C#" runat="server">
    public void Page_Load(object sender, EventArgs e)
    {
        this.workflowFilter.ItemDataBound += new RepeaterItemEventHandler(workflowFilter_ItemDataBound);
    }
      
    void workflowFilter_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
         
        if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        {
            LinkButton lb = (LinkButton)e.Item.FindControl("statusLink");
            if (lb != null && lb.CommandArgument == "Archived")
            {
                lb.Visible = false;
                 
                 
            }
            if(lb != null && lb.CommandArgument == "Published")
                hiddenLine = true;
        }
        if (e.Item.ItemType == ListItemType.Separator)
        {
            if(hiddenLine == true)
              e.Item.Visible = false;
        }
    }
      
    private bool hiddenLine = false;
        
      
      
    </script>
    TEST
    <div runat="server" id="mainPanel" class="workArea">
        <cc1:MessageControl runat="server" id="message">
            <ItemTemplate>
                <asp:Label runat="Server" ID="messageText"></asp:Label>
            </ItemTemplate>
        </cc1:MessageControl>
        <!-- BEGIN EXCLUDE FOR COMMUNITY -->
        <div class="groupAct" runat="server" id="toolsPanel">
            <asp:Literal runat="server" Text="<%$Resources:ViewOnlyPagesWithStatus %>"></asp:Literal>:
            <asp:Repeater runat="server" ID="workflowFilter">
                <ItemTemplate><asp:LinkButton runat="server" ID="statusLink" CommandName="Select" CommandArgument='<%# Eval("Value") %>'><%# Eval("Text") %></asp:LinkButton></ItemTemplate>
                <SeparatorTemplate> | </SeparatorTemplate></asp:Repeater> <asp:Literal runat="server" Text="<%$Resources:Or %>"></asp:Literal> <asp:LinkButton ID="viewAll" CommandName="ViewAll" runat="server" Text="<%$Resources:ViewAll %>"></asp:LinkButton>
              
            <div class="clear"><!-- --></div>
        </div>
        <!-- END EXCLUDE FOR COMMUNITY -->  
        <h2 id="gridTitle" runat="server" class="gridTitle"><asp:Literal runat="server" Text="<%$Resources:AllPages %>"></asp:Literal></h2>
        <!-- BEGIN EXCLUDE FOR COMMUNITY -->              
        <div id="gridActionsPanel" runat="server" class="groupActions">
            <span class="teaser"><asp:Literal runat="server" Text="<%$Resources:SelectPagesAnd %>"></asp:Literal>:</span>
            <cc1:WorkflowActionCommnads runat="server" ID="workflowActions" />
        </div>
        <!-- END EXCLUDE FOR COMMUNITY -->
        <asp:GridView ID="GridView1" AllowPaging="true" AllowSorting="true" PageSize="30" AutoGenerateColumns="false" GridLines="none" CssClass="listItems" runat="server">
            <Columns>
                <asp:TemplateField ItemStyle-CssClass="check">
                    <HeaderTemplate><asp:CheckBox ID="checkAll" runat="server"/></HeaderTemplate>
                    <ItemTemplate><asp:CheckBox runat="server" ID="rowCheck"/></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$Resources:Name %>" SortExpression="Name">
                    <ItemStyle CssClass="gridContentTitle" />
                    <ItemTemplate>
                        <asp:HyperLink ID="AdminPageLink" runat="server" NavigateUrl='<%# Eval("AdminURL") %>'><%#Eval("Name")%></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$Resources:Template %>" SortExpression="TemplateName">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("TemplateUrl") %>'><%# Eval("TemplateName") %></asp:HyperLink>
                    </ItemTemplate>              
                </asp:TemplateField>
                <asp:BoundField DataField="DateModified" SortExpression="DateModified" HeaderText="<%$Resources:Modified %>" HeaderStyle-CssClass="GridHeader_SiteFinity" DataFormatString="<%$Resources:ModifiedDateFormat %>" HtmlEncode="false" />
                <asp:BoundField DataField="Modifier" SortExpression="Modifier" HeaderText="<%$Resources:ModifiedBy %>" HeaderStyle-CssClass="GridHeader_SiteFinity" />
                <asp:TemplateField HeaderText="<%$Resources:Status %>" SortExpression="Status" HeaderStyle-CssClass="GridHeader_SiteFinity">
                    <ItemTemplate>
                        <asp:Label ID="statusMessage" runat="server" CssClass="stat"><%#Eval("Status")%></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>                  
                    <ItemTemplate>
                        <asp:Label runat="server" ID="noPreview"
                        Visible="false" ToolTip="<%$Resources:NoPreviewForGroupPages %>" Text="<%$Resources:NoPreview %>" />
                        <asp:HyperLink runat="server" ID="preview" NavigateUrl='<%# Eval("DefaultUrl") %>' ToolTip="<%$Resources:PreviewTooltip %>"
                            Target="_blank" Text="<%$Resources:Preview %>">
                        </asp:HyperLink
                    </ItemTemplate>
                    <ItemStyle CssClass="gridActions" />
                </asp:TemplateField>
                <asp:TemplateField AccessibleHeaderText="<%$Resources:Delete %>">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="cmdDelete" CommandName="Delete" Text="<%$Resources:Delete %>" ToolTip="<%$Resources:Delete %>"></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle CssClass="gridActions delete" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
          
        <div id="emptyWindow" runat="server" visible="false">
            <div id="empty">
                <h2 class="gridTitle"><asp:Literal runat="server" Text="<%$Resources:NoPages %>"></asp:Literal></h2>
                <p runat="server" id="newPageLinkHolder"><asp:HyperLink ID="linkNewPage" runat="server" NavigateUrl="~/Sitefinity/Admin/Pages.aspx?mode=new" cssClass="mainLink" ToolTip="<%$Resources:CreateYourFirstPageTooltip %>"><strong><asp:Literal runat="server" Text="<%$Resources:CreateYourFirstPage %>"></asp:Literal></strong></asp:HyperLink><br />
                <asp:Literal runat="server" Text="<%$Resources:Or %>"></asp:Literal>, <a href="http://www.sitefinity.com/sf3/faq.html#pages" target="_blank" title="Opens in a new browser window"><asp:Literal runat="server" Text="<%$Resources:CheckPagesFAQs %>"></asp:Literal></a></p>     
            </div>
        </div>
    </div>
       


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered