Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsAnnouncements with Teaser and Link to Single Announcement like a BlogAnnouncements with Teaser and Link to Single Announcement like a Blog
Previous
 
Next
New Post
3/3/2010 3:52 PM
 

I have see in this form that some people have been wondering how to get the Announcement module to behave similarly to that of the Blog module with respect to having a teaser list with links to the full announcement. Having wanted the same functionality and not finding the answer here I decided to see what I could come up with.

I should note that I have just started to work with DotNetNuke as the company I work for recently purchased it and we will be rolling out a site later this year. So I am a bit of a DotNetNuke newbie.

DNN 5.02.03 with jQuery.
 
What I did was this:
  1. Create a page with the Announcement Module and add a few test announcements.
  2. Open the Announcement Module settings and expand Advanced Settings.
  3. In the Header add this code:

    <script type="text/javascript">
    function querySt(ji) {
        hu = window.location.search.substring(1);
        gy = hu.split("&");
        for (i = 0; i < gy.length; i++) {
            ft = gy[i].split("=");
            if (ft[0] == ji) {
                return ft[1];
            }
        }
    }
    </script>
     
  4. In the Footer add this code:

    <script type="text/javascript">
        var myId = querySt('ItemId');
        var IId = '#ITEMID' + myId;
        $(document).ready(function() {
            if (myId == undefined) {
                $('[id^=ITEMID]').show();
            } else {
                $('[id^=ITEMID]').hide();
                $(IId).show();
            }
        });
    </script>
     
  5. Expand Page Settings and Allow Syndicate.
  6. Expand Announcements Settings and add a <div id="ITEMID[ITEMID]"> around the Item Template table like this:

    <div id="ITEMID[ITEMID]">
    <table>
    <tr><td>[IMAGESOURCE]</td><td valign="top"><span class="SubHead">[EDIT][TITLE] - [PUBLISHDATE]</span>
    <hr/>
    <div class="Normal DNN_ANN_Description">[DESCRIPTION]&nbsp;[READMORE]</div></td></tr></table>
    </div>
     
  7. Update.
  8. Click on the RSS icon now under the Announcement Module and you should get a new browser window, with IE anyways, with the default RSS IE viewer. Copy the URL.
  9. Now add the Newsfeeds Module to your front page, new page, or wherever and Edit Newsfeeds.
  10. Click Add Feed and paste the URL you just copied into Feed Url. For testing set the Cache Time to zero (0). Update, Update.
  11. You should now see a list of items from the Announcement Module with the titles as links.
  12. Click on one and you should see that only that announcement is showing on the corresponding page. If you visit the page and there is no ?ItemId=XX in the URL then all announcements should be visible as normal.
This seems to be working so far.  I havn't done much testing.
 
Some other tips:
  1. When adding announcements watch the date and time. If they are in the future they will not show up until then.
  2. If you don’t like the way the RSS displays the news then edit the /DesktopModules /News/Transformations/Default.xsl or create a new xsl and select it from the Newsfeed settings.
  3. Once you’re up and running you may want to change the Cache Time in the Newsfeed to something other than zero (0) to cut down on requests.
Since I’m new to DotNetNuke I'm not sure if there is a better way to grab the query string. If there is let me know. The JavaScript to grab the query string I got from this site: http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml
 
 
 
New Post
3/23/2010 1:52 PM
 
Thanks for this. Regarding step 12, how do you get the '?ItemId=XX' in the URL?
 
New Post
3/25/2010 12:20 PM
 

I found it in the xsl file.  Use {guid} instead of {link}.

 
New Post
3/30/2010 6:21 PM
 

 Yah, its in the Default.xsl (/DesktopModules /News/Transformations/Default.xsl). {link} is working for me just fine so far.

 
New Post
4/22/2010 11:54 PM
 
I haven't been able to get this to work. I'm extremely new query strings, so a detailed explanation would do wonders. "Item Id" is a little confusing. also any ideals on how to have links in rss go directly to the page the full article is on. If that's whats happening here please excuse my ignorance. However any additional info would help
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsAnnouncements with Teaser and Link to Single Announcement like a BlogAnnouncements with Teaser and Link to Single Announcement like a Blog


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out