Beate Posted January 23, 2018 Share Posted January 23, 2018 I have a problem with templates. In the header of my german/english page is sentence with html tags, as some words are smaller than others. And every page should have another sentence, but some might have the same. And it should be selectable for the user, so putting it directly in the template is no solution. I tried using the select option field, which can also have i18n options, but the html in the options is escaped.. so „A <span>journey</span> to <span>yourself...</span>“ is on the page. This is what I inserted in my template: if ($page->headersatz) echo $page->headersatz->value; Any ideas? Or any better idea? Thanks! Link to comment Share on other sites More sharing options...
Macrura Posted January 23, 2018 Share Posted January 23, 2018 you could use like mini bb edit tags, e.g. [span] and [/span] so they don't get escaped; then you can replace those on output.. Link to comment Share on other sites More sharing options...
Beate Posted January 23, 2018 Author Share Posted January 23, 2018 Thanks! Nice idea and it works Link to comment Share on other sites More sharing options...
kongondo Posted January 23, 2018 Share Posted January 23, 2018 (edited) Alternatively... echo "<div id='options'>" . $page->getUnformatted('options')->title . "</div>"; // the <span></span> render correctly as HTML (unescaped) https://processwire.com/api/ref/page/get-unformatted/ Edited January 23, 2018 by kongondo 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now