-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get dynamic title content working w/ limitations
- Loading branch information
Showing
7 changed files
with
99 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...et/ultraq/thymeleaf/layoutdialect/decorators/html/TitleTokens-DynamicContentThText.thtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
# Test using standard Thymeleaf expression syntax for title elements. | ||
|
||
%TEMPLATE_MODE HTML | ||
|
||
%CONTEXT | ||
layoutTitle = "My website" | ||
contentTitle = "My blog" | ||
|
||
%INPUT | ||
<!DOCTYPE html> | ||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||
layout:decorate="~{Layout}"> | ||
<head> | ||
<title th:text="${contentTitle}" layout:title-pattern="|${layoutDialectContentTitle} - ${layoutDialectLayoutTitle}|">Content title</title> | ||
</head> | ||
<body> | ||
<p th:text="${layoutDialectContentTitle}">I can use the content title here too!</p> | ||
<p th:text="${layoutDialectLayoutTitle}">I can use the layout title here too!</p> | ||
</body> | ||
</html> | ||
|
||
%INPUT[Layout] | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title th:text="${layoutTitle}">Layout title</title> | ||
</head> | ||
</html> | ||
|
||
%OUTPUT | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>My blog - My website</title> | ||
</head> | ||
<body> | ||
<p>My blog</p> | ||
<p>My website</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters