Skip to content

Display tweets in widget [NodeBB]

Solved Customisation
  • @phenomlab I am indeed mate, so for example the ‘Stockport County’ category content would display a widget that shows the club’s official tweets or Twitter profile. May not be possible but would definitely be good if it could be pulled off. It’s just whether this sort of thing would impact load times etc.

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    It’s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go 🙂

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

  • @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    It’s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go 🙂

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    @phenomlab said in Display tweets in widget [NodeBB]:

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    It’s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go 🙂

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    Wow, looks phenomenal mate, is there any way to limit the amount of tweets shown at all? And more specifically how can they be displayed on each category?

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac As a quick POC I decided to create a Twitter widget on your Categories page - see below for what it looks like

    6f9f9603-6d23-4a9f-bd8b-36d004dee9de-image.png

    It’s not styled as such yet, but is nothing more than a widget taken from Twitter directly here

    This then gives you the code to place into any widget

    <a class="twitter-timeline" data-height="800" data-dnt="true" data-theme="light" href="https://twitter.com/StockportCounty?ref_src=twsrc%5Etfw">Tweets by StockportCounty</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    

    The widget code is shown as below

    ad9435df-3b43-4c50-bfee-fba908b8a62d-image.png

    Save the widget, and off you go 🙂

    Clearly, you need to tailor this a little depending on what you actually want to capture, but this is the overall concept.

    Wow, looks phenomenal mate, is there any way to limit the amount of tweets shown at all? And more specifically how can they be displayed on each category?

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part I’m not so sure of. I’d say I’m 99% certain it’ll be possible, but I haven’t invested any time yet to determine this.

  • @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part I’m not so sure of. I’d say I’m 99% certain it’ll be possible, but I haven’t invested any time yet to determine this.

    @phenomlab said in Display tweets in widget [NodeBB]:

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part I’m not so sure of. I’d say I’m 99% certain it’ll be possible, but I haven’t invested any time yet to determine this.

    Thanks Mark, at least it’s there and can be added on when possible 👍🏻.

  • @phenomlab said in Display tweets in widget [NodeBB]:

    @jac said in Display tweets in widget [NodeBB]:

    is there any way to limit the amount of tweets shown at all?

    Yes, but only by adjusting the height of the widget itself (via Twitter) from what I recall seeing.

    And more specifically how can they be displayed on each category?

    That part I’m not so sure of. I’d say I’m 99% certain it’ll be possible, but I haven’t invested any time yet to determine this.

    Thanks Mark, at least it’s there and can be added on when possible 👍🏻.

    Is this widget something else that can be customised or is it that little more difficult as it’s a twitter feed?

  • Is this widget something else that can be customised or is it that little more difficult as it’s a twitter feed?

    @jac That depends on what you are looking for in terms of customisation. If you are thinking about colours for example, then no.

  • @jac That depends on what you are looking for in terms of customisation. If you are thinking about colours for example, then no.

    @phenomlab thanks for the response mate.

    That was my question yes mate, although I don’t know of any other way it could be customised.

    As I’ve mentioned previously I’m just looking to change little bits here and there mate.

    I was looking for a next / last fixture to add into a widget but the last time I tried it the data massively didn’t fit the widget area.

  • @jac for example league table widget code.

    <div id="fs-standings"></div>
    <script> (function (w,d,s,o,f,js,fjs) { w['fsStandingsEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'mw', 'https://cdn.footystats.org/embeds/standings.js')); mw('params', { leagueID: 6088 });
    </script>
  • @jac for example league table widget code.

    <div id="fs-standings"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsStandingsEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'mw', 'https://cdn.footystats.org/embeds/standings.js')); mw('params', { leagueID: 6088 }); 
    </script>
    

    @jac said in Display tweets in widget [NodeBB]:

    @jac for example league table widget code.

    <div id=“fs-standings”></div> <script> (function (w,d,s,o,f,js,fjs) { w[‘fsStandingsEmbed’]=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, ‘script’, ‘mw’, ‘https://cdn.footystats.org/embeds/standings.js’)); mw(‘params’, { leagueID: 6088 }); </script>

    Next match…

    <div id="fs-upcoming"></div>
    <script> (function (w,d,s,o,f,js,fjs) { w['fsUpcomingEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'fsUpcoming', 'https://cdn.footystats.org/embeds/upcoming.js')); fsUpcoming('params', { teamID: 3143 });
    </script>
  • @jac said in Display tweets in widget [NodeBB]:

    @jac for example league table widget code.

    <div id=“fs-standings”></div> <script> (function (w,d,s,o,f,js,fjs) { w[‘fsStandingsEmbed’]=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, ‘script’, ‘mw’, ‘https://cdn.footystats.org/embeds/standings.js’)); mw(‘params’, { leagueID: 6088 }); </script>

    Next match…

    <div id="fs-upcoming"></div> 
    <script> (function (w,d,s,o,f,js,fjs) { w['fsUpcomingEmbed']=o;w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) }; js = d.createElement(s), fjs = d.getElementsByTagName(s)[0]; js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); }(window, document, 'script', 'fsUpcoming', 'https://cdn.footystats.org/embeds/upcoming.js')); fsUpcoming('params', { teamID: 3143 }); 
    </script>
    

    @jac have a look at https://stockportcounty.fans/unread

    I’ve placed these two widgets into the “unread” page

  • @jac have a look at https://stockportcounty.fans/unread

    I’ve placed these two widgets into the “unread” page

    @phenomlab wow! How did you manage that? That’s brilliant!!

  • @phenomlab wow! How did you manage that? That’s brilliant!!

    @jac Very easily done. You just use the HTML widgets and place them where you want 🙂

  • @jac Very easily done. You just use the HTML widgets and place them where you want 🙂

    @phenomlab brilliant, many thanks Mark 😁

  • undefined phenomlab has marked this topic as solved on 8 Dec 2021, 09:20


26/29

11 Nov 2021, 17:48


Threaded Replies

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • 7 Votes
    18 Posts
    1k Views
    @Panda Just circling back here with something of an update (which I think you’ll like). I’ve completely restructured the ranking system. There are now less ranks, with a higher point threshold to reach them. More importantly, if you reload the site, you’ll notice that the ranks are now icons. I also removed the “Author” badge, and made this a single icon, which (to me) looks much better.
  • 0 Votes
    6 Posts
    749 Views
    @cagatay You should ask in the NodeBB forums. Perhaps reference this post https://discuss.flarum.org/d/23066-who-read
  • 1 Votes
    2 Posts
    764 Views
    @eveh Welcome board The code you are referring to is custom written as no such functionality exists under NodeBB. However, adding the functionality is relatively trivial. Below are the required steps Navigate to /admin/appearance/customise#custom-header Add the below code to your header, and save once completed <ol id="mainbanner" class="breadcrumb"><li id="addtext">Your Title Goes Here</li></ol> Navigate to /admin/appearance/customise#custom-js and add the below code, then save $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { // Initialise mainbanner ID, but hide it from view $('#mainbanner').hide(); var pathname = window.location.pathname; if (pathname === "/") { $("#addtext").text("Your Title"); $('#mainbanner').show(); } else {} // If we want to add a title to a sub page, uncomment the below and adjust accordingly //if (pathname === "/yourpath") { //$("#addtext").text("Your Title"); //$('#mainbanner').show(); //} }); }); Navigate to /admin/appearance/customise#custom-css and add the below CSS block .breadcrumb { right: 0; margin-right: auto; text-align: center; background: #0086c4; color: #ffffff; width: 100vw; position: relative; margin-left: -50vw; left: 50%; top: 50px; position: fixed; z-index: 1020; } Note, that you will need to adjust your CSS code to suit your own site / requirements.
  • 13 Votes
    20 Posts
    3k Views
    @DownPW the ‘js’ code for the banner takes the time from the client, so what it displays really depends on the regional settings for the operating system. I’ve not seen this issue myself but would like to see some examples of screenshots if possible.
  • [NodeBB] username cards

    Solved Customisation nodebb 28 Dec 2021, 23:18
    5 Votes
    8 Posts
    1k Views
    @phenomlab Aha…nice to know. As always thank you for the reply and information.
  • Social icon (Nodebb)

    Solved Customisation nodebb social 4 Dec 2021, 16:58
    0 Votes
    7 Posts
    1k Views
    @phenomlab said in Social icon (Nodebb): @jac I just tested my theory around using the OG image, and according to the Twitter card validator, it works fine [image: 1638880098289-73e805e1-997b-41bf-9259-51c5052ca8fc-image.png] fixed
  • NodeBB Design help

    Solved Customisation 16 Oct 2021, 12:56
    3
    2 Votes
    8 Posts
    1k Views
    @riekmedia I’ve applied some new CSS to your site. Can you reload the page and try again ? For the record, this is what I added #footer { background: #2d343e; border-top: 4px solid #2d343e; font-size: 0.9em; margin-top: 70px; padding: 80px 0 0; position: relative; clear: both; bottom: 0; left: 0; right: 0; z-index: 1000; margin-left: -15px; margin-right: -338px; } The /categories page seems a bit messed up, so looking at that currently EDIT - issued some override CSS in the CATEGORIES widget <!--- CSS fix for overspill on /categories page - DO NOT DELETE --> <style> #footer { margin-right: -45px; } </style> That should resolve the /categories issue.
  • 0 Votes
    3 Posts
    968 Views
    Closing this thread as a duplicate of https://sudonix.com/topic/12/nodebb-customisation