Is there a way to fetch the label of a field in the tpl?Thanks.
Is there a way to fetch as what TS version you are using and on what platform?
Not without some coding. PT parses DCRs and DCRs retain only Values, not Labels.You can for example get your Label in FormAPI onSave and populate DCRs' hidden Item, etc.Alternatively you may find/parse corresponding DCT from your presentation template but the firstoption is IMO much easier to implement
But seriously, architecturally the second option looks clearer to me.
I agree, formally It looks clearer to me as well.One unpleasant complication of this approach is an 'inline' though. Imagine that you want a selected drop-down Entry label that has beengenerated by an inline. Granted, you can recognize the fact on parsing and re-run inline yourself from the PT. If however correspondinginline script uses run-time Environment you are doomed
true. especially for me, I like inlines for DCTs However, all could be tied to a specific implementation. E.g., if I use, say, .ipl's to produce DCTs, the same IPLs could produce a non-runtime DCT that will be suitable for parsing purposes (or, even better, write up a hash table that will have XPATH of elements as keys and corresponding labels as values).
Agree again - we are on the same Page!Let me play Devil's advocate though. It's easy to come up with the scenario where this non-runtime persistent Component of yours should be tied to the DCR, not DCT (User-dependent processing, and the like). That's the problem, within the inlineDCR is never known, it may not even exist yet. That is certainly a poor Design but then a Design where you need a Label in thePT IS a poor Design to begin with!