XF 2.2 Resource count code to add into widget

DaveL

Well-known member
Is it possible to grab the code that displays how many resources are available in each catergory and display it in a widget?
resources.webp

If so, would anyone happen to know what this piece of code is?
 
Looking through the code it seems to be this bit:
Code:
    <li class="categoryList-item">
        <div class="categoryList-itemRow">
           
                <span class="categoryList-togglerSpacer"></span>
           
            <a href="/sequences/categories/free-christmas-sequences.5/" class="categoryList-link">
                Free Christmas Sequences
            </a>
            <span class="categoryList-label">
                <span class="label label--subtle label--smallest">77</span>
            </span>
        </div>
       
    </li>

Searching for <span class="label label--subtle label--smallest"> I found the template with this piece of code below:

{$extras.resource_count|number_short}

How do I use that per each resource catergory to get the number of resources per catergory?
 
I've placed this code into a widget
Code:
<div class="node-meta">
                    <div class="node-statsMeta">
                        <dl class="pairs pairs--inline">
                            <dt>{{ phrase('xfrm_resources') }}</dt>
                            <dd>{$extras.resource_count|number}</dd>
                        </dl>
                    </div>
                </div>

Which shows:

seq.webp

Still struggling to work out what I need to add to the code so it reflects a certain resource catergory, such as category 5.......
 
I don't believe that variable exists in the widget template. Add {{ dump(vars()) }} to the widget to be sure.

Many thanks for that.
I've added that to the widget and it only comes back with a very short list. Guessing i'm out of luck.
vars.webp
 
Back
Top Bottom