0

什麼是最好的方式(DRY)以藏匿的方式獲得當前條目的評論?如何在ExpressionEngine中處理註釋?

到目前爲止,我使用了一個嵌入模板來呈現所有評論和評論表。但是這不起作用 - 並且沒有比嵌入的tempalte更聰明的方法嗎?

{exp:channel:entries channel='news' limit='1' dynamic='on' require_entry='yes' track_views='one'} 
… 
{exp:stash:set name='entry_comments' parse_tags='yes'}{embed='_interactive/comments' channel='{channel_short_name}' comment_total='{comment_total}' {if allow_comments}allow='yes'{/if}}{/exp:stash:set} 
… 
{/exp:channel:entries} 
+0

你在哪裏使用{exp:stash:get name =「entry_comments」}? – Natetronn

+0

另外,如果安裝了其中一個,我會說如果可能的話嵌入一個片段或低變量/模板變量(附加組件)。 – Natetronn

回答

1

gist馬克Croxton酒店是一個文章列表,其中包含評論頁面。它比你在場景中描述的要多一點,但你可能會使用一些概念。