- Posts: 7
COMMUNITY FORUM
What is K2 unique id for article
- aarokkiyam
-
Topic Author
- Offline
- New Member
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
-
- Offline
- Platinum Member
- Posts: 15920
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.
Please Log in or Create an account to join the conversation.
- aarokkiyam
-
Topic Author
- Offline
- New Member
- Posts: 7
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
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- aarokkiyam
-
Topic Author
- Offline
- New Member
- Posts: 7
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
-
Topic Author
- Offline
- New Member
- Posts: 7
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- aarokkiyam
-
Topic Author
- Offline
- New Member
- Posts: 7
The item.php file contents are attached
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.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
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.
Please Log in or Create an account to join the conversation.
- aarokkiyam
-
Topic Author
- Offline
- New Member
- Posts: 7
The result is perfect. You made my day! ;-)
Thanks a lot Krikor!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.