• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Add-on Button "Post-New-Thread" at Homepage

erich37

Well-known member
#5
preferably having separate "CSS-classes" for each Forum-Node and for each button.
So you could make different colors for each Forum-Node (Category Strip) and also for each "Post New Thread"-button.


Example:

- "Category-Strip" has a green color.
- "Post New Thread"-buttons in the same Category also have a green color.


Code:
PostNewThreadButton.ForumNode.22 .nodeList .categoryStrip {
    background: green;
}
Code:
PostNewThreadButton.ForumNode.22 a.callToAction span {
background: green;
}
:)
 
Last edited:

Russ

Well-known member
#6
I mean you don't really need an add-on for it, easy template editing.

Find this inside the template: node_forum_level_2
Code:
<div class="nodeControls">
Add this right above it:
Code:
    <a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
Extra.css:

Code:
.node_15 .callToAction > span
{
   background-color: #ff0000;
}
@media (min-width:1000px)
{
   .nodeList .nodeList .node { position: relative; }
   .forum_list .node .callToAction { position: absolute; right: 0; top: 15px; }
   .nodeList .node .nodeLastPost { right: 117px; }
   html .node .nodeControls { right: 365px; }
}
@media (max-width:1000px)
{
   .forum_list .node .callToAction { margin-bottom: 12px; margin-left: 30px; }
}
Can even target specific nodes like I did using the node ID #. Responsive may need some work depending on how you want it.

EDIT Forgot the screenshot:
Screenshot_7.png
 

erich37

Well-known member
#8
I think it would be great to show the "Post New Thread"-button also to "Guests" (Visitors who are not logged-in).

But when a "Guest" is clicking the "Post New Thread"-button, the "login header" will pop-up.
Having the same effect as when you click the link "(You must log in or sign up to post here)":


login_to_post.jpg


I guess this is the reason I wanted to have this being an Add-on.
 

Russ

Well-known member
#9
I think it would be great to show the "Post New Thread"-button also to "Guests" (Visitors who are not logged-in).

But when a "Guest" is clicking the "Post New Thread"-button, the "login header" will pop-up.
Having the same effect as when you click the link "(You must log in or sign up to post here)":


View attachment 94550


I guess this is the reason I wanted to have this being an Add-on.
Still doesn't need an addon, just replace it with a conditional:

Code:
<xen:if is="{$visitor.user_id}">
<a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
<xen:else />
<label for="LoginControl"><a href="{xen:link login}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a></label>
</xen:if>
 

erich37

Well-known member
#10
Dear @Russ

this is great... I love it ! (y)(y)(y)


1)
there is only a tiny issue when decreasing the width of the browser-window:
- the RSS-icon moves underneath the "Forum-Title-text"
- the "Latest Posts"-box covers the "Forum-Title-text"

Do you know how to fix this ?


button_responsive_strange_shift.jpg



2)
Do you know how to put the "Post New Thread"-button into the position as shown in the mockup below (when in mobile-view / when decreasing the browser-width to absolute minimum) ?



button_position_responsive.jpg



Appreciate your help!
Thanks again!

:cool:
 

Russ

Well-known member
#11
For the first issue you may need to increase the value of the 1000px on both the min/max. I'm currently out and on my phone so I can look at the second later today.
 
#12
I think it would be great to show the "Post New Thread"-button also to "Guests" (Visitors who are not logged-in).

But when a "Guest" is clicking the "Post New Thread"-button, the "login header" will pop-up.
Having the same effect as when you click the link "(You must log in or sign up to post here)":


View attachment 94550


I guess this is the reason I wanted to have this being an Add-on.
Yes this is exactly what I need. Can you help me to fix this?
 

erich37

Well-known member
#13
Yes this is exactly what I need. Can you help me to fix this?
just put this code:

Code:
<xen:if is="{$visitor.user_id}">
<a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
<xen:else />
<label for="LoginControl"><a href="{xen:link login}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a></label>
</xen:if>
into the "template" named node_forum_level_2

as described here:
https://xenforo.com/community/threads/button-post-new-thread-at-homepage.90557/#post-880152

:cool:
 

Russ

Well-known member
#17

erich37

Well-known member
#19
when "Create Pages for Categories" is activated in ACP, then the button is not in the proper location.

Does anybody know how to fix this ?


Many thanks!