News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Highlight "new topic" button

Started by Dejv, May 28, 2013, 07:08:51 AM

Previous topic - Next topic

Dejv

Hello,

I would like to highlight the "new topic" button like on this forum .... or to add a new button above, good visible for all users.

I havent found any theme modification like this. Is there any?

I am using SMF 1.1.18

Thanks a lot for any hint!

David
SMF 1.1.20

Antechinus

Not hard to do. Which result do you want? Highlighted existing button, or separate new button?

Dejv

Thanks for moving the topic to the right category

I would prefere the easier way so I wont have to redo it again after update. So I guess highlighting the existing text/button without having to change the theme would do it.

Can I do this for this only button in the css ?

Thanks
SMF 1.1.20

Antechinus

Any security patches for 1.1.x wont change the theme anyway, so it shouldn't really matter which option you go for.

To highlight the button with css, you'd need someway of targeting it. Those buttons are in the maintab and mirrortab classes, which are used all over the templates. To target that specific button, there would need to be an id or class specific to a containing element in that template only. That's not hard to arrange, but does mean a minor template edit in two places.

<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>


Change to:

<tr class="new_topic_highlight">
', template_button_strip($normal_buttons, 'bottom'), '
</tr>


There's another example here that would also need to be changed:

<tr>
', template_button_strip($normal_buttons, 'top'), '
</tr>


Then in style.css use:

.new_topic_highlight td:nth-child(3) {background: whatever_you_like;}

Should work in browsers other than IE8.

Advertisement: