Changing BreakPost link text to something other than More

Topics: ASP.NET 2.0, Controls
Aug 26, 2009 at 2:30 PM

HI All, I found an xml file called breakpost.xml

That has a value for True or false turning on or off the break post feature.

Where is the link text specified then, or just how does this xml create the hook?

I'ld like to change the link text to something like Continue Reading...

Here's the BreakPost.xml code:

<?xml version="1.0" encoding="utf-8"?>
<ManagedExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="BreakPost">
<Version>1.2</Version>
<Description>Breaks a post where [more] is found in the body and adds a link to full post</Description>
<Author>BlogEngine.NET</Author>
<AdminPage />
<Enabled>true</Enabled>
<ShowSettings>true</ShowSettings>
</ManagedExtension>

Aug 26, 2009 at 3:29 PM

Hey cool, I know I'm just scratching the surface of BlogEngine (BE) goodies, knowing to google breakpost turned up this possible gem.

http://www.conetrix.com/Blog/post/BlogEngineNET-PostTeaser-Extension.aspx

An alternative for the breakpost extension, maybe the answer to my query above, haven't had time to check this one out yet.

Aug 26, 2009 at 3:41 PM

Getting somewhere now, digging deeper I've found the BreakPost.cs in the App_Data/Extensions folder.

Not sure why my original search didn't turn this up, likely because I was looking for BreakPost in the file and not as the file title.

I'm guessing I can hack my way through the dotNet jungle from here, who's with me! w00t

Aug 26, 2009 at 5:19 PM
Edited Aug 26, 2009 at 5:20 PM

 

  <data name="more" xml:space="preserve">
<value>More</value>
</data>

Change the  value tags in the App_GlobalResources/labels.resx and it should work.

  <data name="more" xml:space="preserve">
<value>Continue Reading</value>
</data>

 

Case closed on this one then maybe. Applying a css style could be even more useful, but this get it done for me.

Nov 8, 2009 at 6:24 PM

You can also make more advanced changes if you modify it in BlogEngine.Core.Web.Controls.PostViewBase class, You would need to go that class, find "public string Body" and change the following line:

string link = " <a href=\"" + Post.RelativeLink.ToString() + "\">[" + (Page as BlogBasePage).Translate("more") + "]</a>";

You can "inject" any HTML code you want!

Regards,

Txarlie García.