BreakPostEx

This article is also available in English!This article is also available in English!

BreakPostEx 是一个 BlogEngine 插件,功能类似于 BlogEngine 自带的 BreakPost,可以在文章以列表形式显示的时候,只显示标记前面的内容,后面的内容被省略并用一个指向可以继续阅读的链接代替。

相比 BreakPost,BreakPost 进行了增强,能自动添加被切断的 HTML 关闭标记(而 BreakPost 是直接从标记处切断 HTML),保证被处理过的 HTML 标记的完整性。同时还提供了额外的功能,不需通过修改语言资源即可设置链接所要显示的文字。包含以上功能的 BreakPostEx 已经集成在 BeZ 1.4.5.13 版本中。

除此之外,BreakPostEx 还能为每一篇文章设置不同的链接文字,这样,你就可以在一篇显示很多文字的文章,为 [more] 标记设置显示为“继续阅读”,而在另一篇带有图片的文章中,设置为“查看图片”。此功能不包含在 BeZ 1.4.5.13 所集成的插件,将被集成到下一个版本的 BeZ 中。如果需要此功能,可下载新版本的 BreakPostEx 并将其覆盖 BeZ 1.4.5.13 的 APP_CODE\Extensions 目录中的旧版本插件。

语法:

[more] 语法和 BreakPost 一样,在需要切断的文章内容处,输入


[more]

该处将在显示文章列表的时候被切断,并用一个指向完整文章的链接代替,链接所显示的文字将使用插件的设置界面所设置的文字。

[more:xxx] 语法忽略全局设置,为每一篇文章使用不同的链接文字,比如你可以这么写:


[more:查看图片]

那么,即使你在全局设置中,设置 more 标记显示为“继续阅读”,但是在该篇文章中,却会显示为“查看图片”。

下载 BreakPostEx.cs

 

This article is also available in English!

BreakPostEx is an extension similar to BreakPost for BlogEngine, it can break a post in the Post list, and add a link points to the full post for continuing reading.

BreakPostEx mades some enhancements for BreakPost, it adds missing closing HTML tags when breaking a post (BreakPost simply cuts the HTML at certain position), this ensures the HTML block valid. It also provides a setting for customizing the link text which is pointing to the full post, without the need to modify the language resource of BlogEngine. (Above features are included in BeZ 1.4.5.13)

Additionally, you can customize the link text in each post, for example, you can specify the link to show "Continue reading" in a post that is full of text, but to show "View pictures" in another post that has pictures. This feature is not included in BeZ 1.4.5.13 but will be included in the next release, you can manually download it and overwrite the old one in APP_CODE\Extensions of BeZ 1.4.5.13.

Gramma:

[more] is the same function as BreakPost, type


[more]

at any position in your post, and it will break the post at that position and replace remaing text with a link that pointing to the full post.

[more:xxx] ignores the global setting for BreakPostEx, specifies different link text for each post, for example:


[more:View pictures]

This will override the global setting, display "View pictures" for the link in current post.

Download BreakPostEx.cs

最新评论

Comment RSS