XF 2.1 YouTube Subscriber button?

We use to have this on our forum, and were wondering if this is possible through 2.1? We tried adding it the old way with no avail.

index.php


Here is how we did it the first time: https://xenforo.com/community/threads/what-addon-youtube-sub-button-in-signature.88225/
 
PAGE_CONTAINER or helper_js_global ;)


  1. Login to ACP
  2. Switch the tab to Appearance
  3. Click Styles on the left hand side
  4. Click on Templates for your skin
  5. In the small search box where it says "Filter items", search for "page_container_js_head"
  6. Click on the template name that is having color, red.
  7. Find:
    HTML:
    <!--XenForo_Require:JS-->
  8. Replace with
    HTML:
    <script src="https://apis.google.com/js/platform.js"></script>
    <!--XenForo_Require:JS-->
  9. Click on "Save All Changes".
  10. Click on "Home"
  11. Click on Custom BB Codes
  12. Click on Add New Custom BB COde
  13. Enter BB Code Tag as per your requirement
  14. Add Title as per your requirement
  15. Under HTML Replacement, set it to
    HTML:
    <div class="g-ytsubscribe" data-channel="{text}" data-layout="full" data-count="default"></div>
  16. Switch to Advanced Options
  17. Check "Disable similes", "Disable line break conversion", "Disable auto-linking" and "Stop parsing BB code"
  18. Finally enter a icon path and click on save cusotm bbcode.

I can't seem to do this step by step, based on what is needed here? Where would I paste this information? Thank you for helping.
 
  1. Login to ACP
  2. Switch the tab to Appearance
  3. Click Styles on the left hand side
  4. Click on Templates for your skin
  5. In the small search box where it says "Filter items", search for "page_container_js_head"
  6. Click on the template name that is having color, red.
  7. Find:
    HTML:
    <!--XenForo_Require:JS-->
  8. Replace with
    HTML:
    <script src="https://apis.google.com/js/platform.js"></script>
    <!--XenForo_Require:JS-->
  9. Click on "Save All Changes".
  10. Click on "Home"
  11. Click on Custom BB Codes
  12. Click on Add New Custom BB COde
  13. Enter BB Code Tag as per your requirement
  14. Add Title as per your requirement
  15. Under HTML Replacement, set it to
    HTML:
    <div class="g-ytsubscribe" data-channel="{text}" data-layout="full" data-count="default"></div>
  16. Switch to Advanced Options
  17. Check "Disable similes", "Disable line break conversion", "Disable auto-linking" and "Stop parsing BB code"
  18. Finally enter a icon path and click on save cusotm bbcode.
I can't seem to do this step by step, based on what is needed here? Where would I paste this information? Thank you for helping.
Here we go ! :D
  1. Login to ACP
  2. Switch the tab to Appearance
  3. Click on Templates for your style
  4. On the template PAGE_CONTAINER, find :
  5. Code:
    <head>
  6. Replace with this :
  7. Code:
    <head>
        <script src="https://apis.google.com/js/platform.js"></script>
  8. Click on "Save All Changes".
  9. Click on "Home"
  10. Click on Custom BB Codes
  11. Click on Add New Custom BB Code
  12. Enter BB Code Tag as per your requirement
  13. Add Title as per your requirement
  14. Under HTML Replacement, set it to this :
  15. Code:
    <div class="g-ytsubscribe" data-channel="{text}" data-channelid="{text}" data-layout="full" data-theme="dark" data-count="default"></div>
  16. Switch to Advanced Options
  17. Check "Disable similes", "Disable line break conversion", "Disable auto-linking" and "Stop parsing BB code"
  18. Finally enter a icon path (youtube-play) and click on save custom bbcode ! ;)
EDIT : you can remove this : data-theme="dark" if you want "light" style
 
Last edited:
Here we go ! :D
  1. Login to ACP
  2. Switch the tab to Appearance
  3. Click on Templates for your style
  4. On the template PAGE_CONTAINER, find :
  5. Code:
    <body>
  6. Replace with this :
  7. Code:
    <body>
        <script src="https://apis.google.com/js/platform.js"></script>
  8. Click on "Save All Changes".
  9. Click on "Home"
  10. Click on Custom BB Codes
  11. Click on Add New Custom BB Code
  12. Enter BB Code Tag as per your requirement
  13. Add Title as per your requirement
  14. Under HTML Replacement, set it to this :
  15. Code:
    <div class="g-ytsubscribe" data-channel="{text}" data-channelid="{text}" data-layout="full" data-theme="dark" data-count="default"></div>
  16. Switch to Advanced Options
  17. Check "Disable similes", "Disable line break conversion", "Disable auto-linking" and "Stop parsing BB code"
  18. Finally enter a icon path (youtube-play) and click on save custom bbcode ! ;)
EDIT : you can remove this : data-theme="dark" if you want "light" style

Thank you! I can't find <body> I can find </body> that doesn't seem to work :/

For the icon path, is that the font awesome icon? :-)
 
Here we go ! :D
  1. Login to ACP
  2. Switch the tab to Appearance
  3. Click on Templates for your style
  4. On the template PAGE_CONTAINER, find :
  5. Code:
    <head>
  6. Replace with this :
  7. Code:
    <head>
        <script src="https://apis.google.com/js/platform.js"></script>
  8. Click on "Save All Changes".
  9. Click on "Home"
  10. Click on Custom BB Codes
  11. Click on Add New Custom BB Code
  12. Enter BB Code Tag as per your requirement
  13. Add Title as per your requirement
  14. Under HTML Replacement, set it to this :
  15. Code:
    <div class="g-ytsubscribe" data-channel="{text}" data-channelid="{text}" data-layout="full" data-theme="dark" data-count="default"></div>
  16. Switch to Advanced Options
  17. Check "Disable similes", "Disable line break conversion", "Disable auto-linking" and "Stop parsing BB code"
  18. Finally enter a icon path (youtube-play) and click on save custom bbcode ! ;)
EDIT : you can remove this : data-theme="dark" if you want "light" style

Tried what was mentioned here, nothing shows up.
 
Top Bottom