completed Meta Information on Playlist shares

Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
I want to share my community playlists as TOP 10 songs and videos. However, when I share them to Facebook, the scraper does not receive a description. So it shows the last comment, or if no comment, the stats of the profile.

I added a description to the form hoping it would pick it up that way, but did not meet with success.

The meta tag tool doesn't seem to be able to target specific pages or categories like playlists, so I don't know how it can help here.

I think, somehow or another
<meta name="description" content="{$item_playlist_description}" />
must be added to the header of the playlist pages, to correspond to the form field I created - but I don't know how.

Perhaps a if/else statement to the meta.tpl, like if this is a playlist, insert $item_playlist_description, else nothing, but I wouldn't know the proper way to write it.

Anyone got any ideas?


--

Ken Rich
indiegospel.net

updated by @ken-rich: 02/06/15 01:00:09PM
brian
@brian
10 years ago
10,148 posts
You're using ShareThis right? We can override the "default" share template with specific ones for any module.

Do you have a URL to a page you are trying to share and not seeing a description? I need to look how the ShareThis code is being generated.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

This one is my Top 10 song list - http://indiegospel.net/indiegospel/playlist/1/top-10-songs

While we are at it. Is there a way for me to override the link colors in the player. Blue on black doesn't work well, but it's following the general link color for the whole skin. It needs an independent setting.


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
So what you want to do here is use an "Open Graph" tag instead of a meta tag. change your meta tag to:

<meta property="og:description" content="{$item_playlist_description|jrCore_entity_string}" />

And that should work.

As for the colors, you'll want to modify the jrPlaylist/css/jrPlaylist_player_dark.css file and add or update a CSS class to specifically target the title - i.e.:

.jp-playlist a {
    color: #FFFFFF !important;
}

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

I know where to find the second one, but where do I enter the first one? Is it the general meta.tpl for the whole skin?


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Ken_Rich:
Hi Brian,

I know where to find the second one, but where do I enter the first one? Is it the general meta.tpl for the whole skin?

Yeah - you could just add:

{if isset($item_playlist_description)}
<meta property="og:description" content="{$item_playlist_description|jrCore_entity_string}" />
{/if}

In to your meta.tpl file. Let me know if that works.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

I couldn't get either one of those fixes to work. I can have another go at it later.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

For the color change, I can do it with the inspect element feature of the browser and see the change. All I do is add !important to:
}
.jrplaylist_player_dark div.jp-type-playlist div.jp-playlist a.jp-playlist-current {
    color:#FFF;
}
also to the li values for the rest of the list.

However, if I do it for real in jrAudio_player_dark.css I don't see the change. It is still being overwritten elsewhere.

I don't understand this, it does not compute!!!


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
For the color I was changing the values in jrAudio_player_dark.css instead of jrPlaylist_player_dark.css

That's why they were not changing (D'OH), so now the color is good.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
brian:
Yeah - you could just add:

{if isset($item_playlist_description)}
<meta property="og:description" content="{$item_playlist_description|jrCore_entity_string}" />
{/if}

In to your meta.tpl file. Let me know if that works.

Still not working. I've added it to the meta.tpl, cleared cache, and checked the scraper at Facebook. I still get this warning and it continues to grab the latest comment, even though a description is entered as a form field.

Quote: Inferred Property The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.

This is the URL I'm using.
http://indiegospel.net/indiegospel/playlist/1/top-10-songs


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Should the first underscore be a period?

{$item_playlist_description|jrCore_entity_string}
to
{$item.playlist_description|jrCore_entity_string}



--

Ken Rich
indiegospel.net

updated by @ken-rich: 01/02/15 11:26:39PM
brian
@brian
10 years ago
10,148 posts
Yes it should be - sorry for not catching that!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
I tried it that way too but it still didn't work. No idea why???


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Ken_Rich:
I tried it that way too but it still didn't work. No idea why???

If you view the page source do you see your meta tag there?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

No it doesn't appear to be there in the head where I would expect it.

I can make it appear in the body if I add {$item.playlist_description} to the body, but then it still doesn't show in the scraper.


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Ken_Rich:
Hi Brian,

No it doesn't appear to be there in the head where I would expect it.

I can make it appear in the body if I add {$item.playlist_description} to the body, but then it still doesn't show in the scraper.

Yeah it has to be in the head section - let me check it out, as I suspect it is because the item variables are not available in the meta.tpl at the time it is processed.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
I've looked at this, and I think the easiest route is have the ShareThis module check for a "description" or "desc" field - i.e.

audio_description

and use that if found. The only way it is actually going to work right now would be to create a custom template just for the module, and there's no reason to do that for every module if you just want the description added in. Since og:description is a valid Open Graph tag, we'll just follow the same naming scheme.

I'll get that worked in and a new release out that should get this working.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
I've just pushed out version 1.0.9 of the ShareThis module that should handle this for you now - update and you should see the og:description meta tag in the head section.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
OK cool - I'm glad it's coming out as a release because what you said was totally over my head lol


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Ken_Rich:
OK cool - I'm glad it's coming out as a release because what you said was totally over my head lol

We just cross posted - update to ShareThis 1.0.9 that I just released and this should be working.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
OK - I'll check on that - thanks


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian,

I did the update, cleared caches, even did an integrity check - but it still doesn't appear to be working.

Am I supposed to remove this from the meta.tpl now?
{if isset($item_playlist_description)}
<meta property="og:description" content="{$item.playlist_description|jrCore_entity_string}" />{/if}

The only thing that I can confirm is working, is the form is making available {$item.playlist_description}. For whatever reason, it still isn't making it into the head when I look at the source here: http://indiegospel.net/indiegospel/playlist/1/top-10-songs

I tried the Facebook scraper, I tried a share through the Share this module and it gave the profile stats for a description.


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Yes - remove that. I have tested here on the audio module and see no issues - it is picking up audio_description. I will test with playlist, but it uses a DS so should be identical to audio.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
I just tested here on a playlist and it is working - I added "test" as a playlist_description custom form field:
<meta property="og:url" content="http://local.jamroom.net/Jamroom5/brian/playlist/42/video-only" />
<meta property="og:type" content="website" />
<meta property="og:title" content="video only" />
<meta property="og:description" content="test" />
<meta property="og:see_also" content="http://local.jamroom.net/Jamroom5/brian/playlist/42/video-only" />
<meta property="og:image" content="" />
<meta property="og:site_name" content="Jamroom Dev" />
<meta property="og:updated_time" content="1420309996" />



--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
10 years ago
926 posts
Hi Brian - it's working now.

I just remembered I had a problem with Sharethis before, not displaying the OG image properly, so I had given it one directly. Since it was an ACP mod, the update wan't "taking".

I just reset to the new version and all is well. Thanks - this was something really needed.


--

Ken Rich
indiegospel.net
brian
@brian
10 years ago
10,148 posts
Ken_Rich:
Hi Brian - it's working now.

I just remembered I had a problem with Sharethis before, not displaying the OG image properly, so I had given it one directly. Since it was an ACP mod, the update wan't "taking".

I just reset to the new version and all is well. Thanks - this was something really needed.

awesome - glad to hear that :)

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net