XF 2.2 HTML Widget won't update

Phil Dart

New member
I'm trying to implement an html widget, to display on a home page. The home page doesn't exist yet, but I'm testing the widget in a discreet little dusty corner that won't get seen that often.

I've found some very useful information on this forum about how to set up the widget, and I'm pretty confident I've done it correctly. It certainly shows up in the place I've put it, but I have a problem with it that I can't seem to overcome...

It doesn't update.

It's simple html code to feature a single image from a chosen thread, with a link on the image to the thread itself. There is also some text to name the user whose thread it is. The issue is that when I alter and save the template, the content of the displayed widget doesn't change. Not even the text changes. I'm pretty sure this must be pilot error on my part, or a mis-undertanding of how it's supposed to work, but is someone able to point me in the right direction please?

I would also like to be able to tag the user named in the text, but I'm not if that's possible in an html widget.

Perhaps I'm approaching this from completely the wrong angle, and it could be that an html widget is the wrong way to go, but if anyone has any advice it would be greatly appreciated.
Thanks very much for your reply Nicholas.

The not updating thing seems to have sorted itself out. Don't ask me how, but I am now able to see changes that I've made.

Re the tagging thing, thanks for the code, but can you tell me how to incorporate it please? Assume I'm an idiot when it comes to these things and you won't be far wrong.

I have some text between <p> tags, which basically tells people who the maker is of the item in the photo.
So, I've naively added your code after my text, before the closing </p> and substituted username for, well, the username.

<p>my text <xf:username user="{$xf.visitor.username}" notooltip="true" /> some more text</p>

That's clearly not correct however.

Basically, I'm trying to achieve "my text @Username some more text" where @Username is the name of a specific user, typed in by me.
Last edited:
Yep a straightforward link works, but there's no tag for XF to recognize. I'd really prefer to use a proper username tag, with a tool tip, but I don't know how to incorporate the first code you gave me, or even if it's possible to do
The tag I gave you is to display the username of the member visiting the page not to display the username who created the content. To display the user name that created the content is a different variable but I lack information to know which one exactly: where do the photos come from? From XF Media Gallery? From posts? etc...
The photo will be from a post, and it will be changed manually each week.
The title for that photo will comprise in part, of the name of the thread. I'll create a link to the post itself on both the title and the photo, but I just want to be able to type in the username manually within that title, and have it show up as a @ tag, and thereby benefit from all that goes with that tag on XF
Progress! I' think I've found the right piece of code (I've been using the wron terminology it seems _ i've been referring to tagging, whereas I should have been referring to mentions)

{{ username_link({'username': 'Username', 'user_id': 1}) }}

However, I still have no idea how to implement it in my html widget
Thanks Brogan

I found another code too

{{ bb_code('Username', 'widget', $widget) }}

It's amazing what turned up when I started calling Mentions by their correct name

I've got both versions to work, and the problem is now sorted. Thank you Nicholas and Brogan for your help.
Top Bottom