1. 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

Discussion in 'Resource and Add-on Requests' started by erich37, Jan 10, 2015.

  1. erich37

    erich37 Well-Known Member

    I just had a simple idea:

    Button "Post-New-Thread" at Homepage



    Anybody able to make this into an Addon ?


    :)



    postnewbuttonhp.jpg


    :cool:
     
    rafass, Pinn, jauburn and 2 others like this.
  2. erich37

    erich37 Well-Known Member

    alternative Button-location (for Admins who do not need the Forum-Node-icon):




    alternative_post_button_location.jpg
     
    Pinn likes this.
  3. ForumCube

    ForumCube Active Member

    For execution start chat with us.
     
  4. erich37

    erich37 Well-Known Member

    another alternative Button-location:




    alternative_location3.jpg
     
    Veer likes this.
  5. erich37

    erich37 Well-Known Member

    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: Jan 12, 2015
  6. Russ

    Russ Well-Known Member

    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
     
    sami simo, rafass, Pinn and 2 others like this.
  7. erich37

    erich37 Well-Known Member


    ha haaa

    that's cool (y)


    will try it later today


    Many thanks!

    :)
     
  8. erich37

    erich37 Well-Known Member

    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.
     
    Shruti likes this.
  9. Russ

    Russ Well-Known Member

    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>
    
     
    rafass and erich37 like this.
  10. erich37

    erich37 Well-Known Member

    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:
     
    jauburn likes this.
  11. Russ

    Russ Well-Known Member

    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.
     
    erich37 likes this.
  12. Shruti

    Shruti New Member

    Yes this is exactly what I need. Can you help me to fix this?
     
  13. erich37

    erich37 Well-Known Member

    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:
     
    rafass and jauburn like this.
  14. erich37

    erich37 Well-Known Member

  15. Russ

    Russ Well-Known Member

  16. erich37

    erich37 Well-Known Member

  17. Russ

    Russ Well-Known Member

    Wasn't loading a few minutes ago, same concept... but remove the right: 365 on html .node .nodeControls

    And try putting the right value on the .forum_list .node .callToAction to 365

    I'm sure there's a cleaner way of doing it just have negative time currently :)
     
    erich37 likes this.
  18. erich37

    erich37 Well-Known Member

  19. erich37

    erich37 Well-Known Member

    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!
     
  20. Pinn

    Pinn Active Member

    Attached Files:

Share This Page