Smarty Language Modifiers

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
GOAL: Add Smarty "language.modifier.capitalize" to existing skin language text.
When trying to change the case of language text below:
Orignal Works = {jrCore_lang skin="jrNinja" id="8" default="About"}
--
This Gives Error = {jrCore_lang skin="jrNinja" id="8" default="About" |capitalize}

How to correctly add smarty "language.modifier.capitalize" ( |capitalize) onto the Orginal smarty code above?
updated by @softdesigns: 09/30/17 12:26:53AM
paul
@paul
7 years ago
4,326 posts
Something like this should work -
{jrCore_lang skin="jrNinja" id="8" default="About" assign="x"}
{$x|capitalize}

hth


--
Paul Asher - JR Developer and System Import Specialist
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@paul - Thanks, now there is no Smarty error. However Smarty modifier seems to have no effect, still outputs "AUDIO" in the widget title. How to change output = "Audio" ( Camel Case ) ?
--
Skin = Ninja : Using Site builder About widget
--
See Image: https://www.screencast.com/t/8FJlkzyW
--
Please Advise...
updated by @softdesigns: 06/29/17 09:43:20AM
douglas
@douglas
7 years ago
2,790 posts
SoftDesigns:
@paul - Thanks, now there is no Smarty error. However Smarty modifier seems to have no effect, still outputs "AUDIO" in the widget title. How to change output = "Audio" ( Camel Case ) ?
--
Skin = Ninja : Using Site builder About widget
--
See Image: https://www.screencast.com/t/8FJlkzyW
--
Please Advise...


I believe you can use HTML and CSS in the title field too, so try something like this:

<span style="text-transform:capitalize;">{jrCore_lang skin="jrNinja" id="8" default="About"}</span>

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@douglas: Yes, that worked, cool...
--
Sometimes confusing when to use CSS, HTML, or Smarty tags...
--
In this case HTML / CSS worked - final solution:
<span style="text-transform:capitalize;">{jrCore_lang skin="jrNinja" id="8" default="About"}</span>
Great Support
updated by @softdesigns: 06/29/17 11:37:45PM
michael
@michael
7 years ago
7,714 posts
If the original input was 'About' but you actually got 'ABOUT' then its likely that CSS is effecting that change too. Perhaps look for the base cause and remove that instead of forcing another layer of CSS changes onto it.

CSS: "Make all of these all-caps, then make this one capitalize." vs "(do nothing, use original input)"
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael - Yes, you are correct, we added another layer of CSS.
If this was a custom module, we could find the CSS quickly, in the CSS folder.
However, since this is SiteBuilder Widget, where to find that original CSS code?
--
Skin = Ninja : Using Site builder default "About" widget
--
See Image: https://www.screencast.com/t/8FJlkzyW
--
Where to find original Site Builder Widget CSS code?
michael
@michael
7 years ago
7,714 posts
need to know the URL to tell you exactly, here's a guess: (screenshot)
captialize.jpg
captialize.jpg  •  118KB

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael : Thanks so much for taking time and teaching us JR platform.
--
We want to learn, and really understand this powerful JR platform.
--
Let me find the exact URL, and then will create a private ticket to you on this soon...
--
Great Support - In Progress...

Tags