Metatag Description and Open Graph Metatag Description?
slart
Joined: 2013-11-11
Posts: 112 |
Posted: Sat, 2013-12-14 16:53 | |||
Hello, Currently I have the text blocks inserted as the description there where I have moved the php code for that. Quote:
themes/clean_canvas/views/info_block.html.php But this is a bad solution because of the meta description is too long. Is there a better solution? I need this only for the start page and the album pages. Please see in the Attachement. Here is a screenshot. (I have it pixelated.)
|
||||
Posts: 27300
Your screen shot does not help at all.
So you want to truncate the meta tag?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 112
Hi floridave, yes I would like to shorten the text in the meta tag description.
I have tried the module text truncate, but that does not work in my Gallery, and bring not probably the solution.
Posts: 27300
OK how is the meta description generated? Is it a module ( what module) or is it built into the theme?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 112
Hi Dave, I have (now) 2 different meta tags. The normal metatags and the Open Graph meta tags.
Normal: <meta name="_______" content="__________" />
Open Graph: <meta property="og:________" content="_______"/>
The normal are manually inserted into themes/clean_canvas/views/page.html.php. With solid content (not so good).
The Open Graph is from the module social share.
OK, I just think the normal meta tags description could also be in the social share module. tricky ;)
Posts: 27300
So the social share module has a OG: meta tag for the description you want to be truncated?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Explain with code you are using.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 112
Hi Dave, that is the Module social share: http://codex.galleryproject.org/Gallery3:Modules:social_share
That is the source code from the modules/social_share/helpers/social_share_themes.php
I have expanded it with the metatag og:description. Thanks to tempg http://galleryproject.org/node/112388#comment-407512
The normal Metatag source code in the themes/clean_canvas/views/page.html.php , which I have added manually.
Posts: 112
It would be nice if the Open Graph meta tags would not be generated in the module social share, but along with the regular meta tags to the page itself, or the theme.
If it is possible to draw up a simple solution to the image description truncated in the metatags description and og:description to take into it.
PS: I changed the Topic. I had a mistake. The description of the photos is called also description that I have confused with the meta tag description.
Posts: 112
I found this, but no idea where I should put this.
http://www.the-art-of-web.com/php/truncate/
I like the option "2. Truncation at sentence breaks".
Posts: 112
Hi Dave, you have no idea?
Posts: 112
Wow! I am pleasantly surprised and happy! I've manage it myself.
I have the whole Gallery3:Modules list read but the Modules:metadescription overlooked. sorry.
Step by step.
- install and activate Module:social share
- activate Module:tag (You can do it from the sidebar take in the admin settings, when you don't use it.)
- install and activate Module:metadescription
move, change and adapt.
/modules/metadescription/views/metadescription_block.html.php
at the end
You can insert here more meta tags if you wish.
You can determine the length of the characters of the description here.
If a Facebook Like is not enabled, then this change yet.
/modules/social_share/helpers/social_share_theme.php
make a _ in this lines, and deactivate it. Facebook is your side no longer angry. (see debugger)
Use the Facebook Debugger to your pages in Facebook reread. Facbook has a cache.
Posts: 27300
Great! Glad you got it sorted and posted back for the community as well.
Cheers!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 241
FYI, I put the following function in my local.php to truncate the description if it's too long:
Think I added the quote replacement because if I didn't it would cause a problem
Then in my theme's page.html.php file I have:
I have that Social Share module but either the version I have doesn't output the description information or I took it out LOL.
- Mark H.
Using Gallery 3.0.9 - gallery.markheadrick.com