I'm working with several energy companies and we routinely need to use the term CO2 in titles, and the '2' should be subscript. Adding in the appropriate tag just outputs everything (e.g. CO<sub>2</sub>). Any way to allow for this? I have custom fields set up on page templates so we can do it in headers, etc., but not in the News module, which makes for inconsistent content.
CMSMS 2.2.7
News 2.51.3
HTML in News Title?
Re: HTML in News Title?
Simple workaround:
Create a new user defined tag named 'CO2'
Code:
In your news articles then use {CO2} where you want this text to appear.
In your news templates make sure to use {eval ...} on the news content. E.g.
This {CO2} tag can be used in content too.
Create a new user defined tag named 'CO2'
Code:
Code: Select all
echo 'CO<sub>2</sub>';
In your news templates make sure to use {eval ...} on the news content. E.g.
Code: Select all
{eval var=$entry->content}
-
- New Member
- Posts: 7
- Joined: Thu Apr 28, 2016 10:56 pm
Re: HTML in News Title?
Perfect - thank you! For anyone following this thread just make sure to put the 'eval var=$entry->…' wherever you want to use this. For example:
In the {content} area of News, use {eval var=$entry->content}.
In the Title, use something like {eval var=$entry->title}, or {eval var=$entry->title|cms_escape}.
Works like a charm, just remember to add the 'eval var=$entry->…' to ALL of the templates used - summary, special use summary like summary-home, detail, etc. or you'll see curly brackets showing up.
Thanks again velden.
In the {content} area of News, use {eval var=$entry->content}.
In the Title, use something like {eval var=$entry->title}, or {eval var=$entry->title|cms_escape}.
Works like a charm, just remember to add the 'eval var=$entry->…' to ALL of the templates used - summary, special use summary like summary-home, detail, etc. or you'll see curly brackets showing up.
Thanks again velden.