如何从 cmsfn.link 的输出中删除 .html 扩展名?
How do I remove the .html extension from the output of cmsfn.link?
cmsfn.link
模板函数在其输出中包含一个 .html
扩展。
例如:
${cmsfn.link(exampleNode)}
输出:
https://examplesite.com/example-page.html
如何删除 .html
扩展程序?
遗憾的是,这无法通过 Magnolia 配置和 Magnolia "won't be able to address this issue in the foreseeable future" 完成。但是 FreeMarker 内置了三个选项:
选项 1:replace
${cmsfn.link(exampleNode)?replace(".html", "")}
选项 2:split
${cmsfn.link(exampleNode)?split(".html")[0]}
选项 3:remove_ending
${cmsfn.link(exampleNode)?remove_ending(".html")}
cmsfn.link
模板函数在其输出中包含一个 .html
扩展。
例如:
${cmsfn.link(exampleNode)}
输出:
https://examplesite.com/example-page.html
如何删除 .html
扩展程序?
遗憾的是,这无法通过 Magnolia 配置和 Magnolia "won't be able to address this issue in the foreseeable future" 完成。但是 FreeMarker 内置了三个选项:
选项 1:replace
${cmsfn.link(exampleNode)?replace(".html", "")}
选项 2:split
${cmsfn.link(exampleNode)?split(".html")[0]}
选项 3:remove_ending
${cmsfn.link(exampleNode)?remove_ending(".html")}