1. 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...

Discussion in 'Styling and Customization Questions' started by rhodes, Dec 16, 2014.

  1. rhodes

    rhodes Active Member

    ...to community/recent-activity/ or the newest-post pages (for example a twitter widget) ?

    Regards, rhodes
     
  2. TJA

    TJA Well-Known Member

  3. rhodes

    rhodes Active Member

    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?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to seek support in the add-on thread.
     
  5. rhodes

    rhodes Active Member

    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?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You can edit the template directly.

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

    rhodes Active Member

    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.
     

Share This Page