Keyword

Sharing an article just created

  • Stefano Messina
  • Stefano Messina's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 week ago #103788 by Stefano Messina
Sharing an article just created was created by Stefano Messina
Hi, i have a site where users can create simple pages using K2 frontend editor, then after saving, in the popup/system message confirming that the operation is done I created a simple FB sharing button (made with addThis).

Now, the button needs an absolute URL to know what to share, and here's my question: how can I "generate" (through PHP i suppose) the URL of the just created article to feed to the share button?

Thanks in advance.

Please Log in or Create an account to join the conversation.

More
12 years 1 week ago #103789 by Lefteris
Replied by Lefteris on topic Re: Sharing an article just created
Hi. Assuming you know what you are doing you need to something like this:
$link = K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->catid.':'.urlencode($item->category->alias));
$item->link = urldecode(JRoute::_($link));

Of course you need to replace the variables with the item's.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum