Module Discussions

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 9/30/2010 2:55 PM by  David O'Leary
Customizing Article Templates
 2 Replies
Please login to post a reply.
Author Messages
Matt Everett
Efficion Consulting Staff
New Member
New Member

4/7/2009 12:21 PM

    The Articles module provides a robust templating system which allows customized, portal-specific templates to be specified for the article list display as well as the article details display.  The article template files are .ascx files (web controls) that implement the UI elements that are hydrated with the article data, thereby allowing the custom template creator full control over the rendered output.  Customizing the display of your content should be easy for anyone with basic ASP.NET experience or even for people comfortable with raw HTML/CSS code.

    Article List Template

    If you would like to create a custom template, there are a few steps to complete before you can get started.  First, you will need to locate (or create) the portal-specific template directory for the Articles Module.  This directory is located at /Portals/xx/ArticleTemplates (where xx is the portal number).  The Articles Modules will scan this directory for .ascx files that begin with "ArticleList_" to populate the drop-down of available article list templates.  Once you have located or created this directory, the best place to start is with a copy of the ArticleList_Complete.ascx file (located in the ~/DesktopModules/Articles/Templates folder) as that contains all fields that are available for use.  Copy the original ArticlesList_Complete.ascx file into the portal specific article template directory and rename it to something you find useful.  Don't forget, the module requires that an article list template begins with "ArticleList_"!

    Once your new template file is in place, you should be able to easily edit the .ascx file to customize the look and feel to your liking.  You can remove any elements you don't want to display, modify the css classes being used, or wrap elements with html to create a completely new look. The possibilities are endless.

    Article Details Template

    Similar to the articles list templates, the portal-specific articles details templates need to be placed within the /Portals/xx/ArticleTemplates directory, but their filenames need to beging with "ArticleDetails_".  There is a default template with all of the available controls on the page located at ~/DesktopModules/Articles/Templates/ArticleDetails_Standard.ascx".  This template has all of the available controls placed on the page with minimal styling.

    Once you have a copy of this template in your portal-specific folder, you can customize it to fit your needs with a minimum of effort.  CssClass attributes are available for most of the controls and you can wrap the controls with HTML to get it to look exactly the way you like.

    More Information

    If you have any questions or would like to share interesting templates that you have created, please post to the forums here.  We hope this forum can become a clearinghouse for communitiy-developed custom templates and information on customizing the article list and detail templates!

    Tags: article, templates, custom
    New Member
    New Member

    8/6/2010 3:11 PM
    There is a default template with all of the available controls on the page located at ~/DesktopModules/Articles/Templates/ArticleDetails_Standard.ascx

    Where? I can't find it anywhere. Not in the file manager, not by typing in the address...
    I am an administrator of my portal, but not a host, does that matter?
    David O'Leary
    Efficion Consulting Staff
    Basic Member
    Basic Member

    9/30/2010 2:55 PM
    You won't see this through DNN. You'll need RDC or FTP access to the files on the server to get at this.
    Please login to post a reply.