• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 How can I add a custom sidebar block...

rhodes

Active member
#3
Hey @TJA,
thank you for your quick reply. I use widget framework already but I'm not sure which hook I should write to the position field in this case. The block/widget should only appear on newest-post and recent-activity. Any ideas?
 

rhodes

Active member
#5
OK, fine. But if I don't use widget framwork is there a template for the recent activity page I can modify or do I have to write a custom controller?
 

Brogan

XenForo moderator
Staff member
#6
You can edit the template directly.

The FAQ in my signature explains how to identify the name of the template.
 

rhodes

Active member
#7
Thank you @Brogan , that's easy. I love the xf template system.

Just in the case s.o. also wants to add a widget to the sidebar of the recent-activity stream page, that's how I did it.
  • edit template news_feed_page_global

  • find the sidebar closing tag
    </xen:sidebar>

    you can place your html here directly but if you want to use widgets just define a new hook:

    <xen:hook name="recent_activity_sidebar" />
    </xen:sidebar>
  • now you can use this hook in the widgets setup form
  • if you write
    forum_list,hook:recent_activity_sidebar
    in the widgets position field, the widget will appear in the forum list sidebar and in the sidebar of the recent activity page.