XF 2.2 Category Widget

Lee

Well-known member
Hi, me again.

Just wondering if anybody can point me in the right direction here.

I am looking to create a widget which returns a specific category (widget option) and the nodes associated with it, respecting permissions.

I would need the following data:

Node Name and unread / read status. I am not really bothered about other data. This widget would be placed in the forum_view template.
 
I have found this variable which contains the data I need.

I know I can access it with $__globals.nodeExtras.16.hasNew but is there a way to use $node_.node_id to dynamically show this data?
IMG_1395.webp
 
I don't really understand what you are trying to do but the easiest way to find out if the data you want is available on a specific page is to create an html widget and dump all vars in the widget template.

Then view the page with the widget on.

If the vars aren't available then it's going to require some code to pass them.
 
That is the dump from my widget.

Im looking to build the variable something like: {$__globals.nodeExtras.{$node.node_id}.hasNew} but that doesn’t seem to work.
 
I might be being dense, but how would I use that code?

I see it filters the result to the first entry, I want to filter by node.node_id.
 
I got the variable I needed by doing this: {{$__globals.nodeExtras.{{$node.node_id}}.hasNew}}
 
Top Bottom