IT & 블로그
위젯 이름 앞에 폰트어썸 아이콘 넣기
- 위젯 꾸미기
위젯 타이틀에 폰트어썸 아이콘을 넣으려면 먼저 대시보드 > 테마 > 맞춤설정 > HTML 편집으로 들어간다.
그리고 아래와 같은 기본마크업 위치로 찾아간다.
여기서 사이드 위젯의 제목이 만들어진다.
위젯의 수만큼 반복되기 때문에 위젯마다 다른 아이콘을 넣기 위해서는 조건문을 써야 한다.
<b:defaultmarkups>
<b:defaultmarkup type='Common'>
<b:includable id='widget-title'>
<b:if cond='data:defaultTitle or data:title'>
<div class='widget-title'>
<h3 class='title'>
<b:if cond='data:title == "Info"'><i aria-hidden='true' class='fa fa-info'/></b:if>
<b:defaultmarkup type='Common'>
<b:includable id='widget-title'>
<b:if cond='data:defaultTitle or data:title'>
<div class='widget-title'>
<h3 class='title'>
<b:if cond='data:title == "Info"'><i aria-hidden='true' class='fa fa-info'/></b:if>
<b:if cond='data:title == "Search"'><i aria-hidden='true' class='fa fa-search'/></b:if>
<data:title/>
</h3>
</div>
</b:if>
</b:includable>
</b:defaultmarkup>
<b:if cond='data:title=="Info"'> 태그는 위젯의 제목이 Info와 같으면 태그 사이의 내용을 표시하라는 조건문이다.
위 조건문을 응용해서 계속 추가하면 위젯마다 원하는 아이콘을 넣을 수 있다.
폰트어썸 아이콘 사용법은 여기에 설명되어 있다.

댓글 쓰기
0 댓글