2016-11-01 4 views
0

나는 기초가있는 템플릿이 있습니다. 다음은이 켜지지 조각입니다 :thymleaf가있는 전자 메일 기초 사용

나는 'HREF'는 '일 : HREF'로 속성을 교체 할 필요가
<button class="large expand" href="#">Activate account</button> 

속성을하지만, 내가 할 때이 재단은 일하지 않고 HTML 페이지를 구축 : HREF 태그입니다.

나는 thymleaf로 href-link를 변경하는 방법을 찾고 있습니다.

참고 : foundation-email 스택을 사용하고 있습니다.

답변

1

맞춤 속성을 처리하는 방법을 Inky에게 가르 칠 수 있습니다.이 경우에는 번 : href이라고하는 속성을 처리 할 수 ​​있습니다.

노드 모듈 폴더에서 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); 
    } 

가 작동 희망!