2016-11-01 11 views
0

私は土台テンプレートを持っています。ここでneccessaryスニペットは次のとおりです。thymleafを使用した電子メールの基礎を使用

<button class="large expand" href="#">Activate account</button> 

私は「目:HREF」で「のhref」属性を交換する必要がある属性が、私はやるときは、この基盤は、第せずにHTMLページを作成します:HREFタグ。

私はthymleafでhref-linkを変更する方法を探しています。

注:私はfoundation-emailスタックを使用しています。

答えて

1

カスタム属性の処理方法を教えてください。この場合は、 という名前のものがあります:href

node-modulesフォルダにinky/lib/componentFactory.jsを開きます。ボタンコンポーネントを探して、あなたはこのような何かを見つけることができます:

// <button> 
case this.components.button: 
    var expander = ''; 

    // Prepare optional target attribute for the <a> element 
    var target = ''; 
    if (element.attr('target')) { 
    target = ' target=' + element.attr('target'); 
    } 

    // If we have the href attribute we can create an anchor for the inner of the button; 
    if (element.attr('href')) { 
    inner = format('<a href="%s"%s>%s</a>', element.attr('href'), target, inner); 
    } 


    // If the button is expanded, it needs a <center> tag around the content 
    if (element.hasClass('expand') || element.hasClass('expanded')) { 
    inner = format('<center>%s</center>', inner); 
    expander = '\n<td class="expander"></td>'; 
    } 

    // The .button class is always there, along with any others on the <button> element 
    var classes = ['button']; 
    if (element.attr('class')) { 
    classes = classes.concat(element.attr('class').split(' ')); 
    } 

    return format('<table class="%s"><tr><td><table><tr><td>%s</td></tr></table></td>%s</tr></table>', classes.join(' '), inner, expander); 

は、次のコードブロックを追加します。

 // If we have the th:href attribute we can create an anchor for the inner of the button; 
    if (element.attr('th:href')) { 
    inner = format('<a th:href="%s"%s>%s</a>', element.attr('th:href'), target, inner); 
    } 

は、それが作品を願って!

関連する問題