XF 2.3 is it possible to turn off advertisement for certain groups?

right. it's possible to do it in page_container using something like this from here:


Code:
14. a Hide content for only one user group
Code:
<xf:if is="{{!$xf.visitor.isMemberOf(x)}}">
                Hide content...
</xf:if>

but do consider to just move your ad codes to advertising section for better control!

If you are just putting the ad code in header section of page_container, get this addon. Much easier to manage.

 
right. it's possible to do it in page_container using something like this from here:


Code:
14. a Hide content for only one user group
Code:
<xf:if is="{{!$xf.visitor.isMemberOf(x)}}">
                Hide content...
</xf:if>

but do consider to just move your ad codes to advertising section for better control!

If you are just putting the ad code in header section of page_container, get this addon. Much easier to manage.

i really dont know how to move the advertisement in the other section.. what should i do?
remove the script from page container?
 
so now i am registered in xf 2 addons.. and i paid 35 dollars.. now how do i download.. sorry for newbie question

because xf2 addons forum and this one are separated so i dont know how to download with the other acc
 
Instead of editing page container you would find it very simple to use the Ad positions in xenforo

Admin Contro Panel > Setup > Advertising because there you can not only define which usergroups see specific ads in specified positions, but you can also define overall which templates don't serve ads. This is useful because Adsense may nag you if ads are shown on non public pages where they cannot check it.

If you want Auto ads then I'm sure Andy's addon is great, they all are,
 
Instead of editing page container you would find it very simple to use the Ad positions in xenforo

Admin Contro Panel > Setup > Advertising because there you can not only define which usergroups see specific ads in specified positions, but you can also define overall which templates don't serve ads. This is useful because Adsense may nag you if ads are shown on non public pages where they cannot check it.

If you want Auto ads then I'm sure Andy's addon is great, they all are,
so i can remove the script from page container and just install theandy addon? and put the id?
 
so i can remove the script from page container and just install theandy addon? and put the id?
I don't know about the addon, just saying that Andy's addons are very good. But without any addon you can just remove the script from the PAGE_CONTAINER anyway and put it in the built in Ad positions at Admin Contro Panel > Setup > Advertising. You just choose the position (e.g. over/under breadcrumbs etc) then put the code in the text field and choose user groups to show or hide.

Screenshot 2024-07-02 at 17.08.30.webp
 
Last edited:
I don't know about the addon, just saying that Andy's addons are very good. But without any addon you can just remove the script from the PAGE_CONTAINER anyway and put it in the built in Ad positions at Admin Contro Panel > Setup > Advertising. You just choose the position (e.g. over/under breadcrumbs etc) then put the code in the text field and choose user groups to show or hide.

View attachment 305174
so i can remove the script from page container..
go in the acp open advertising and paste the script there..

and what all the other code "cafe sidebar"
to paste the script is enough? or should i add something else.
thank you for the help and patience. im a real beginner
 
so i can remove the script from page container..
go in the acp open advertising and paste the script there..
Yes
and what all the other code "cafe sidebar"
Ignore that, it was my code as an example - you need to paste in your own code that Adsense gave you (ie what you put in PAGE_CONTAINER) , not my code which was just an example! Please don't paste in my ads or you will get nothing and I;ll get all the money from your site :)
 
Yes

Ignore that, it was my code as an example - you need to paste in your own code that Adsense gave you (ie what you put in PAGE_CONTAINER) , not my code which was just an example! Please don't paste in my ads or you will get nothing and I;ll get all the money from your site :)
excuse me .. one more question.
i used to have automated advertisment. so they just fill a little bit everywhere..

now i have to open one for each position? or the "container sidebar above" is enough?

or i have to open , above , below.. then? which other options to filmm as much as possible? thank you
 
As I mentioned in my above post... if you are using auto-ads... And you need to place the ad code in page header... There is an addon that would add an ad location for header code. And it works out perfectly.

So, basically... Just install this addon:


And then setup an advertisement with location Inside <head> of the html set in header and put the ad code there.

If you want to use a default placements without using this addon, you probably need to use a location that is present in all pages where you want the ads to appear. So, I imagine pick one of the container placements. Container Content: Above seems like a good place. Just one would be fine as the code would appear throughout the forum pages. Individual sections are useful when you want to put ads manually at locations you want the ads to appear in.

Do remember that Google does not like ads to appear on non-content pages I believe. Advertising panel comes handy as you can disable the ad placement in a list of templates that you do not want the ads to appear in. Look into that after the ad is placed as per your satisfaction! Prevent ads showing in these templates is the section where you can put in individual templates to not have the ad codes in.
 

Attachments

  • 1719970101420.webp
    1719970101420.webp
    22.5 KB · Views: 3
Last edited:
excuse me .. one more question.
i used to have automated advertisment. so they just fill a little bit everywhere..

now i have to open one for each position? or the "container sidebar above" is enough?

or i have to open , above , below.. then? which other options to filmm as much as possible? thank you
No, you shouldn't, Google needs it's code to be in your website's code, and then he takes over.

By using out of box settings, you can control things like who sees them (ie where that code is available).

And, just to make it much more simpler, at start don't remove yourself from seeing ads, and test it, is it what you want, etc. I never removed myself from seeing ads, so I knew if something was wrong with them. I use adblocker, but never on my sites. :D

If you will have some issues, then we can start testing why you have them. :D
 
Back
Top Bottom