Hello! Tell me how can I fix the FB? There is an array with parameters (which works well, as evidenced by the good work of the balls on VK) and foreach, VK works well - everything outputs as it should, FB does not work correctly, and the picture does not display at all:

{$params = [ 'url'=>"http://`$smarty.server.HTTP_HOST|escape``$smarty.server.REQUEST_URI|escape`", 'title' => $product->name|escape, 'description' => $product->meta_description|escape, 'image' => $product->image->filename|resize:200:200 ]} {foreach [ 'vk-icon-lg' => "https://vk.com/share.php?url=`$params.url`&title=`$params.title`&description=`$params.description`&image=`$params.image`&noparse=true", 'fb-icon-lg' => "https://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=`$params.description`&p%5Bsummary%5D=`$params.title`&p%5Burl%5D=`$params.url`&p%5Bimages%5D%5B0%5D=`$params.image`" ] as $item} 

    1 answer 1

    Found a solution! In the current file, change foreach to:

    {foreach [

    'vk-icon-lg' => " https://vk.com/share.php?url= $params.url & title = $params.title & description = $params.description & image = $params.image & noparse = true" ,

    'fb-icon-lg' => " https://www.facebook.com/sharer.php?s=100&ptleurl== $params.url "

      ] as $item} 

    and also in the index file we write "meta tags":

    meta property = "og: url" content = "http: // {$ smarty.server.HTTP_HOST | escape} {$ smarty.server.REQUEST_URI | escape}" />

    meta property = "og: title" content = "{$ product-> name | escape}" />

    meta property = "og: description" content = "{$ product-> meta_description | escape}" />

    meta property = "og: image" content = "{$ product-> image-> filename | resize: 200: 200}" />

    After these manipulations, everything works well.