XF 1.5 Link to hide a notice?

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?
 
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.webp


(I only tested this on the default notices not the floating ones)
 
Nice! :) But I don't want it global. Only one notice must have this bigger button.

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
 
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>
 
Top Bottom