Keyword

embed video in user page

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143313 by Surdo
embed video in user page was created by Surdo
Hello, the site that I'm developing has a number users/staff members contributing to a variety of blogs (K2 category pages). Each user has a K2 "User page (blog)" which displays their photo, biography and contributions to the various category-blogs.

I've not been able to configure the "User pages" so that they display video inline. They do successfully show video items, however only the title and text. I'd like to embed the actual video on the user page.

Sorry if I've missed something obvious, but can this be done, and if so, how?

Thanks,

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #143332 by Krikor Boghossian
Replied by Krikor Boghossian on topic embed video in user page
Hello,

You can add a module which contains the video, or you can override the user's description text and enable content plugins in that field.

These posts will help you with the overrides.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
docs.joomla.org/Triggering_content_plugins_in_your_extension

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

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143339 by Surdo
Replied by Surdo on topic embed video in user page
Thanks. I didn't mention that I'm using Joomla! 3.4.1 and K2 v2.6.9. Re. the first link you sent, It seems like the correct files are already present in my /templates/ja_nuevo/html/com_k2 folder, so I haven't copied them from /components/com_k2/templates/

Re. the second link, could you please send more specific information? Should I be editing the file /templates/ja_nuevo/html/com_k2/profile.php? Or /templates/ja_nuevo/html/com_k2/profile.php/default/user.php?

Just in case I didn't make my self clear in my first post here is a screenshot of the user page with missing video: imgur.com/YbFIp3P

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #143355 by Krikor Boghossian
Replied by Krikor Boghossian on topic embed video in user page
Oh I misunderstood you.

The overriding part still applies, but disregard the latter part.
The link I am attaching does the same in tag listings. The code is almost the same and the logic/ method is exactly the same.
www.joomlaworks.net/forum/k2-en/41103-use-plugins-in-tag-view#143141

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

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143378 by Surdo
Replied by Surdo on topic embed video in user page
Thanks Krikor. For convenience I pasted the code near the top of the file

/templates/ja_nuevo/html/com_k2/default/user.php

I'll move it to a better position in user.php later.

It's working in that it is displaying the description text from the item, however it is not displaying the video. The video, by the way, is embedded Youtube material, configured via K2 Edit item-->Media-->Use online video service-->Youtube

Here is a screenshot showing the video description displayed before the user profile:

imgur.com/5TdaypM

Is there a way to show the video?

I imagine that my colleagues will mainly be embedding youtube videos on the new site. Some will use Vimeo and some will upload files directly to the site (Allvideos is installed).

Cheers,

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143379 by Surdo
Replied by Surdo on topic embed video in user page
I notice that if I add the code:

echo $item->video;

it displays the following on the page as text:

{YouTube}hqA76wWprbE{/YouTube}

but doesn't execute the tag. Getting closer...

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

More
8 years 11 months ago #143408 by Lefteris
Replied by Lefteris on topic embed video in user page
@Surdo

Have you applied the code from www.joomlaworks.net/forum/k2-en/41103-use-plugins-in-tag-view#143141 ? All you need to do is replace the "gallery" word with "video" word.

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

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143423 by Surdo
Replied by Surdo on topic embed video in user page
I changed the word 'gallery' to 'video' in the code and also tried changing

$params->set('galleries_rootfolder', 'media/k2/galleries');

to

$params->set('videos_rootfolder', 'media/k2/videos');

however the video is not shown, instead the following curly bracketed statement is printed on the page:

{video}3{/video}

It also seems that media/k2/videos contains actual video material, whereas at the moment I'm dealing with embedded YouTube and Vimeo IDs. I will though be using uploaded videos in the future in addition to videos referenced from other servers such as YouTube etc. Not sure what should be done with the "params" value.

Thanks for your help

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago - 8 years 11 months ago #143440 by Surdo
Replied by Surdo on topic embed video in user page
OK - i see that the if statement needs modifying and should be the following (if using youtube and vimeo):

if (JString::strpos($item->video, 'YouTube') === false && JString::strpos($item->video, 'Vimeo') === false)
{
$item->video = "{video}{$item->id}{/video}";
}

I haven't checked though if this references uploaded videos correctly or not. The video tags for vimeo and youtube are however now printed correctly on the page. eg. {Vimeo}47353020{/Vimeo} and YouTube}hqA76wWprbE{/YouTube}

If I paste these two tags into a normal Joomla article they are executed and the videos are shown, so the allvideos plugin is working on the site. It seems though that plugin is not being called properly in the user.php file.
Last edit: 8 years 11 months ago by Surdo.

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

  • Surdo
  • Surdo's Avatar Topic Author
  • Offline
  • Junior Member
More
8 years 11 months ago #143463 by Surdo
Replied by Surdo on topic embed video in user page
I'm rather confused about this. If I paste a tag such as {Vimeo}47353020{/Vimeo} in the intro-text of an item, the video is displayed correctly in the user page of the original poster. If however I generate the same tag via the code: echo "$item->video"; within user.php, the tag is not resolved.

Please see the following screenshot of a test user page:

imgur.com/XssndxG

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


Powered by Kunena Forum