Jump to content

How to add affiliate disclaimer to before full announcement post


Recommended Posts

I will be using affiliate links in my announcements occasionally and therefore need to include a short affiliate notice at the top of my announcement posts, before the article body. I tried adding it into the announcement.tpl file but that didn't give me the desired result. The notice did appear before each excerpt, but not at all on the individual full announcement page.

I can't tell if the announcement.tpl file also controls the full article or not, but assuming it does, is there a way to perhaps add an {if} statement of some kind that tells the template, "if this is the full post, display this text (whatever the notice says) before the article body. If not, don't display it."

Is there a way to do that? I've Googled my eyes out and have been able to find which template actually controls what is displayed on the full announcement.

Thanks.

Edited by bookman53
Link to comment
Share on other sites

15 hours ago, bookman53 said:

I can't tell if the announcement.tpl file also controls the full article or not, but assuming it does

it doesn't.

15 hours ago, bookman53 said:

Is there a way to do that?

what I would be tempted to do would be to add your disclaimer text yourself to each announcement, but then remove that text in the summary description with a hook... that way, your disclaimer will be shown on the .html announcement pages, but not on the announcements index page (or with an additional hook on the homepage).

Link to comment
Share on other sites

I considered adding the disclaimer to each post, but that is not generally a good idea because then each article that Google or other search engines index would start with exactly the same text. It's not always the case, but often the first few lines of a post are where the search engine gets its serp excerpt from.

Wordpress and other CMS systems allow (via plugins or editing the single.php file) the disclaimer to be more or less hard coded in such a way that it displays as part of the article to the reader, but technically it is outside the article itself and not indexed as part of the article.

That is what I hope to achieve while also removing it from the excerpts that first display on announcements.tpl.

Link to comment
Share on other sites

1 hour ago, bookman53 said:

I considered adding the disclaimer to each post, but that is not generally a good idea because then each article that Google or other search engines index would start with exactly the same text. It's not always the case, but often the first few lines of a post are where the search engine gets its serp excerpt from.

just about anything I can think of would be considered to be in the article with the announcements page..

1 hour ago, bookman53 said:

WordPress and other CMS systems allow (via plugins or editing the single.php file) the disclaimer to be more or less hard coded in such a way that it displays as part of the article to the reader, but technically it is outside the article itself and not indexed as part of the article.

WordPress is open source and so more flexible with regards to changes.... whereas, lots of things in WHMCS are shrouded in mystery, encrypted and not easily accessible for changes.

1 hour ago, bookman53 said:

That is what I hope to achieve while also removing it from the excerpts that first display on announcements.tpl.

here's the problem - do you remember what I said in the other thread about the announcements page creating the .html file on the fly...?

so for an announcement, the announcements.php file is generating the .html article page for it - there is no separate template to work with or intercept, e.g announcements.tpl

but to throw you a lifeline - could you live with showing a modal disclaimer on these announcements?

that could be achieved with a hook (actually 2) - it won't show on the main announcements page, shouldn't be included in Google results - it can be set to close automatically after x seconds, or you can require the user to close the modal window themselves (effectively agreeing that they've read and accepted the disclaimer)....

yRJlpOr.gif

so in the above video, the modal window is automatically dismissed after 5 seconds with no interaction required from the user...

Link to comment
Share on other sites

2 hours ago, brian! said:

...could you live with showing a modal disclaimer on these announcements?

 

That would be a good idea if nothing else is feasible without recreating half the universe, as it seems might be the case. Yes, I do remember you saying that about the html being created where we can't get to it.

It should be legally compliant to have it anywhere "above the fold" so that the reader can see it before reading the article. With that in mind, it just occurred to me that it could be hard coded into the top menu box on the main article page. Is that box also off limits?

My "lasts straw" effort I believe, would be this: As far as I know it is legally compliant to indicate next to the actual link (as in parenthesis) that the link is an affiliate then link to a disclaimer at the bottom of the article. That's a little tacky but a possibility. It would be indexed by the search engines, but at least it would be at the end of the post and not the beginning.

Edited by bookman53
Link to comment
Share on other sites

Update: bear mentioned in the thread I started about the time stamp that there was a template called viewannouncement.tpl. That brought forward an idea about displaying the affiliate disclaimer. I found that viewannouncement.tpl file and experimented with adding the affiliate disclosure there. As you said, the template does not give a huge amount of access to edit the actual article display, but it appears that it is as close as I could hope in displaying the affiliate disclosure on each post, but not in the excerpts. I'm going to go with that and call it done.

Thank you for your help.

Link to comment
Share on other sites

14 hours ago, bookman53 said:

That would be a good idea if nothing else is feasible without recreating half the universe, as it seems might be the case.

ahh just like the universe, we only know a small percentage of what's going on... there's dark energy and matter within WHMCS that nobody understands... 😜🔭

for the record, the hook is just a variation on the one I posted 3 years ago...

14 hours ago, bookman53 said:

It should be legally compliant to have it anywhere "above the fold" so that the reader can see it before reading the article. With that in mind, it just occurred to me that it could be hard coded into the top menu box on the main article page. Is that box also off limits?

the navbar? I would have thought it could be modified.

you could throw a notification bar message on the individual announcements page - though whether Google would pick that us as page content, I can't say.

e5KdRcz.png

ordinarily, I would have said you could have used a sidebar to display the disclaimer, but you've removed them - so that's not an option.

13 hours ago, bookman53 said:

As you said, the template does not give a huge amount of access to edit the actual article display, but it appears that it is as close as I could hope in displaying the affiliate disclosure on each post, but not in the excerpts. I'm going to go with that and call it done.

if it's at the bottom of the article, then you could do that with a hook too - it's going to be a ClientAreaPage hook that just appends the $text variable.

Link to comment
Share on other sites

@brian! You may have missed my last post, the one that began with "Update:"

I found the viewannouncement.tpl file that @bear had mentioned and found the right spot to add the affiliate disclosure inside it. The result is as close as I could hope in displaying the affiliate disclosure on each post, but not in the excerpts. I decided to go with that and move on to some other mystery.

Thank you for your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated