Auto Summary
Last Post 7/27/2010 09:15 PM by David O'Leary. 3 Replies.
Author Messages Informative
emarchisin
New Member
New Member
Posts:5
Avatar

--
6/03/2009 12:16 PM
    I have recently purchased version 4.0 and its really great. I still need to figure out templating but anyways, I wish there was a way that as you type in a description or article contents, it would automatically build the summary for you. the articles i have on my page are simply articles. So it would be nice as i let users enter their own articles, it would automatically create a summary so then a general reader can click on read more and see the rest of the article. But right now if a user does not enter a summary, it doesn't show anything.

    Is this possible?

    David O'Leary
    Efficion Consulting Staff
    Basic Member
    Basic Member
    Posts:151
    Avatar

    --
    6/03/2009 12:40 PM
    This is a good idea, but there are limitations in doing this due to the fact that HTML is involved. You can't just cut the text off at some specified character limit because that could result in invalid HTML (a tag such as the <p> tag might never be closed. ).

    That said, you should actually be able to do this with a custom template now.
    1.) Save a copy of the ArticleList_Standard.ascx template off as a new template such as ArticleList_FixedHeight.ascx.
    2.) In the new template, modify the tag that pulls back the description, replace the word "description" with "article". This will then display the whole Article rather than the description or summary.
    3.) Wrap that tag in a <DIV> and give the DIV a class or style with a fixed height and overflow:hidden (e.g. <div style="height: 250px;overflow:hidden"> <asp:Literal id="lblArticleDetails" runat="server" text='<%# Server.HtmlDecode(DataBinder.Eval(Container.DataItem,"Article")) %>' /></div>

    I haven't actually tried this or tested the above code but that should pretty well do what you're wanting. Let me know how it goes if you do it. I'll try to make a skin available that does this in the next few weeks.
    emarchisin
    New Member
    New Member
    Posts:5
    Avatar

    --
    7/12/2009 02:06 PM
    I guess I am a newbie to making skins/templates. I have the original install file but i am not the host of my website. So if i make the changes below, if i can figure out, how do i get it to show up on the module?
    David O'Leary
    Efficion Consulting Staff
    Basic Member
    Basic Member
    Posts:151
    Avatar

    --
    7/27/2010 09:15 PM
    Any template that is saved into the DesktopModules/Articles/Templates or Portals/[portalid]/ArticleTemplates folders and is prefixed with ArticleList_ or ArticleDetails_ will automatically appear in the respective dropdown list in the modules settings.


    ---