Forum Discussion
5 Replies
- VenkS12 years agoLithium Alumni (Retired)
I'm not sure if this is possible, but one way to check would be to use the "Show Text Keys" option in the Advanced tab under the Text Editor in Studio. Are you familiar with this functionality?
- Inactive User12 years ago
Yes, I'm familiar with it but it doesn't help since currently, there doesn't seem to be any category specific ones. Can you think of another way around this problem if the functionality doesn't exist?
An example of our use case is that we want to call a blog article in one category a "story" in all the text keys and an "article" in the others.
- VenkS12 years agoLithium Alumni (Retired)
You can write a custom component and include it on the page where you want this information shown. In that custom component, you can either look up the name of your article via freemarker (or even through JS), and then use JS to change the name. Not ideal I know, but given your use case, it should have a fairly small overhead.
The disadvantage here is that if someone has a slow connection (so the page loads slowly for them), they might notice the text switch. Also, is localization involved? That might add an extra layer to check for.
VenkS wrote:The disadvantage here is that if someone has a slow connection (so the page loads slowly for them), they might notice the text switch. Also, is localization involved? That might add an extra layer to check for.
We've worked around this issue by using CSS to hide the element in question on that specific page, then JS does its work you reveal the element. This way you won't see the text change on screen. The down side is that if JS is disabled the text doesn't appear at all, but without JS most pages fail to function anyway so its a safe enough bet.
- VenkS12 years agoLithium Alumni (Retired)That sounds like a great plan, glad the idea worked out for you!
Related Content
- 3 years ago
- 2 years ago
- 11 months ago