British Inside

An Englishman living in small town America

James Shaw

News

  • Copyright James Shaw 2004-2007

    Creative Commons License

    View James Shaw's profile on LinkedIn

Linking your blogs to a different URL

Gotta quickly blog this one since it was something I couldn't find out here in blogland..

CS has the ability (now hidden) to link each blog post to a given URL - any URL. As I said, it's hidden in the UI, so you can't set it, but I had to add it back so here's a quick and dirty method. Notes apply to CS2007 RTM.

  1. open \controlpanel\blogs\CreateEditBlogPost.ascx and add a new label and textbox

    <div class="CommonFormFieldName">
    <cp:formlabel id="Formlabel6" runat="Server" controltolabel="PostURL" Text="Use this URL instead of normal blog post URL" />
    </div>
    <div class="CommonFormField">
    <asp:textbox id="PostURL" cssclass="ControlPanelTextInputBig" maxlength="256" runat="server" />
    </div>

  2. open the codebehind and find every occurence of PostSubject. Next to each occurence do the same thing with your new textbox PostURL and the TitleURL property

    protected TextBox PostURL;
    (...)
    PostURL.Text = CurrentWeblogPost.TitleUrl;
    (...)
    CurrentWeblogPost.TitleUrl = PostURL.Text;

  3. Wherever you link WeblogPostData control to the post (e.g. \themes\blogs\..\postlist.aspx), instead link it to the AuthorURL

    Change from:

    <CSBlog:WeblogPostData runat="server" Property="Subject" LinkTo="Post" />

    to:

    <CSBlog:WeblogPostData runat="server" Property="Subject" LinkTo="AuthorURL" />

You'll have to ask an old (CS) guy like ScottW how/why this works with AuthorURL (and perhaps there's another way), but this does work.


Posted: Friday, April 27, 2007 1:16 PM by James

Comments

communityserver相关博客聚合 said:

Gotta quickly blog this one since it was something I couldn&#39;t find out here in blogland.. CS has

# April 27, 2007 12:41 PM

Dave Burke said:

blog bits Scott Watermasysk's been doing a really good job pointing out the top Community Server news

# April 29, 2007 8:55 AM

Dave Burke's Community Server Bits said:

A nifty quirk exploitation from James Shaw on how to give a post any URL by modifying CreateEditBlogPost.ascx.

# April 29, 2007 10:58 AM

here said:

Once you score the information you were trying to track down, you can put it to work.

# September 22, 2007 3:10 PM

fractalnavel said:

British Inside : Linking your blogs to a different URL why is this still hidden ? _is_ it ? (tags: communityserver

# September 27, 2007 7:25 AM

fractalnavel said:

British Inside : Linking your blogs to a different URL why is this still hidden ? _is_ it ? (tags: communityserver

# September 27, 2007 7:25 AM

fractalnavel said:

quick note: scott w.'s MetaBlogExtender for community server didn't cover quite the full blog post API

# September 28, 2007 5:14 AM
New Comments to this post are disabled