Only custom fields to open in same window

communicat
Topic Author
Posts: 6
6 years 9 months ago #829 by communicat
Only custom fields to open in same window was created by communicat
Hi,

I like this extension a lot! I wonder if it is possible to have only the custom fields open in the same window while social media fields open in a new window. Now I can choose between new or same window for all fields.

Maybe by adding code somewhere?

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

Lodder
Lodder's Avatar
Posts: 1180
6 years 9 months ago #830 by Lodder
Replied by Lodder on topic Only custom fields to open in same window
Hi communicat,

This isn't a feature yet but it is possible with a few code changes.

Firstly, I suggest you make a template override so that if we ever release an update for the Social Slider and you install it, your changes will remain the same and won't be overridden.

To do a template override, have a read of the following:

docs.joomla.org/How_to_override_the_outp...rom_the_Joomla!_core

Once done, open the default.php file located in:
templates/YOUR_TEMPLATE/html/mod_social_slider/default.php

and toward the bottom of the file, you will find the following code:
if ($parts[1] < 16)
{
    echo '<li class="' . $key . '"><a href="' . $params->get($key . '_link') . '"' . $target . '><span class="jj_social_text">' . JText::_('JJ_SOCIAL_SLIDER_VIA_' . $uppercase . '') . '</span></a></li>';
}
else
{
    echo '<li class="' . $key . '"><a href="' . $params->get($key . '_link') . '"' . $target . '><span class="jj_social_text">' . JText::_($params->get($key . '_text')) . '</span></a></li>';
}

which you will need to replace with the following:
if ($parts[1] < 16)
{
    echo '<li class="' . $key . '"><a href="' . $params->get($key . '_link') . '"' . $target . '><span class="jj_social_text">' . JText::_('JJ_SOCIAL_SLIDER_VIA_' . $uppercase . '') . '</span></a></li>';
}
else
{
    echo '<li class="' . $key . '"><a href="' . $params->get($key . '_link') . '"><span class="jj_social_text">' . JText::_($params->get($key . '_text')) . '</span></a></li>';
}

Save the file and now the custom slide will open in the same window.

Regards,
Lodder

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

communicat
Topic Author
Posts: 6
6 years 9 months ago #831 by communicat
Replied by communicat on topic Only custom fields to open in same window
Thank you so much for your quick reply and very helpful answer. It works exactly as I want it to, social media opens in a new window and custom slides in current window. Thanks again!

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

Lodder
Lodder's Avatar
Posts: 1180
6 years 9 months ago #832 by Lodder
Replied by Lodder on topic Only custom fields to open in same window
You're more than welcome communicat.

If you would be so kind as to rate and review the Social Slider on the Joomla Extensions Directory, that would be much appreciated:

extensions.joomla.org/extensions/social-...ocial-profiles/22999

Regards,
Lodder

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

Powered by Kunena Forum