Results 1 to 2 of 2

Thread: How do you add items other than Top and Latest Stories in the tabbed sidebar?

  1. #1
    Senior Member
    Join Date
    Sep 2009
    Posts
    429
    Thanks
    159
    Thanked 54 Times in 41 Posts

    Default How do you add items other than Top and Latest Stories in the tabbed sidebar?

    I was playing around with the Tabbed Sidebar Posts Box tutorial and I was just wondering if we can add items like "Latest Activity" as an item in the tabbed sidebar other than just Top Stories and Latest Stories? Or say, an external javascript code in one of the tabs?

    /sorry for posting this here, I didn't have permission to post a reply on that thread.

  2. #2
    Former lead dev Nick's Avatar
    Join Date
    Jun 2009
    Location
    Kakamigahara, Japan
    Posts
    2,869
    Blog Entries
    88
    Thanks
    481
    Thanked 806 Times in 526 Posts

    Default

    This is the right place for discussing the documentation.

    Yes, it is possible to add Latest Activity, Comments, or anything in different tabs. In the case of Activity, you might want to look at the sidebar_widget_activity method in the Activity class (plugins/activity/activity.php). You'd first need to check if that file exists, and then create an object of type Activity with $act = new Activity($hotaru); Then you can use $act to call other methods like $act->getSerializedSettings('activity'); $act->getLatestActivity(10); and $act->getSidebarActivityItems($activity, $activity_settings);

    All Hotaru plugins are classes, so you can create an object of any of them to include in your tabbed sidebar box. JavaScript can be added easily just by pasting it into your tabs template. The biggest difficulty (at least for me) is the css/jQuery you need to display and change tabs.

    Note that from Hotaru 0.9, this line in the documentation will be changed from:
    PHP Code:
    $sbp = new SidebarPosts('sidebar_posts'$hotaru);  // provides access to SidebarPosts functions 
    to
    PHP Code:
    $sbp = new SidebarPosts($hotaru);  // provides access to SidebarPosts functions 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Docs] Setting Up Posts Widgets
    By Nick in forum Getting Started with Hotaru CMS
    Replies: 0
    Last Post: 11-18-2009, 07:56 AM
  2. [Docs] Making a Tabbed Sidebar Posts Box
    By Nick in forum Archived Docs
    Replies: 0
    Last Post: 10-20-2009, 01:33 PM
  3. Replies: 1
    Last Post: 09-08-2009, 04:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •