× Joomla Facebook Connect support forum

Topic-icon Solved: Content plugin only on one template?

Active Subscriptions:

None
Hi!

First of all, thank you for an excellent product! Very satisfied so far!

I was wondering if it was possible to limit when to show the content plugin based on what template is active? This is for a mobile version of the site.

Thanks! :)
The topic has been locked.
Support Specialist
15 years 1 month ago #9797 by alzander
Leif,
Glad to hear your liking JFBConnect! Always like satisfied customers. Unfortunately though, right now we don't have an easy way to limit the Content plugin. It's something we'll be adding in a future release for some other reasons (in addition to mobile enablement).

However, we love happy customers... so, while this hasn't been tested much, if you're up for adding a a few lines of code, this should do what you're looking for. In the /plugins/content/jfbccontent.php file, at line 21, you'll see the function onContentPrepare. Right at the top of this function, you'll see the first two lines.. add the $template line and return statement afterward as below:
function onPrepareContent(& $article, & $params, $limitstart)
    {
        $app = JFactory::getApplication();
        $template = $app->getTemplate();  <---- ADD THIS
        if ($template == 'rhuk_milkyway') <---- ADD THIS
            return; <---- ADD THIS
....

In the if statement, make sure you update the check with the name of your mobile template, and you should be good to go.

Let us know how this works out, and of course, test. Good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9804 by fb_592346927
Hi!

It works excellent, and I do not see any problems.

Thank you so much for your quick help!

Leif Erik
The topic has been locked.
Support Specialist
15 years 1 month ago #9805 by alzander
Leif,
Glad to hear it worked out, and hopefully everything else is smooth sailing for you.

After you've really put JFBConnect through the paces, please consider leaving a review on the JED. It really helps us out, but of course, is not required:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks again, and best of luck to you and your site!
The topic has been locked.