Is it possible to use dynamic keys in dust js?

65 views Asked by At

my .properties file (test.properties):

something.10.header=helloWorld
something.12.header=holaWorld

my.dust file: (here 'id' is the dynamic value ; it can be either 10 or 12 based on which the different content should render)

{@useContent bundle="test.properties"}
    <p>{@pre type="content" key="something[id].header" /}</p>
{/useContent}

But Unfortunately, UI breaks and I dont get either of them. This seems like a basic requirement and yet I can't find much help on the same.

0

There are 0 answers