How to modify the contents of Signed In As Box

  • Affected Version
    WoltLab Suite 3.1

    Hey guys,

    I'm trying to modify the Signed In As box. I'm able to adjust the title in the AdminCP, but i'd like to change what is displayed.

    For example:



    It currently displays: Developer Logs, Posts, Images, Videos, Points.

    I'd like to make it:

    Developer Logs
    Albums (I call them projects in my site)
    Posts
    Points


    I can not find where I can customize this box. Any help would be awesome! Thank you!

  • This box uses the regular sidebar lists to show some of the statistics, unfortunately it does not include the number of albums. However, it can be easily added using a custom template copy with as little as 4 lines of extra code. Do you want to include the album counter everywhere (including message sidebars) or just in the "Signed In As" box?

  • I'm sorry, but while I was writing down the changes that need to be made to the template, I just realized that we do not track the number of albums, instead there is only a static method Album::hasAlbums(), which returns a boolean.

    I'll see if I can add a new static method that instead returns that count, but it would arrive with the next update earliest and has the down-side of querying the user storage. This would potentially causing new SELECT queries to be executed on-the-fly in case the requested data does not yet exist in the user storage cache. It would be a bit of a hacky solution and while it wouldn't be a suitable path for the general public, you would be able to include it at your own discrection and see how it works. I don't expect it to have any serious drawbacks, but its too hacky to be something we can recommend to everyone ;)

  • I'm sorry, but while I was writing down the changes that need to be made to the template, I just realized that we do not track the number of albums, instead there is only a static method Album::hasAlbums(), which returns a boolean.

    I'll see if I can add a new static method that instead returns that count, but it would arrive with the next update earliest and has the down-side of querying the user storage. This would potentially causing new SELECT queries to be executed on-the-fly in case the requested data does not yet exist in the user storage cache. It would be a bit of a hacky solution and while it wouldn't be a suitable path for the general public, you would be able to include it at your own discrection and see how it works. I don't expect it to have any serious drawbacks, but its too hacky to be something we can recommend to everyone ;)


    That makes sense. And awesome. Thank you!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!