Get ReusableHTML from reusable content via Content query webpart
-
16-10-2019 - |
Pergunta
I'm trying to create a view of stuff from my reusable content list. Basically I am storing global links within the reusable content list.
I'm struggling with the content query webpart, because it always shows me the LINK to the item in the reusable content list - what I want it to show is the ReusableHTML Column of the specific item in the list.
I tried doing so with
<property name="DataColumnRenames" type="string">ReusableHtml,Reuse</property>
<property name="CommonViewFields" type="string">ReusableHtml,Text</property>
But somehow the CQWP doesn't display anything when using these two properties.
My reusable content list basically looks like so:
Title ReusableHTML
Static 1 <a href="#">Link 1</a>
Static 2 <a href="#">Link 2</a>
And basically I want to display these global links via the masterpage of my site - easily editable for the end user in the reusable content list.
Anyone up for a .webpart file or could show me another tutorial, because the MS tutorial here did not help me.
Solução
Try this:
<PublishingWebControls:ContentByQueryWebPart
runat="server"
WebUrl="~sitecollection/"
ListName="Reusable Content"
ServerTemplate="100"
DataMappings="Reuse:ReusableHtml,ReusableHtml,HTML;"
DataMappingViewFields="Title,Text;ReusableHtml,HTML;"
... >
</PublishingWebControls:ContentByQueryWebPart>