Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:06:35+00:00 2026-06-14T23:06:35+00:00

I have searched the net for a solution but can’t seem to get anywhere.

  • 0

I have searched the net for a solution but can’t seem to get anywhere.

My page (php) is loading with one url (let’s say http://www.mysite.com)
in the page several search options on music (albums) can be done and the tracks are shown. (without refreshing the page). the info comes from a database.
So the url stays the same.
In this search process the facebook meta tags (description, url, title) stay the same also because I never reload the page, I only load content into div’s.

I would like to be able to ‘like’ the album, and backlink to it. So I have created the function to load the album by using the url: http://www.mysite.com?album=12345
I can show a popup with this url to share this.
So, if you go to this url, the content is automatically loaded based on the url parameter.

And on this spot (where you can see the url with the parameter ?album=12345) I would like to show the ‘like’ button as well. (I generated the url, so I use this in the code:)

echo '<div style="overflow:visable" class="fb-like" data-href="http://mysite.com/?album='.$albumid.'" data-send="false" data-width="300" data-show-faces="false">?</div>';

it works so far… (after I added the parse code to enable the button)
However the like button takes the default meta tags description and title etc.
Not particular on this album or artist – so it’s not unique.

Note: if I remove the meta[property=og:url] from the header I can make the button backlink to the right url with the ?album parameter. Otherwise it would go back to the default root of the site mysite.com (this does make the lint tool give an error on the missing meta)

I have tried to add into this same function something like:

$("meta[property=og\\:url]").attr("content", "http://mysite.com/?album=<?php echo $albumid; ?>");
$("meta[property=og\\:title]").attr("content", "<?php echo $artistname; ?>");
$("meta[property=og\\:description]").attr("content", "<?php echo $albumname; ?>");

I did this so the meta tags will be changed, just to let the like button show the right description etc. However this doesn’t work.
I understand that facebook scrapes the page (I used the lint tool etc.) but I will never executes javascript, so the meta tags wil stay as default (when first loading the page)

What can I do to make a unique like button, with it’s own description (albumname etc) without making a html page for each one of them (millions of albums in the database…)

I hope it makes sense.

I can’t seem to figure this one out, help please 🙂


Based on the comments below I used the following solution:

you should create the right fb meta tags when the url (with the params ?alb_id=12345) is opened.
That’s enough for the like button to do its job.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:06:37+00:00Added an answer on June 14, 2026 at 11:06 pm

    Your logic is fine, up to the point where you’re setting the meta tags using jquery.
    They should be set using PHP. As you can imagine the scraper won’t execute the jquery, but if it’s fed the already PHP-customized meta tags it will use them (as provided).

    Just have the og:tags prepared server-side, depending on the albumId requested, and it should work. It might not work right away, I remember there used to be occasional caching issues with the scraper before.

    In short, index.php?album=123 will send a different set of og:tags to the scraper than say index.php?album=321. Just set them up server-side.

    <meta property="og:title" content="<?php echo $artistTitle; ?>"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched for a general solution to this but only find answers to
I have searched a lot to find a solution for my problem, but I
I have searched around a lot for a solution, but could not find any.
I have searched a lot but I could not find any good solution to
I searched google and SO, but did not find a solution. I have an
I have now searched for hours, but haven't found a solution yet. I hope
I have searched the web for examples of inheriting System.Net.NetworkInformation.NetworkInterface but I cannot see
I have searched the net and searched the net only to not quite find
I have searched through the net and still have no clue how to do
I am using c# .net. Thanks in advance for any help. I have searched

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.