× Joomla Facebook Connect support forum

Topic-icon K2 - Move Bottom Social Features

Active Subscriptions:

None
12 years 3 months ago #18174 by rdbean
Hi Alex,

I'm using a custom K2 Template. Is there a way to move the K2 Comments below the video?

Also I'm assuming that I "could have" Social Tags for Like G+ LI above the video and comments after?

Thanks man,

Rich
The topic has been locked.
Support Specialist
12 years 3 months ago #18179 by alzander
Rich,
What video are you talking about? Is it a special add-on for K2, or built-in to it?

Our auto-buttons are pretty restricted by Joomla and K2, so not sure how much you can move things around. Basically, if the video is being inserted by another Content Plugin, you should simply move the JFBCContent plugin after that one, and the comments/social buttons should show up after it too (if they're set to "bottom"). If it's not from a plugin, you'll likely be restricted to the 'flow' of K2.. it renders and then it calls the plugins to print their stuff.. we can't really insert things 'inside' the content somewhere else other than where we're called in the flow.

Hope that makes sense and helps. If not, just let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 3 months ago #18181 by rdbean
Hi Alex,

Standard K2 Video Item much like their Standard Image. See here: www.mediastars.tv/Media-Talent/Sports/Brian-Wilkins

I guess I could disable the Comments in the settings then add a Comments module.

Cheers,

Rich
The topic has been locked.
Support Specialist
12 years 3 months ago #18204 by alzander
Rich,
Just had a look at how item.php template file for K2 to see how it was rendering things. Basically, it shows the following things in order (among a lot of other stuff):
item->introtext
item->fulltext
item->video

Our content plugin basically affects the introtext and fulltext by either prepending or appending the social buttons and comments to those values. Since the item->video is 'outside' those values, it basically makes it invisible to our plugin. The same would be true of the Gallery (which shows after the video).

In the content plugin, we're passed the whole article (item), so it's possible we could detect if there is a video (or gallery) and give an option to show after that (instead of the text). For now, if you want to try something -completely- untested, here's an idea :)

In the /plugins/content/jfbcontent.php file, around line 566 (in the _appendToFulltext function, change it to this:
if (isset($article->video))
            $article->video = $article->video . $fbText;
        else if (isset($article->text))
            $article->text = $article->text . $fbText;
        else if (isset($article->fulltext))
            $article->fulltext = $article->fulltext . $fbText;
You're adding the first 2 lines (if video) and add else to the line after that (so it's an else if, not just an if).

You may need to try if (!empty($article->video)) instead of isset.. not sure what's going to come in to our plugin.

Hopefully, that will work and show any social widgets after the video if it is actually set.. who knows what will happen though :D I'm sure you'll let us know!

Good luck,
Alex
The topic has been locked.