CS 2007 Single Blog

Wednesday, 25 April 2007 00:29 by admin

參考 http://communityserver.org/forums/p/484668/570117.aspx#570117

原文交了大家如何使用 Single Blog 與 Single Gallery ,但那種並不符合我的需求,而且好像修改的太多了,順手寫了一下改造心得

於 CS 2007 ,Single Blog 與 Single Gallery 已經內建於函數庫中,不再需要外掛套件,並且利用override 功能,輕易就可達成 Single Blog

首先新增一個 siteurls_override.config ,裡面文件如下

<?xml version="1.0" encoding="utf-8" ?>
<Overrides>

<Override xpath="/SiteUrls/transformers/add[@key='##blogdirectory##']" mode = "change" name = "value" value = "" />
<Override xpath = "/SiteUrls/locations/location[@name='weblogs']" mode = "change" name = "type" value = "CommunityServer.Blogs.Components.SingleBlogLocation, CommunityServer.Blogs"/>

<Override xpath="/SiteUrls/transformers/add[@key='##photogallerydirectory##']" mode = "change" name = "value" value = "" />
<Override xpath = "/SiteUrls/locations/location[@name='galleries']" mode = "new" name = "type" value = "CommunityServer.Galleries.Components.SingleGalleryLocation, CommunityServer.Galleries"/>

</Overrides>

另外再新增一個 communityserver_override.config ,裡面內容

<?xml version="1.0" encoding="utf-8" ?> 
<Overrides>

<Override xpath = "/CommunityServer/Weblog" mode = "new" name = "defaultApplicationKey" value = "sample_weblog" />
<Override xpath = "/CommunityServer/Gallery" mode = "new" name = "defaultApplicationKey" value = "sample" />

</Overrides>

其中將 value = "您的application key" 就可以達成 single blog 與 gallery 了,夠簡單吧,而且日後升級也只要把這兩個檔案放進去新版本,就可以套用了,不需要每次都修改一次