Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello everyone!

I'm building a blog with CouchCMS and I've gotten to the social media part. I've been trying to use the "Sharethis" buttons but but I'm missing the URL and the type information. How can I retrieve this information from the Couch page?

Code: Select all
        <head>
            <meta property="og:title" content="<cms:show k_page_title />" />
            <meta property="og:image" content="<cms:show imagem />"/>
            <meta property="og:description" content="<cms:show description />" />
            <meta property="og:url" content=" ??? " />
            <meta property="og:type" content=" ??? " />
        </head>


Thank you for the help.
Please help yourself to my Open Graph and Twitter Card tags.
Code: Select all
<!-- Open Graph sharing information tags -->
<meta property="og:title" content="<cms:show k_page_title />" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<cms:show cover_photo />" />
<meta property="og:image:type" content="<cms:image_size cover_photo 'mime' />" />
<meta property="og:image:width" content="<cms:image_size cover_photo 'width' />" />
<meta property="og:image:height" content="<cms:image_size cover_photo 'height' />" />
<meta property="og:url" content="<cms:show k_page_link />" />
<meta property="og:description" content="<cms:if summary><cms:show summary/><cms:else/><cms:excerpt count='60' trail=''><cms:show article /></cms:excerpt></cms:if>" />
   
<!--Twitter Card sharing tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="<cms:show k_page_title />" />
<meta name="twitter:description" content="<cms:if summary><cms:show summary/><cms:else/><cms:excerpt count='60' trail=''><cms:show article /></cms:excerpt></cms:if>" />
<meta name="twitter:image" content="<cms:show cover_photo />" />

On lines 4-7 and line 15, cover_photo is the name of the editable region that holds the primary image for the page.

On lines 9 and 14, summary is an editable region specifically for a social media and SEO description. If the summary field is left blank, an excerpt of the article is used instead.

This code takes advantage of a custom tag described in the following post to provide size and mime type information about the image. Add the code listed there to your couch/addons/kfunctions.php file if you want to use it for those image features. (You do.)
viewtopic.php?f=8&t=10386&p=26494#p26494

I know this is more than you asked for. Let me know if you need any help or clarification.
Thank you so much!! This is perfect, works like a charm!
3 posts Page 1 of 1