Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
991 views
in Themes by

Some users already asked how to use the on-site-notifications plugin together with the new snow flat theme. Problem is that the (N) notification icon is only be visible when clicking on the avatar. However, they want it next to the avatar: http://www.question2answer.org/qa/40528/to-display-on-site-notifications-plugin-somewhere-else

I have seen that the theme has one public function nav_user_search() that is adding the avatar and the user data into a dropdown. Can somebody help me out and advice how i can "access"/extend or even change this function using the plugin?

 

PS: I think it is not a good idea to hide the buttons under the admin image. E.g. if a user wants to check his points, he has to click the avatar first. If a user wants to see his updates, he has to click the avatar first etc.

Q2A version: 1.7 beta

1 Answer

+2 votes
by
Does this do the trick?
 
public function nav_user_search() {
    qa_html_theme_base::nav_user_search();
    echo '<span style="float: right; margin-right: 5px">[N]</span>';
}
 
 
Of course, change the CSS to whatever you need. Actually, you'll have to change it to support all media queries.
 
Additionally, as this will change your HTML structure this might break the way it currently looks in other themes. I would advice against changing the HTML structure and in favor of only changing CSS when switching between themes.
 
Plan B would be to move the [N] using jquery... that way you'll be dynamically modifying the DOM while keeping the original HTML intact... kind of dirty, if you asked me.
 
As a side note, I also find it annoying having to make a click to see my points :@
by
Ah, as I see now, there is no "only CSS" solution, as the (N)otification icon is within the div that gets hidden by the snowflat theme... i try something else.
by
It is not possible to fix this only using CSS. You'll have to change the HTML for sure (that's what the "nav_user_search" function I've added does) OR maybe change the DOM dynamically (plan B stated above)
by
Yep, jquery is my friend:     $("#osnbox").detach().appendTo(".qam-account-items-wrapper"); to get the box out of the drop down :)
...