Add social links (fields) in admin

murko
Sr. Bludit
Posts: 46
Joined: Sat May 28, 2016 11:16 am

Tue Jun 07, 2016 6:33 pm

Is this possible to add manually (eg. no need for a new version I mean. Maybe my links are not for everyone :))?
In admin page under settings (general) I have this
Image


Say I'd like to add a few sites. Lets say Tumblr and Linkedin to make it look like this
Image


In my sidebar.php I now have:

Code: Select all

<?php
		if($Site->twitter()) {
			echo '<a href="'.$Site->twitter().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_tweet.png" title="Twitter"></a>';
		}

		if($Site->facebook()) {
			echo '<a href="'.$Site->facebook().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_fb.png" title="Facebook"></a>';
		}

		if($Site->instagram()) {
			echo '<a href="'.$Site->instagram().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_insta.png" title="Instagram"></a>';
		}

		if($Site->github()) {
			echo '<a href="'.$Site->github().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_git.png" title="Github"></a>';
		}

		if( $plugins['all']['pluginRSS']->installed() ) {
			echo '<a href="'.DOMAIN_BASE.'rss.xml'.'"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_rss.png" title="RSS"></a>';
		}

		if( $plugins['all']['pluginSitemap']->installed() ) {
			echo '<a href="'.DOMAIN_BASE.'sitemap.xml'.'"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_sitemap.png" title="Sitemap"></a>';
		}
	?>
...at the moment giving me this:
Image

Sure, I could use the fields I am currently not using, but it would make more sense to me to actually add a couple instead



So...
What would I need to do (step-by-step) to add new fields in admin (social network links) and then present them (if filled in) on my page?
I'm guessing the presenting is the easy part and just copy/paste from the existing part and put out:

Code: Select all

if($Site->linkedin()) {
			echo '<a href="'.$Site->linkedin().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_linkedin.png" title="Linkedin"></a>';
		}

		if($Site->tumblr()) {
			echo '<a href="'.$Site->tumblr().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_tumblr.png" title="Tumblr"></a>';
		}
It's the first part I'm sure I need help with :)
Thanks!
User avatar
Edi
Site Admin
Posts: 1263
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Tue Jun 07, 2016 11:34 pm

I would do it with a plugin. Otherwise you have to the make the changes with every update of the core and the theme.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
murko
Sr. Bludit
Posts: 46
Joined: Sat May 28, 2016 11:16 am

Wed Jun 08, 2016 12:31 am

Edi wrote:I would do it with a plugin. Otherwise you have to the make the changes with every update of the core and the theme.
You are correct as always Edi :)
Problem is really that I can't code
CSS, and HTML well yes to some degree but making words bold with Word is programming to me.
So I wouldn't know where to start
User avatar
Edi
Site Admin
Posts: 1263
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Jun 08, 2016 1:21 pm

I will code one. ;-)
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
murko
Sr. Bludit
Posts: 46
Joined: Sat May 28, 2016 11:16 am

Wed Jun 08, 2016 1:49 pm

Edi wrote:I will code one. ;-)
That made more sense.
Thanks in advance! Hoping it will turn out as I'd like it to :)
User avatar
LRAM
Master Bludit
Posts: 50
Joined: Sat Sep 24, 2016 4:02 pm
Location: France
Contact:

Thu Dec 28, 2017 7:04 pm

This will be a great tool
As a musician, I need to add Soundloud, Youtube, Deezer, Itunes, Amazon ...
so, that's definitively a must have for me
User avatar
LRAM
Master Bludit
Posts: 50
Joined: Sat Sep 24, 2016 4:02 pm
Location: France
Contact:

Thu Apr 05, 2018 8:18 am

Hi
any ways to add the link of our choice ?
hor ow to customize the icon that serves as a link
thanks a lot
User avatar
Edi
Site Admin
Posts: 1263
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Thu Apr 05, 2018 10:56 am

Oops, I promissed it, but never have done it.

I finally have to do it...
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
devprodest
Ssr. Bludit
Posts: 18
Joined: Tue Feb 27, 2018 10:52 am

Fri Apr 06, 2018 6:48 am

Edi wrote:
Tue Jun 07, 2016 11:34 pm
I would do it with a plugin. Otherwise you have to the make the changes with every update of the core and the theme.
I have already passed this way. I changed the php code after each update. with the plugin will be better.
User avatar
diego
Site Admin
Posts: 679
Joined: Sat May 16, 2015 2:53 pm
Contact:

Fri Apr 06, 2018 9:45 am

I can add the social networks in the Core, are use full.
Please make a request with the social media to add in Github Issues, is more easy to me to track and for you too.

Thanks
Post Reply