Showing default page image when sharing on twitter

Eddy
Eddy
@eddy
8 years ago
479 posts
I'm hoping someone could help me, I'm using a twitter card but have assigned a default image on it, example:

<meta name="twitter:image" content="https://www.mysite.com/images/tmain.png" />

I was wondering how I could replace that assigned image with each page's default image instead.

Thank you.

Eddy
updated by @eddy: 06/24/16 05:22:09AM
michael
@michael
8 years ago
7,744 posts
Its going to depend on what variables you have available. In your above example you can use that absolutely anywhere because the image is static.

But if you are looking at the top page then there is going to be no profile image selected so there would be no image URL for a profile because we are not on a profile.

So what you need to do is to figure out where that meta name is going to show at, then see what variables you have in that location.

The function to show you what variables you have to work with are found with {debug} in the template you're interested in:

Docs: "{debug}"
https://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug

Probably you're editing the sharethis template for the module I'm guessing, so put the debug in there and look at the page you're interested in.

Tags