When the module is displayed as a Block, every URL that is shared appears as "domain/"

Comments

micropat’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Closed (works as designed)

When AddToAny is displayed as a Block, the current node URL is shared, otherwise the frontpage URL is shared.

Please update with specific details if you're experiencing some other related problem.

codewatson’s picture

Category: support » bug
Status: Closed (works as designed) » Active

I can confirm this, to give you more info, this happens on a page that is not a node, for instance the standard drupal contact page, or a views created page.

matt b’s picture

Version: 6.x-3.3 » 7.x-4.0

Same issue here. If I place the block on a page which is not a node then I want the current page title and current page url to be submitted. Here's my quick hack to addtoany.module:
At line 235 replace

	} else { // Front page
		$link_name	= (module_exists('page_title')) ? page_title_page_get_title() : variable_get('site_name', 'Drupal');
		$link_url = url('<front>', array('absolute' => 1));

with

} else { // Current page
		$link_name	= (module_exists('page_title')) ? page_title_page_get_title() : drupal_get_title();
		$link_url = url(current_path(), array('absolute' => 1));

Seems a bit complicated to use the node object to determine the current title and path anyway - my code above would work on any page regardless of it being a node or otherwise - or am I missing something?

roflcopterDorrie’s picture

Issue summary: View changes
StatusFileSize
new794 bytes

The solution in #3 works for me. I have created a patch for version 7.x-4.5

roflcopterDorrie’s picture

Version: 7.x-4.0 » 7.x-4.5
Status: Active » Needs review
sassafrass’s picture

I have a similar issue. Links work correctly when on a full node page. However, on my front page Blog view, all links, except for LinkedIn, work. I tried applying this patch, but it had no affect. This is my configuration:

<div class="a2a_kit a2a_default_style">
<a class="a2a_button_facebook_like"></a>
<a class="a2a_button_twitter_tweet"></a>
<a class="a2a_button_google_plus_share"></a>
<a class="a2a_button_linkedin"></a>
</div>

<script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>

The Universal Share button picks up the correct title/url for LinkedIn, it's just the stand alone version that does not...and only on the front page blog view. LinkedIn works correctly when viewing the fill page node.

ankitchauhan’s picture

I'm also facing the same issue with Linkedin Service button.

vladimir-m’s picture

Patch for version 7.x-4.6

micropat’s picture

Status: Needs review » Closed (fixed)

Fixed in 7.x-4.7 thanks to comments and patches.

durancode’s picture

I was asking to make that the front page spolights articles the addtoany buttos share its articles url cause before they share de home page instead, the solution for this was remove a previus patch for the addtonay.module
line 230
-

if (!isset($url) || is_front ) 

+

if (!isset($url) ) 

Drupal 8