AnsweredAssumed Answered

Specifying view='... for a metadata template issue

Question asked by marcus.svensson on Dec 12, 2012
Hey,

Have anyone noticed that specifying a view="…" to something other than simple or detailed (for custom created views) won't work on a <metadata-templates> block in share-config-custom.xml?

My case:
I've defined a new view renderer called newdetailed.

I would like to customize the metadata template for this view renderer, so I thought it would be enough to add the metadata-templates block in the share-config-custom.xml for my own view like this:

 <metadata-templates>
         <!– Default (fallback) –>
         <template id="default">
            <banner index="10" id="lockBanner" evaluator="evaluator.doclib.metadata.hasLockBanner">{lockBanner}</banner>
            <banner index="20" id="syncTransientError" evaluator="evaluator.doclib.metadata.hasSyncTransientErrorBanner">{syncTransientError}</banner>
            <banner index="30" id="syncFailed" evaluator="evaluator.doclib.metadata.hasSyncFailedBanner">{syncFailed}</banner>
            <line index="10" id="date">{date}{size}</line>
            <line index="20" id="description" view="newdetailed">{description}</line>
            <line index="30" id="tags" view="newdetailed">{tags}</line>
            <line index="40" id="categories" view="newdetailed" evaluator="evaluator.doclib.metadata.hasCategories">{categories}</line>
            <line index="50" id="social" view="newdetailed">{social}</line>
         </template>
</metadata-templates>

Doing that will do nothing for my view renderer newdetailed, the extra fields will be hidden. Simply omitting the view="…" attribute will show the attributes on all views.

How would I make certain lines only appear for a certain custom view renderer?

Thanks!

Outcomes