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

Forums / General Discussions / Showing Recent Post

Showing Recent Post

7 posts, 1 answered
  1. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    08 Jan 2011
    Link to this post
    Hi,
    I am showing the Forum's posts in a repeater but I am not sure how to put the link for description under the Post Name. Below, i am doing something like. However I am trying to put the post ID as a link but I am sure it will never work.

    Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();        IList listForums = forumManager.GetForums(false);
    Telerik.Forums.Data.Forum frm = (Telerik.Forums.Data.Forum)listForums[0];
    IList listPosts = forumManager.GetForumPosts(frm.ID);
    rptPosts.DataSource = listPosts;
    rptPosts.DataBind();


    <asp:Repeater ID="rptPosts" runat="server">
        <
    HeaderTemplate><ul></HeaderTemplate>
         <
    ItemTemplate>
          <
    li><a href='community-forum.aspx?ForumCatID=<%# Eval("id") %>'><%# Eval("Title") %></a></li>
         </
    ItemTemplate>
        <
    FooterTemplate></ul></FooterTemplate>
    </
    asp:Repeater>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Jan 2011
    Link to this post
    Hi Asif,

    You should have a custom control that displays your posts like named anchor. You can add the anchor href and anchor name dynamically through jQuery by reading some parameters from the QueryString which will be set by your link. You can append a href with a title and add attribute 'name';

    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. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    10 Jan 2011
    Link to this post
    I am not sure what exactly thing I should put in href tag to create a link using JQuery. Currently in the external template, the following links are embedded into each forum's title

    Forum 1
    javascript:__doPostBack('ctl00$cb_Body$Forums1$ctl00$ctl00$forumsRepeater$ctl01$inner$ctl02$btnOpenForum','')

    Forum 2
    javascript:__doPostBack('ctl00$cb_Body$Forums1$ctl00$ctl00$forumsRepeater$ctl01$inner$ctl03$btnOpenForum','')

    These aforementioned javascript links are pretty confusing for me. Can you give me very little example. I will really appreciate that. BTW, thanks for your help.
  4. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    10 Jan 2011
    Link to this post
    May be I wasn't so much clear about my question. Please find the attached screen shots.

    Forum-Search1.jpg
    I am trying to put a link under the title "reply forum" (Left side - under "Most Recent Post"). But not sure what should I do for it. What link I should put to make it redirect to detail page. However If I click on any title link of right side which is I am using an external template "ForumList.ascx" then it shows the description of each title. But, I cant see any query string. All I know the "LinkButton" is using "<asp:LinkButton ID="btnOpenForum" runat="server"></asp:LinkButton>".

    forum-search-description.jpg
    This is the detail page of each forum title. But you can't see any query string there.

    So my question is, how to put a link under each post?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Jan 2011
    Link to this post
    Hello Asif,

    There are also several properties in the Misc section that allow for the setting of a page for each of the other available public controls of the Forums module. These are:

       1. EditPostPage - page that contains the Edit Post control
       2. AllForumsPage - page that contains the Forums List control
       3. SingleForumPage - page that contains the Single Forum control
       4. SingleThreadPage - page that contains the Single Thread control

    You could take a look at this article to see how the forums work and when the control reads QueryString  parameters.

    Best wishes,
    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
    Answered
  6. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    14 Jan 2011
    Link to this post
    Hi,
    I couldnt solve my this issue. I read the entire article "http://www.sitefinity.com/help/developer-manual/forums-public-controls.html". But still I couldnt figure out the solution regarding linking my Recent post's title to the description page. Can you please help me on this. Please find my below code. This code is displaying the latest post's title as you can see the code but I am not sure what url should provide to make it linked with description page?

    C#
    Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();
            IList listOfRecentPosts = forumManager.GetRecentPosts(0, 5);
            if (listOfRecentPosts.Count > 0)
            {
                rptCategories.DataSource = listOfRecentPosts;
                rptCategories.DataBind();
            }

    aspx
    <asp:Repeater ID="rptCategories" runat="server">
        <HeaderTemplate><ul></HeaderTemplate>
        <ItemTemplate>
            <li><a href='community-forum.aspx?ForumCatID=<%# Eval("id") %>'><%# Eval("Title") %></a></li>
        </ItemTemplate>
        <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Jan 2011
    Link to this post
    Hello Asif,

    Have you set

       1. EditPostPage - page that contains the Edit Post control
       2. AllForumsPage - page that contains the Forums List control
       3. SingleForumPage - page that contains the Single Forum control
       4. SingleThreadPage - page that contains the Single Thread control

    What do you mean by "description page" The form has the above mentioned pages from 1 to 4.

    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
Register for webinar
7 posts, 1 answered