Avatar
0
tvd12 Enlightened
tvd12 Enlightened
Khai báo biến slug và sử dụng biến slug này để gọi hàm lấy tiêu đề trang trong thymeleaf
Tôi đã có:
slug=')}
Làm thế nào để sử dụng nó trong hàm ezyfunctions.call('get_post_title_by_slug' để lấy tiêu đề trang?
  • Answer
thymeleaf
Remain: 5
1 Answer
Avatar
tvd12 Enlightened
tvd12 Enlightened
Bạn có thể sử dụng thẻ th:block với thuộc tính th:with như sau:
<th:block th:with="slug=')}, pageTitle=')}">
    <title>[[]]</title>
    <meta name="title" th:content="" />
    <meta property="og:title" th:content="" />
    <meta property="og:site_name" th:content="" />
</th:block>
  • 0
  • Reply