KiGG View Detailed Story

by KodefuGuru 23. June 2009 18:58

I recently deployed a KiGG site, but I wanted it to act more like DZone than DotNetShoutOut. On DotNetShoutOut, if you click the link from any of non-detailed page views, it takes you to the site. DZone will take you to the detailed view of the story, and if you click the link from there it will take you story’s site. The reason for this change is that I want my site to foster the community: more comments and viewing promoters. Eventually, I would like to code up a friend system for KiGG similar to DotNetKicks friend system, and I feel that seeing who promoted a story will grow more connections between those in the community.

Here’s how you can implement viewing the detailed story. In your KiGG 2.2 release codebase, open up Kigg.Web\Views\Story\Story.ascx. On line 132, you will find the declaration for detailUrl.

<% string detailUrl = Url.RouteUrl("Detail", new { name = story.UniqueName }); %>

Cut this and paste it immediately after the table tag on line 99. Then, replace the first td’s content with the following snippet of code.

<% if (Model.DetailMode) %>
<% { %>
<h2><a class="entry-title taggedlink" rel="bookmark external" 
        href="<%= Html.AttributeEncode(story.Url) %>" target="_blank" 
        onclick="javascript:Story.click('<%= attributedEncodedStoryId %>')">
        <%= Html.Encode(story.Title)%></a></h2>
<% } %>
<% else %>
<% { %>
<h2><a class="entry-title taggedlink" 
        href="<%= Html.AttributeEncode(detailUrl) %>">
        <%= Html.Encode(story.Title)%></a></h2>
<% } %>

That’s it: simple change! I think it would be better to make this configurable and submit it to the project. I may do that when I have more time to sift through the codebase.

Tags:

Kodefu

Comments

6/23/2009 7:04:19 PM #

trackback

Trackback from DotNetShoutout

KiGG View Detailed Story

DotNetShoutout

6/23/2009 7:05:19 PM #

trackback

Trackback from WebDevVote.com

KiGG View Detailed Story

WebDevVote.com

6/23/2009 7:05:47 PM #

trackback

Trackback from DotNetKicks.com

KiGG View Detailed Story

DotNetKicks.com

6/24/2009 6:30:14 AM #

Muhammad Mosa

Really good site. Nicly done.
What is this site about, is it about gaming?
Good luck

Muhammad Mosa Egypt

6/24/2009 10:20:48 AM #

chris

Thanks! It's a gaming site for Magic: The Gathering by Wizards of the Coast.

The one thing that's been plaguing me is that IE, and only IE, messes up logo.png (color is slightly off). I think I will have to switch it to gif.

chris United States

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen

Whois KodefuGuru

Chris Eargle

Chris Eargle
.NET Community Champion

LinkedIn Twitter Technorati Facebook

MVP - Visual C#

 

INETA Community Champions
Friend of RedGate
Telerik .NET Ninja
Community blogs & blog posts

I am a #52er


World Map

RecentComments

Comment RSS

Tag cloud

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010