• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Social Bookmarking Plugin and CG Blog Module
PostPosted: Thu Aug 18, 2011 8:53 pm 
Offline
Forum Members
Forum Members

Joined: Mon Feb 21, 2011 2:08 am
Posts: 50
Ok.. I am trying to get the social bookmarking plugin to recognize the actual blog title instead of the default page that the post appears on.

What I would LIKE to happen is something like this:
Code:
{if isset($blogtitle)}{$blogtitle}{else}{title}{/if}


So when Social Bookmarking Plugin is on a blog page it pulls the blog title for the post instead of the default pages title.

Obviously something has to be set in Social Bookmarking to tell it to look for the Blog title but I can't figure out where and what line to change to make this happen.

In the template I am thinking something like this might work:

Code:
{assign var='mytitle' value=$entry->title|escape}


but in the social bookmarking code i am not sure how to add it into this section:

Code:
$title_prefix = isset($params['title'])?$params['title']:""; // Page title prefix.
    $link_target = isset($params['target'])?$params['target']:""; // _blank etc.
    $submitto = isset($params['submitto'])?$params['submitto']:""; // array containing list of sites to print links to
    $img_dir = isset($params['img_dir'])?$params['img_dir']:""; //directory images are uploaded to
   $real_url = (isset($params['real_url']) && $params['real_url']);
    $pageinfo = &$gCms->variables['pageinfo'];
    $curtitle = urlencode($title_prefix);
    $curtitle .= urlencode(cms_htmlentities($pageinfo->content_title)); //title with prefix


Any help is appreciated...


Top
 Profile  
 
 Post subject: Re: Social Bookmarking Plugin and CG Blog Module
PostPosted: Fri Aug 19, 2011 7:40 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 1979
Location: Feldkirchen in Kärnten, Austria
Not sure how this plugin works, never used it but i see it has title parameter, so if you call plugin tag in you Blog template you can simply use that parameter title=$entry->title no need to complicate things and hack the code.

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
 Profile  
 
 Post subject: Re: Social Bookmarking Plugin and CG Blog Module
PostPosted: Fri Aug 19, 2011 12:10 pm 
Offline
Forum Members
Forum Members

Joined: Mon Feb 21, 2011 2:08 am
Posts: 50
Yeah I tried that.. after looking at the code and messing around with it - unfortunately, the "title" tag it's referring to is referring to a parameter in the tag {socialbookmark title="blahblah"}.

It takes that "title" and adds it as a prefix to the page title so you can do your site name or anything else you want to put in front of the title. It doesn't actually override the page title?

I think the link I need to do something with is this line:

Code:
 $curtitle .= urlencode(cms_htmlentities($pageinfo->content_title)); //title with prefix


using the section: cms_htmlentities($pageinfo->content_title) but honestly I tried changing the content_title piece to just title and also blogtitle and it just doesn't seem to work?

If you try to post say to Facebook using the plugin from one of the blog pages, it post just fine. Even the URL it sends someone to is the correct blog URL, but the title and description it uses are those of the default page the blog appears on?


Top
 Profile  
 
 Post subject: Re: Social Bookmarking Plugin and CG Blog Module
PostPosted: Fri Aug 19, 2011 1:56 pm 
Offline
Forum Members
Forum Members

Joined: Mon Feb 21, 2011 2:08 am
Posts: 50
Ok.. so what I am starting to think is it's not the plugin itself, but more how the default page works when you attempt to post content to social sites...

If I simply copy the URL directly from the blog page and attempt to post it on Facebook, i get the same result... which tells me it's the page itself causing the result and not actually the plugin - I think?

On the page there's a section under options there's a section for Smarty data or logic that is specific to this page.

I attempted to try something like this:
Code:
{if isset($blogtitle)}{$blogtitle}{else}{title}{/if}

but that doesn't appear to effect anything on the posting side.

It is still reading the information from the default CMS page the blogs appear on? All the META tags and titles refer to the blog post..

The only thing that even refers to the default page in the page source is the fact that it's showing this as the menuactive > menuparent page?

I'm just posting my thoughts here in hopes this will spark someone else's brilliant solution while I attempt to figure this out....


Top
 Profile  
 
 Post subject: Re: Social Bookmarking Plugin and CG Blog Module
PostPosted: Fri Aug 19, 2011 2:09 pm 
Offline
Forum Members
Forum Members

Joined: Mon Feb 21, 2011 2:08 am
Posts: 50
OK.....

So I figured out the problem! This is the actual CG Blog module itself causing this NOT the Social Bookmarking Plugin...

IN the Blog Module options there's an option to set a Default detail page (if no page id is specified on the URL) and a default summary page.

With those set, the Blog module pulls the data from the actual default page instead of from the blog itself.

If you set those to None, the post work as expected and the title and description are from the blog post.

So the big question now is.. what is the purpose of those option settings in the blog module?

Why would I need them to be set and what are the problems (if any) with them not set?


Top
 Profile  
 
 Post subject: Re: Social Bookmarking Plugin and CG Blog Module
PostPosted: Fri Apr 13, 2012 5:47 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Sat Apr 18, 2009 10:09 pm
Posts: 402
Location: Maidenhead, UK
Hi

I had the same problem, the socialBookmarking tag was not using the right title and URL when placed in a cgblog detail template. Bilmartech's solution did not work for me - the cgblog Default detail page and Default summary page were already set to none and if I change them there is no change in behaviour.

I sorted it out (this thread assisted me) - here is how I got it working, in case it is of use to others:

My socialBookmarking tag now looks like this:

Code:
{assign var="blogtitle" value=$entry->title|escape}
{socialBookmarking real_url=1 title=$blogtitle}

The first assign line grabs the title of the blog post so it can be used in line 2.

Line 2 includes real_url=1 which forces the socialBookmarking tag to use $_SERVER["REQUEST_URI"] type of thing to grab the actual URL. And the assigned variable $blogtitle is passed to socialBookmarking as the title; this overwrites the default title in the tag's code.

Works like a charm now. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner