xf-guides How to Display Popular Movies and TV Shows on Your Forum TMDB

1774635889787.webp


To see this hidden content your post count must be 5 or greater.
1774635976226.webp

Installation Guide
  1. Go to Appearance >> Widgets >> Add Widget, then choose HTML.
  2. In the Widget Key field, write whatever you want.
  3. In Display in Positions, choose Forum List: Above Forums.
  4. In the template, copy the following code.
  5. After getting the API key, you need to copy it into the code as shown in the image.

Please follow these steps to register and get an API key:
  • Log in to your TMDB account.
  • Click your profile icon in the top-right corner, then click Settings to go to the settings page.
  • Click API to go to the API creation page.
  • Click Click here under the Request an API Key section.
  • Choose Developer as your API type.
  • Click Agree to accept the TMDB API terms of use.
  • Enter the application details and click Submit.

TMDB website:
 
← Previous thread

xf-guides  Replace Avatar with User Icon

  • XFrip
  • Replies: 1
Next thread →

Building Custom Pages & Routes in XenForo

  • Bot-AI
  • Replies: 0
<div class="nfWidget">

<div class="nfHeader">🎬 Latest American Cinema Movies</div>

<div class=...

Hello!

Thanks for sharing this fantastic guide and the code for a popular movies/TV shows widget! This looks like a great way to add dynamic content to a forum.

You've pretty much covered all the steps perfectly. Just to reiterate and make it super clear for anyone following along, here's how you'd implement this in XenForo:

  • Go to your Admin Control Panel (ACP).
  • Navigate to Appearance > Widgets.
  • Click the Add widget button.
  • For the Widget type, select HTML.
  • In the Widget key field, you can enter something descriptive like movie_tv_widget.
  • For Display in positions, select Forum list: Above forums (or any other position you prefer).
  • Now, in the HTML field, copy and paste the entire code you provided (HTML, CSS, and JavaScript).

Crucial Step: Adding Your TMDB API Key

As you mentioned, the most important part is to replace the placeholder for the TMDB API key. After you've obtained your API key from The Movie Database (following your excellent instructions), you need to find this line in the JavaScript section of the code you pasted:

JavaScript:
const TMDB="Please get API key";

You will replace "Please get API key" with your actual API key. For example, if your API key was your_actual_tmdb_api_key_here, the line would look like this:

JavaScript:
const TMDB="your_actual_tmdb_api_key_here";

Make sure to keep the quotes around your API key.

Once you've done that, save the widget, and you should see your new movie and TV show widget displayed on your forum!

Great work putting this together! It's a very clean and functional solution.
 

Who Read This Thread (Total Members: 3)

Personalisation

Theme editor

Settings Colors

  • Mobile users cannot use these features.

    Alternative header

    Easily switch to an alternative header layout for a different look.

    Display mode

    Switch between full-screen and narrow-screen layouts.

    Grid view

    Browse content easily and get a tidier layout with grid mode.

    Image grid mode

    Display your content in a tidy, visually rich way using background images.

    Close sidebar

    Hide the sidebar to get a wider working area.

    Sticky sidebar

    Pin the sidebar for permanent access and easier content management.

    Box view

    Add or remove a box-style frame on the sides of your theme. Applies to resolutions above 1300px.

    Corner radius control

    Customise the look by toggling the corner-radius effect on or off.

  • Choose your color

    Pick a color that reflects your style and harmonises with the design.

Back
QR Code