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

XF 1.5 Link to hide a notice?

Discussion in 'XenForo Questions and Support' started by querschlaeger, Oct 13, 2015.

  1. querschlaeger

    querschlaeger Member

    Hello,

    I want to show a bigger Link to hide a notice, so I added the following HTML into the notice text:

    HTML:
    <a href="account/dismiss-notice?notice_id=1" class="callToAction"><span>OK</span></a>
    But this does not work as a guest user. Do I need a special JavaScript action oder class too?
     
  2. Jeremy P

    Jeremy P Well-Known Member

    Notices can't be dismissed for guests.

    Disregard, sorry.
     
    Last edited: Oct 13, 2015
  3. Russ

    Russ Well-Known Member

    You could actually use some simple CSS in extra.css along with a phrase change

    Code:
    #XenForo .DismissParent .DismissCtrl {
    background: #000 none no-repeat scroll 0 0;
    font-size: 12px;
    font-weight: bold;
    height: auto;
    padding: 7px 20px;
    text-indent: 0;
    top: 7px;
    width: auto;
    }
    #XenForo .Notices .panel .noticeContent {
    padding-right: 62px;
    }
    
    Edit the phrase: "dismiss_notice"

    Screenshot_6.png


    (I only tested this on the default notices not the floating ones)
     
  4. Russ

    Russ Well-Known Member

  5. Jeremy P

    Jeremy P Well-Known Member

    @Russ Huh, I guess that was added in 1.5? I hadn't noticed that, thanks.
     
  6. querschlaeger

    querschlaeger Member

    Nice! :) But I don't want it global. Only one notice must have this bigger button.
     
  7. Russ

    Russ Well-Known Member

    Modify the CSS:

    Code:
    #XenForo .DismissParent.notice_2 .DismissCtrl
    {
       background: #000 none no-repeat scroll 0 0;
       font-size: 12px;
       font-weight: bold;
       height: auto;
       opacity: 0.6;
       padding: 7px 20px;
       text-indent: 0;
       top: 7px;
       width: auto;
    }
    #XenForo .Notices .notice_2 .noticeContent
    {
       padding-right: 62px;
    }
    
    change the _2 to your notice ID. You can still change the phrase as it doesn't show on any of the notices anways
     
  8. querschlaeger

    querschlaeger Member

    Finally I found a solution without extra CSS or modification.

    Just add this HTML to a notice:

    HTML:
    <a class="callToAction" onclick="$(this).closest('.Notice').find('a.DismissCtrl').trigger('click');"><span>OK</span></a>
     

Share This Page