Files on the Front Page

rated by 0 users
This post has 14 Replies | 3 Followers

Top 100 Contributor
Male
Posts 191
Points 2,800
Erik P. Ernst Posted: Mon, Mar 12 2007 6:25 PM
Is there anyway to get a list of "Recent Files" on the front page, the same way as it now shows active / unaswered forum poss?

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

Top 25 Contributor
Posts 948
Points 14,515
CS Developers

I have a simple solution for you, follow these steps:

  1. Open web\default.aspx
  2. Add the following line below the other @Register lines
    <%@ Register TagPrefix="FileGalleries" Namespace="CommunityServer.Files.Controls" Assembly="CommunityServer.Files" %>
  3. At the bottom of the page above the </div> </CS:MPContent> tags add the following line:
    <FileGalleries:portalentrylisting runat="server" sortby="PostDate" count="3" />
  4. Save the default.aspx page and reload your homepage

The above will add a sidebar box that lists the 3 most recent files that were posted to the file galleries.  It should look something like the attached image when you are done.


If you have any questions please let me know.

 

Thank you, 

Wyatt Preul
Wyatt - The Geek Cowboy

  • | Post Points: 35
Top 100 Contributor
Male
Posts 191
Points 2,800
Thanks looks good!

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 5
Top 100 Contributor
Male
Posts 191
Points 2,800
Just one more thing. How do I change the headline from "Most Recent" to "Most Recent Downloads"?

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 20
Top 25 Contributor
Posts 948
Points 14,515
CS Developers

Open up Languages/en-US/FileGallery.xml and change the entry for Files_PortalEntryListing_TitlePostDate from:

'Most Recent' to

'Whatever you desire'

 

Save the file and voila :[8-|]

Wyatt Preul
Wyatt - The Geek Cowboy

  • | Post Points: 20
Top 100 Contributor
Male
Posts 191
Points 2,800
Thanks, that was an easy one! The only problem is now that this text is now shown on the "files/default.aspx" page! Sad

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 20
Top 10 Contributor
Posts 2,523
Points 28,765
MVPs
If you want different text to be displayed between your homepage control and the files homepage, make a copy of the "Files_PortalEntryListing_TitlePostDate"  resource in the FileGallery.xml file and rename it. Edit  /Themes/default/Skins/FileGalleries/Skin-ViewFolderGroups.ascx and change the resource reference for the PostDateLink control (line 19) to  match your new resource.

Four Roads

  • | Post Points: 5
Top 100 Contributor
Male
Posts 191
Points 2,800

This worked fine in CS 2.1 - but how to make this work in CS 2007?

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 20
Not Ranked
Posts 33
Points 435
zar replied on Thu, Sep 6 2007 10:48 AM

Erik P. Ernst:

how to make this work in CS 2007?

 

same question please Stick out tongue 

  • | Post Points: 20
Top 100 Contributor
Male
Posts 191
Points 2,800

zar:

Erik P. Ernst:

how to make this work in CS 2007?

 

same question please Stick out tongue 

Maybe some day someone sees this thread! Wink

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

Top 10 Contributor
Posts 2,523
Points 28,765
MVPs

Add this to the top of /Themes/default/Common/home.aspx (replace "default" with your custom theme name, if you're using one):

<%@ Register TagPrefix="CSUserControl" TagName="AggregateEntryList" src="~/Themes/default/files/aggregateentrylist.ascx" %> 

and then place the following where desired:

<CSUserControl:AggregateEntryList runat="server" /> 

Four Roads

  • | Post Points: 20
Top 100 Contributor
Male
Posts 191
Points 2,800

Thanks it works, but it's sort of not quite the same as what we had before... This suggestion here displays the full list of downloads, instead of i.e. just listing the 5 or 10 newest files. Is it possible to do something like with the "Active Posts" list, where I can "customize" the list?

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 5
Top 100 Contributor
Male
Posts 191
Points 2,800

Ok it actually wasn't that difficult. I found out my self! Cool  I think I'm learning this CS programming after all!

<CSFile:EntryList runat="server" ID="AggregateEntryList">
  <QueryOverrides SortBy="PostDate" PageSize="5" PagerID="FilesPager" SortOrder="Descending" />
  <HeaderTemplate>
    <div class="CommonSidebarArea">
    <div class="CommonSidebarRoundTop"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
    <div class="CommonSidebarInnerArea">
      <CSControl:SiteUrl UrlName="fileshome" Parameter1="-1" ResourceName="Utility_ForumAnchorType_FilesActive" Tag="H4" CssClass="CommonSidebarHeader" runat="server" />
    <div class="CommonSidebarContent">
    <ul class="CommonSidebarList">
  </HeaderTemplate>
  <ItemTemplate>
      <li>
        <CSFile:EntryData ID="EntryData1" Tag="Div" CssClass="FileFileName" Property="Subject" LinkTo="ViewEntry" runat="server">
          <LeaderTemplate><CSFile:EntryThumbnail ID="EntryThumbnail1" ImageAlign="absmiddle" runat="server" ThumbnailSize="Small" /> </LeaderTemplate>
        </CSFile:EntryData>
        <CSFile:EntryData ID="EntryData2" Tag="Div" CssClass="FileFileDescription" Property="FormattedBody" TruncateAt="200" runat="server" />
        <CSFile:EntryRating ID="EntryRating1" Tag="Div" CssClass="FileFileRating" runat="server" IsReadOnly="true" RatingCssClass="CommonRateControl" RatingReadOnlyCssClass="CommonRateControlReadOnly" RatingActiveCssClass="CommonRateControlActive" ImagesBaseUrl="~/Themes/default/images/common/" />
      </Li>
  </ItemTemplate>
  <FooterTemplate>
    </div>
    </div>
    <div class="CommonSidebarRoundBottom"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
    </div>
  </FooterTemplate>
</CSFile:EntryList>

I also defined this text in resources.xml: Utility_ForumAnchorType_FilesActive

And I inserted this in the header:

<%@ Import Namespace="CommunityServer.Files.Components" %>

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 20
Top 10 Contributor
Posts 2,523
Points 28,765
MVPs
I'm glad you stuck with it and got it worked out, Erik! Thanks for sharing your solution with the community... Yes

Four Roads

  • | Post Points: 20
Top 100 Contributor
Male
Posts 191
Points 2,800

Genyus:
Thanks for sharing your solution with the community... Yes

You're welcome. I've so far gotten so much, that it's nice finally to be able to contribute something...

Best regards,
Erik P. Ernst
Microsoft MVP - Dynamics NAV webmaster at http://dynamicsuser.net

  • | Post Points: 5
Page 1 of 1 (15 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com