solved Social Networks

pch
@pch
9 years ago
328 posts
Hello,

The social networks feature in the skin setting is great but it is limited with few items only (Facebook, Twitter, Google, Linkedin).

How to add more social networks: Youtube, Instagram, Pinterest etc?

Also like in our case, we are building a multilingual site and we have:

e.g:

facebook.com/english_page
facebook.com/french_page
facebook.com/spanish_page

twitter.com/english_page
twitter.com/french_page
twitter.com/spanish_page

How to get the site to point to let's say facebook.com/english_page when the english version of the JR site is visited and let's say to: facebook.com/french_page when the french version of site is visited?

Thanks
updated by @pch: 08/16/16 01:15:11AM
michael
@michael
9 years ago
7,821 posts
You can use the form designer:

Docs: "Using the Form Designer"
https://www.jamroom.net/the-jamroom-network/documentation/getting-started/1275/using-the-form-designer

To add any fields you want to the profile update page, then you can display them in the users profile.

If you only want to show some for a specific language, then you get the variable for the language and use an IF conditional

Docs: "Template Blocks"
https://www.jamroom.net/the-jamroom-network/documentation/development/3126/template-blocks

on the language variable. You can understand what variables are available to you in any template by dropping a {debug} into a location where you are thinking about showing whatever the user has input in the form.

Docs: "{debug}"
https://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug

It will probably look something like:
{if $_user.user_language == 'ja-JP'}
    {$_profile.profile_facebook_japanese}
{elseif $_user.user_language == 'fr-FR'}
    {$_profile.profile_facebook_french}
{else}
    {$_profile.profile_facebook_english}
{/if}
douglas
@douglas
9 years ago
2,807 posts
If you are referring to the Social links in the skins footer section, they are controlled by the skin settings and can be found in the skins config.php file.

skins/jrElastic/config.php
    // Social Media
    $num = 20;
    foreach (array('twitter', 'facebook', 'google', 'linkedin', 'youtube', 'pinterest') as $network) {

        // App Store URL
        $_tmp = array(
            'name'     => "{$network}_name",
            'type'     => 'text',
            'default'  => '',
            'validate' => 'printable',
            'label'    => ucfirst($network) . " profile",
            'help'     => "If you have an account for your site on " . ucfirst(str_replace('_', ' ', $network)) . ", enter the profile name and the network icon will show in your footer.  Leave blank to disable.",
            'order'    => $num++,
            'section'  => 'social networks'
        );
        jrCore_register_setting('jrElastic', $_tmp);
    }

You'll want to modify that bit of code to add in your other links in, then look in the footer.tpl for your skins and you'll see how the links are being added...

skins/jrElastic/footer.tpl
                        {* Social Network Linkup *}
                        {if strlen($_conf.jrElastic_twitter_name) > 0}
                            <a href="https://twitter.com/{$_conf.jrElastic_twitter_name}">{jrCore_image image="sn-twitter.png" width="40" height="40" class="social-img" alt="twitter" title="Follow @{$_conf.jrElastic_twitter_name}"}</a>
                        {/if}

                        {if strlen($_conf.jrElastic_facebook_name) > 0}
                            <a href="https://facebook.com/{$_conf.jrElastic_facebook_name}">{jrCore_image image="sn-facebook.png" width="40" height="40" class="social-img" alt="facebook" title="Like {$_conf.jrElastic_facebook_name} on Facebook"}</a>
                        {/if}

                        {if strlen($_conf.jrElastic_linkedin_name) > 0}
                            <a href="https://linkedin.com/{$_conf.jrElastic_linkedin_name}">{jrCore_image image="sn-linkedin.png" width="40" height="40" class="social-img" alt="linkedin" title="Link up with {$_conf.jrElastic_linkedin_name} on LinkedIn"}</a>
                        {/if}

                        {if strlen($_conf.jrElastic_google_name) > 0}
                            <a href="https://plus.google.com/{$_conf.jrElastic_google_name}">{jrCore_image image="sn-google-plus.png" width="40" height="40" class="social-img" alt="google+" title="Follow {$_conf.jrElastic_google_name} on Google+"}</a>
                        {/if}

                        {if strlen($_conf.jrElastic_youtube_name) > 0}
                            <a href="https://www.youtube.com/channel/{$_conf.jrElastic_youtube_name}" target="_blank">{jrCore_image image="sn-youtube.png" width="40" height="40" class="social-img" alt="youtube" title="Subscribe to {$_conf.jrElastic_youtube_name} on YouTube"}</a>
                        {/if}

                        {if strlen($_conf.jrElastic_pinterest_name) > 0}
                            <a href="https://www.pinterest.com/{$_conf.jrElastic_pinterest_name}" target="_blank">{jrCore_image image="sn-pinterest.png" width="40" height="40" class="social-img" alt="pinterest" title="Follow {$_conf.jrElastic_pinterest_name} on Pinterest"}</a>
                        {/if}

You could then use Michael's code above to show the correct language social link according to the sites language setting.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags