• 瀏覽: 5,025
  • 回覆: 17
[隱藏]
商用軟件有些 design architecture我覺得 好神奇,比如 CMS, Workflow 架構,最近學習 下piranha cms core 的 source code, 有冇 高手解釋下 呢類 CMS 的設計架構,或者同其他 CMS 架構的分別


回覆 引用 TOP

熱賣及精選

回覆 引用 TOP

  有 doc
http://piranhacms.org/

 對比 orchard core cms, 食人魚簡單好多,
Orchard core cms 等左兩三年都未去到 stable release 



回覆 引用 TOP

毎日自言自語時間

CMS db 同 data db 可以用吾同 connection string 分開,亦即係吾同牌子db 一起用,幾好

Piranha CMS is a lightweight, unobtrusive
睇左啲source code, 覺呢句廣告都幾岩,跟本可以當做  asp.net core 嘅起手template, 再免費送你一個lightweight 嘅 cms



回覆 引用 TOP

[隱藏]
食人魚 用左Block editor , 好方便
估計今時今日大部分 cms 都用 block editor 去 edit html ,  
冇記錯Django cms 好似吾係



回覆 引用 TOP

吾明點解main banner 之類 叫做hero ?   究竟咩料?


回覆 引用 TOP

引用:
原帖由 tk24chan 於 2019-11-27 11:56 PM 發表

用 wordpress 啦。攪咁多野做乜。
主要想了解和學習 呢類 tools 係怎様 設計,好似 route, security, caching,module design ....
Wordpress 我吾識用 , 感覺太麻煩肋

[ 本帖最後由 form5 於 2019-11-28 07:18 AM 編輯 ]



回覆 引用 TOP

route is using asp.net core middleware pipeline


    public class PageMiddleware
      =>
        async Task Invoke(HttpContext context, IApi api, IApplicationService service)
           =>
              var response = await PageRouter.InvokeAsync(api, url, siteId);

                var page = await api.Pages.GetBySlugAsync<Models.PageInfo>(slug, siteId)
                        .ConfigureAwait(false);

                         =>  get route information

                            return new RouteResponse
                            {
                                PageId = page.Id,
                                Route = route,
                                QueryString = $"id={page.Id}&startpage={isStartPage.ToString().ToLower()}&piranha_handled=true",
                                IsPublished = page.Published.HasValue && page.Published.Value <= DateTime.Now,
                                CacheInfo = new HttpCacheInfo
                                {
                                    EntityTag = Utils.GenerateETag(page.Id.ToString(), lastModified),
                                    LastModified = lastModified
                                }

  



as a result, routing "/about"

 ends up with /page?id=
$"id={page.Id}&startpage={isStartPage.ToString().ToLower()}&piranha_handled=true"



引用:
原帖由 台風中心的救星 於 2019-11-28 08:55 AM 發表

https://youtu.be/F1eQk0ggy-U

咁改,👏
he'd be better to get a 3D printer



回覆 引用 TOP

[隱藏]
引用:
原帖由 台風中心的救星 於 2019-11-29 01:14 PM 發表


PageMiddleware#invoke@params: (a)context, (b)api, (c)service
static context params:       context?->siteId
dynamic context params:     context?->url, service->slugId, api.Pages.GetBySlug(slugId)-> ...
may be, it is better to describe the page "route" in the a picture .

[ 本帖最後由 form5 於 2019-11-29 10:43 PM 編輯 ]



附件

code_trace_page_route2.png(397.31 KB)

2019-11-29 10:42 PM

code_trace_page_route2.png

回覆 引用 TOP

食人魚cms 究竟點樣做到headless ? 


回覆 引用 TOP

引用:
原帖由 有諗辦法 於 2019-11-30 12:35 PM 發表

佢 CMS 個 C 係代表咩呢?官網首頁冇講嘅
C is Content, What is content? In its code representation, you may define content types as BlogArchive, StandardPage and TeaserPage.

     // way to build content types
     var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)
           .AddType(typeof(Models.BlogArchive))
           .AddType(typeof(Models.StandardPage))
           .AddType(typeof(Models.TeaserPage))
           .Build()

Where "*Page" are derived from PageBase,,
Inside the Pages, there are Blocks, Regions,
Inside Regions, there are Fields,
And fields could be image, text, html, markdowntext ..., and yourown custom fields

Now, I'm fully understand what "C" is.



PiranhaCMS comes with interesting modular design, every project has a Module c# file and a IServiceCollections extension, this ServiceCollection will register own Module in the same project, in code

"Piranha.App.Modules.Register<Piranha.WebApi.Module>()"



附件

way_to_register_module.png(105.39 KB)

2019-11-30 11:59 PM

way_to_register_module.png

module_webapi.png(122.18 KB)

2019-11-30 11:59 PM

module_webapi.png

回覆 引用 TOP

食人魚用vue,   唔知 add block 時 vue 同 c# controller 怎樣互動?
有冇人講下呢?



回覆 引用 TOP

[隱藏]
mmh, Piranha.Manager are the core for the block editor


附件

block_select_api_from_vue.png(206.89 KB)

2019-12-3 10:14 PM

block_select_api_from_vue.png

回覆 引用 TOP

伸延閱讀
提示:支持鍵盤翻頁左 右
[按此隱藏 Google 建議的相符內容]