Keyword

What is K2 unique id for article

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #167357 by aarokkiyam
What is K2 unique id for article was created by aarokkiyam
Hi, I am a newbie to K2 implementing Vuuke commenting platform in K2 articles.
I am looking for help to fill the below K2 params for articleId, img, tags.
Appreciate your support.
<script>
  var VUUKLE_CONFIG = {
  	articleId: "Generate Unique id for your article",
  	img: "Article image URL",
  	tags: "Up to 3 tags separated by comma",
  };
  // ⛔️ DON'T EDIT BELOW THIS LINE
  (function() {
 	 var d = document,
  		s = d.createElement('script');
	 s.src = 'https://cdn.vuukle.com/platform.js';
	(d.head || d.body).appendChild(s);
  })();
 </script>

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 3 weeks ago #167360 by Krikor Boghossian
Replied by Krikor Boghossian on topic What is K2 unique id for article
Hello,
I have answered your previous post.
You can use the item's id. You can also look at the item.php's code and get the code for the item's image and the loop that generates the tags.

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

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

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #167371 by aarokkiyam
Replied by aarokkiyam on topic What is K2 unique id for article

Krikor wrote: Hello,

Depending on the context (category_item, item) the id can be printed with either $this->item->id or $item->id


I tried both, but it doesn't generate article ID ;-(

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 3 weeks ago #167375 by Krikor Boghossian
Replied by Krikor Boghossian on topic What is K2 unique id for article
Can you send me the entire code block and its context?

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

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

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #167378 by aarokkiyam
Replied by aarokkiyam on topic What is K2 unique id for article
Context: ..../catagery/itemid-alias.html

URL:
www.inneram.com/india/16431-flight-accident-in-hyderabad.html

JS integration: docs.vuukle.com/how-to-embed-vuukle-2.0-via-js/
<script>
  var VUUKLE_CONFIG = {
  	apiKey: "Place Your API Key Here",
  	articleId: "Generate Unique id for your article",
  	img: "Article image URL",
  	tags: "Up to 3 tags separated by comma",
  };
  // ⛔️ DON'T EDIT BELOW THIS LINE
  (function() {
 	 var d = document,
  		s = d.createElement('script');
	 s.src = 'https://cdn.vuukle.com/platform.js';
	(d.head || d.body).appendChild(s);
  })();
 </script>

Thank you in advance.

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

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #167384 by aarokkiyam
Replied by aarokkiyam on topic What is K2 unique id for article
Hello Krikor, your help in this regard is highly appreciated.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 3 weeks ago #167398 by Krikor Boghossian
Replied by Krikor Boghossian on topic What is K2 unique id for article
Can I have the PHP/. JS code you used?

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

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

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago - 6 years 3 weeks ago #167400 by aarokkiyam
Replied by aarokkiyam on topic What is K2 unique id for article
Hello Krikor,

The item.php file contents are attached

File Attachment:

File Name: item.txt
File Size:28 KB


File Location: Templates/template_name/html/com_k2/templates/default/item.php

The shortcodes for displaying the various Vuukle plugins such as <div id='vuukle-comments'></div> was inserted in the above item.php

The JS integration code was inserted in the template custom code Before </body>.

Thank you.
Attachments:
Last edit: 6 years 3 weeks ago by aarokkiyam.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 3 weeks ago #167427 by Krikor Boghossian
Replied by Krikor Boghossian on topic What is K2 unique id for article
If you place the JS code outside the component (item.php) you will lose the $this->item variables.
If the positioning is mandatory (I don't think so) then you will have to populate these values another way.
You could eg: data attributes in certain DOM elements and getting their values, but I would recommend using PHP code and moving the integration inside the item.php file.

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

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

  • aarokkiyam
  • aarokkiyam's Avatar Topic Author
  • Offline
  • New Member
More
6 years 3 weeks ago #167438 by aarokkiyam
Replied by aarokkiyam on topic What is K2 unique id for article
I used PHP code for variables and pushed the JS code inside item.php
The result is perfect. You made my day! ;-)

Thanks a lot Krikor!

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


Powered by Kunena Forum