2016-04-15 8 views
0

私は次のことを行っている:ジェイド・デフォルト・コンテンツ

mixin article(newTitle) 

#title 
    if (newTitle) 
     newTitle 
    else 
     block article-block-title 
#content 
    if block 
     block 
    else 
     block article-block-content 

block article-block-title 
    Default title text 

block article-block-content 
    Default content text 

だから私は

+article //Will render the Default article 

+article // Should render default title and new content 
    p Some more content 

+article("New Title") // Should render the new title and the default content 

+article("New Title and Content") // Should render a new article 
    p Some more content 

のように私のホームページ上でこれを使用することができます。しかし、それは働いていません。デフォルト値はレンダリングされず、ブロックのみがレンダリングされます。新しいタイトルは渡されていません。すべての手がかりは?

答えて

0

私が知っている限り、テンプレートを拡張することによってのみブロックを上書きできます。デフォルト値は直接宣言する必要があります。

mixin article(newTitle) 

    #title 
     if (newTitle) 
      newTitle 
     else 
      Default title text 

    #content 
     if block 
      block 
     else 
      p Default content text 
関連する問題