RM 2.2 Resource Manage - Show custom fields on forum view

DaveL

Well-known member
Hi,
I've seen people manage this for normal threads, however was hoping someone might have done something similar for the resource manager.
I want to be able to output the custom field data where the red box is shown.


cf.webp

Any help greatly appreciated.
 
Solved!
For anyone else looking to do the same, in xfrm_resource_list_ macros, below
Code:
<a href="{{ link('resources', $resource) }}" class="" data-tp-primary="on">{$resource.title}</a>
                <xf:if is="$resource.isVersioned()">
                    <span class="u-muted">{$resource.CurrentVersion.version_string}</span>
                </xf:if>
                <xf:if is="$resource.isExternalPurchasable()">
                    <span class="label label--primary label--smallest">{$resource.price|currency($resource.currency)}</span>
                </xf:if>
            </div>

I added

Code:
 <b>Song Name:&nbsp</b>{$resource.custom_fields.sname} | <b>Artist:</b>&nbsp{$resource.custom_fields.artist}
 
Just a quick question following on from the above. Just realised there will be some resources where I don't require this to be displayed. Can any any help with the <if> code that I need to put around it please?
 
Assuming there is more than one resource you want to prevent it showing for, wrap it in this:

HTML:
<xf:if is="!in_array($resource.resource_id, [1, 2, 3])">
    ...
</xf:if>

Replace the values with the resource IDs.
 
Top Bottom