Hi carlucci,
You need to add the Open Graph meta to your template to get the article image when you share the article on Facebook. I have helped add the following code to the \templates\ja_podcast\html\layouts\t4\index.php file. Line 26.

  <?php 
  use Joomla\CMS\Factory;
  use Joomla\CMS\Router\Route;

  // Get the article ID from the URL parameter or set it manually
  $articleId = Factory::getApplication()->input->get('id', 0, 'int');

  // Check if a valid article ID is provided
  if ($articleId > 0) {
      // Load the article
      $article = JTable::getInstance('content');
      $article->load($articleId);

      // Get the article intro image URL
      $introImageURL = '';
      $images = json_decode($article->images);
      if (!empty($images->image_intro)) {
          $introImageURL = JUri::root() . $images->image_intro;
      }

      // Output the article intro image URL for use in the Open Graph tags or elsewhere
      echo '<meta property="og:image" content="' . $introImageURL . '" />';
  }
  ?>

    dominic
    It's well made and it works.
    I need to add the Open Graph meta to my template? If necessary, I'm sorry, I don't know how to do it.

    In this template you have helped me to solve some problems,
    in this post and in another that I don't remember when it was and I am very grateful to you. I think that a support should be the way you are doing it.

    I think that these changes to the template should be incorporated into a hypothetical new version of Podcast.
    If this error happens to me, most likely it will happen to another member.

      Hi carlucci,
      Regarding the Open Graph, you can add the following code to the file \templates\ja_podcast\html\layouts\t4\index.php , line 26

      <?php
      defined('_JEXEC') or die;
      
      use Joomla\CMS\Factory;
      use Joomla\CMS\Router\Route;
      
      // Get the article ID from the URL parameter or set it manually
      $articleId = Factory::getApplication()->input->get('id', 0, 'int');
      
      // Check if a valid article ID is provided
      if ($articleId > 0) {
          // Load the article
          $article = JTable::getInstance('content');
          $article->load($articleId);
      
             // Get the article intro image URL
            $introImageURL = '';
            $images = json_decode($article->images);
            if (!empty($images->image_intro)) {
                $introImageURL = JUri::root() . $images->image_intro;
            }
      
          // Get the article title
          $articleTitle = htmlspecialchars($article->title, ENT_QUOTES, 'UTF-8');
      
          // Get the article description (you may choose to use the introtext or fulltext as per your requirement)
          $articleDescription = htmlspecialchars($article->introtext, ENT_QUOTES, 'UTF-8');
      
          // Get the article URL
          $articleURL = JUri::getInstance()->toString();
      
          // Set the article type (assuming it's an article)
          $articleType = 'article';
      
          // Output the Open Graph meta tags
          echo '<meta property="og:title" content="' . $articleTitle . '" />' . PHP_EOL;
          echo '<meta property="og:description" content="' . $articleDescription . '" />' . PHP_EOL;
          echo '<meta property="og:url" content="' . $articleURL . '" />' . PHP_EOL;
          echo '<meta property="og:type" content="' . $articleType . '" />' . PHP_EOL;
          // Output the article intro image URL for use in the Open Graph tags or elsewhere
           echo '<meta property="og:image" content="' . $introImageURL . '" />';
      }
      ?> 

      I've notified our technical team and we will discuss it in the next version.

        dominic
        I have modified the PHP and please see the result. I have reinstalled the original index.php

          Write a Reply...
          You need to Login to view replies.