Dave Burke : Online Community and Social Business Specialist

Linking to an article in Community Server 2007

I couldn't resist answering a question on CS Forums on selected navigation and how to link to an article, since the questioner ended with "So, basically, the articles feature for the main site is neutered?"  When someone throws down a neutered challenge, I'm all over it.  My argument, by the way, was that to link to an article from the Site Navigation Menu, a new SiteUrls.config link element and a SelectedNavigation CSControl line in a copied blog theme.master does not a neutered feature make.  But yeah, articles support in Community Server has never been a very, um, virile feature.

This post isn't about articles support, but rather follows up on my SiteUrl CSControl Quickie and shows how to use the CSControl:SiteUrl to link to an article, as in


<CSControl:SiteUrl UrlName="weblogarticleId" ResourceName="myArticleLinkText" 
     runat="server" Parameter1="blog" Parameter2="10700"   />


For a sidebar on terminology, articles are referred to in CS2007 as Pages and are associated with a blog.  There are also articles in Community Server 2007 that can be managed in the System Tools that are site-wide and are in actuality Content Parts.  That's a cool feature, too, but what we're talking about are Blog Articles, and we start by creating one.



Now to create a link to the new page.  There's a "weblogarticleId" Url in the siteurls.config and we'll use that for our SiteUrl control.  The weblogarticleId in the siteurls.config looks like this

 

<url name="weblogarticleId" path="##blogdirectory##pages/{1}.aspx"
       pattern="##blogName##/pages/(\d+)\.aspx" physicalPath="##blogthemeDir##"
       vanity="{2}?App=${{app}}&amp;PostID=$1" page="post.aspx" />


We need two parameters here, the blog applicationKey and the postID of the article.  The blog applicationKey should be a known, but obtaining the PostID is the trick.  To do so, we select "Manage all Pages," highlight the page we want to link to, and obtain the postID from the browser's status bar, which for our example is 10700.




Now we can complete the SiteUrl CSControl and link to the article, with the weblog appkey as Parameter1 and PostID as Parameter2.


<CSControl:SiteUrl UrlName="weblogarticleId" ResourceName="myArticleLinkText"  runat="server" Parameter1="blog" Parameter2="10700"   />


Comments (2) | Post RSS RSS comment feed

Posted on 6/17/2007 3:47:57 PM by Dave Burke
Categories: Community Server
Tags:

Related posts

Comments (2) -

6/18/2007 9:57:20 AM Permalink

I'm the one that made the comment, and I replied to that post over there.  Incidentally, I was referring to CS articles, not blog articles.  Thanks for rising to the challenge, but I'm afraid it didn't help me. Smile

Dustin |

6/18/2007 11:21:03 AM Permalink

Replied on the forums post.  Let me know about the follow-up post.

daveburke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke

Copyright © 2013 Dave Burke.  All Rights reserved.