XF 2.1 How to hide notice on specific page

CarpCharacin

Well-known member
Is there some CSS which will allow for a specific notice to be hidden on a specific page without hiding the other notices?
 
This should be achievable by adding to extra.less
Code:
[data-container-key="node-X"] [data-notice-id="X"] {
display:none;
}

Replace Xs with the actual node and notice ids. You can find IDs via admin panel or by viewing the page source.

i.e. If I wanted to hide notice "test" when viewing info page I would add node-74 and notice-id=11 to the above code.2020-06-25 11_54_03-Edit page_ Info _ TESTINGSAY - Admin control panel.webp2020-06-25 11_52_36-Edit notice_ test _ TESTINGSAY - Admin control panel.webp
 
This is how I hide a specific notice on specific page. I hide notice only for thread_view page. In css the notice id is "1".

CSS:
[data-template="thread_view"] .notice.js-notice.notice--primary[data-notice-id="1"] {
    display: none;
}
 
This is how I hide a specific notice on specific page. I hide notice only for thread_view page. In css the notice id is "1".

CSS:
[data-template="thread_view"] .notice.js-notice.notice--primary[data-notice-id="1"] {
    display: none;
}

This seems like a long way to just prevent a notice on some pages. For instance I want it to display on article pages (I use ams) but not articles/add

I feel like this could be much easier than another line of Extra.Less any help?
 
Back
Top Bottom