Please or Register to create posts and topics.

Single topic doesn't have a class

Hi @asgaros

Thank you for this useful forum plugin! I tested it and it works very well.

My problem is that I can’t use it for the purpose I want because I can’t find a class to customize single topics.

Details: I use a sidebar (#secondary) and I want to remove it only for single topics and make #primary wider to give my users more space. Now the forum is good for small talks, that is for chat-like discussions. If you want to write a big story (users will change travel experiences and other) it is not comfortable. Even youtube videos look ugly because the primary section is narrow.

My site has many other activities and I don’t want to change the whole site width because this causes a lot of other problems.

Can we insert a class somewhere to resolve the problem, perhaps in /wp-content/plugins/asgaros-forum/includes/views/topic.php ?

With something like .asgaros-topic I would resolve the problem in this way:

.asgaros-topic #secondary {display:none;}
.asgaros-topic #primary {width:100%}

Thanks in advance!

Hey @george33,

can you please send a screenshot to show exactly where you want to add this class. Did you add your sidebar inside of the forum wrapper? Because your given CSS style would not work if it is outside.

It would be also helpful to send a link to the forum.

Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.

Hi @qualmy91 and thanks for your reply.

I use the twentyseventeen theme and I didn’t modify the #content.site-content .wrap whose max-width is 1000px. So with the sidebar the #primary gets really narrow, but it is convenient for the rest of the site.

I added the sidebar at the end of page.php  screenshot

I didn’t add a class for topics, because I don’t know where to add it. I tried with /wp-content/plugins/asgaros-forum/includes/views/topic.php but I don’t know how to do it the right way.

Putting a link to my forum doesn’t help because the site is private. So here are two screenshots:

screenshot1

screenshot2

Thanks again for your time!

Hey @george33,

the problem is that your sidebar is outside of the Asgaros Forum which is always inside of a div container:

<div id="af-wrapper">
   // Asgaros Forum
</div>

So even if there is a class for the topic it’s not possible to address the #primary or #secondary selector.

 

Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.
Quote from qualmy91 on June 19, 2020, 4:13 am

Hey @george33,

the problem is that your sidebar is outside of the Asgaros Forum which is always inside of a div container:

<div id="af-wrapper">
   // Asgaros Forum
</div>

So even if there is a class for the topic it’s not possible to address the #primary#primary or #secondary#secondary selector.

 

OK, I see now how it works. I was using bbpress which has selectors at “body” level for practically anything and I was expecting something similar. Never mind, I will find a workaround by reducing the padding of #content.site-content .wrap of the theme. Thanks again!

Hey @george33,

sorry for my short reply yesterday – I was really busy.

To implement the functionality you wanted, a small change in the code of Asgaros Forum was necessary. I have changed that now and am waiting for a review and approval from Thomas (@asgaros). If all goes well the change should be included in the next update of Asgaros Forum.

With this change all pages of the forum would have the classes asgaros-forum and asgaros-forum-{name_of_view} in the body tag. So you have the possibility to realize every change you want for every different view. In your case it would be the class  .asgaros-forum-topic .

Pull Request at GitHub:
https://github.com/Asgaros/asgaros-forum/pull/270/

 

Asgaros and george33 have reacted to this post.
Asgarosgeorge33
Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.

Oh, it would be wonderful, if these classes are included. Thank you very much @qualmy91 and @asgaros

Hello @qualmy91 @george33

I just merged the pull-request into the dev-version. It will be included in the upcoming update soon! 🙂

george33 has reacted to this post.
george33
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!