Add social links (fields) in admin

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

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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

I would do it with a plugin. Otherwise you have to the make the changes with every update of the core and the theme.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
murko
Sr. Bludit
Posts: 40
Joined: Sat May 28, 2016 11:16 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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

I will code one. ;-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
murko
Sr. Bludit
Posts: 40
Joined: Sat May 28, 2016 11:16 am

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: 199
Joined: Sat Sep 24, 2016 4:02 pm
Location: France
Has thanked: 22 times
Been thanked: 2 times
Contact:

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
https://sucrepop.com
Candies for the ears
User avatar
LRAM
Master Bludit
Posts: 199
Joined: Sat Sep 24, 2016 4:02 pm
Location: France
Has thanked: 22 times
Been thanked: 2 times
Contact:

Hi
any ways to add the link of our choice ?
hor ow to customize the icon that serves as a link
thanks a lot
https://sucrepop.com
Candies for the ears
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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

I finally have to do it...
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
devprodest
Ssr. Bludit
Posts: 26
Joined: Tue Feb 27, 2018 10:52 am
Location: Moskow, Russia

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: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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