Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Costum button in profile's "about me" section

9 years 4 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi all,

how can I put a custom button on the 'about me' section of a profile. Since I've implemented a platform with two different profiles (say A and B) I would like to put this costum button only on profile of type A.

How can this be made? Can you give me a little hack I can use?

Thank you very much!

9 years 4 months ago
Licenses:

Hi Alfonso,

all customization must be done by using override method:
documentation.jomsocial.com/wiki/Customizing_Template

so at upgrade process you will not lose any customization. here the steps for your purpose:
1. copy userinfo.php from /components/com_community/templates/default/modules/profile/ to /templates/[your front end template]/html/com_community/modules/profile/
2. at line 78 you can find "about me" link

<li><a href="#" class="about js-collapse-about-btn"><?php echo JText::_('COM_COMMUNITY_ABOUT_ME')?></a></li>

Regards,
Albert

9 years 4 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Thanks Albertus,

can you explain a little bit more how can I paste a button in it? You know on the blank space aside of all the profile information. Most of all, how can I paste it only on one profile type instead of both of them?

I'm not so skilled, be patient with me :)

Thank you man!

9 years 4 months ago
Licenses:

Hi Alfonso,

could you please provide me the screenshot to pointing me, where is the exactly position do you want. and also, give the code for that new button.

please edit your first post at this topic. and put credential information: administrator, FTP, site URL at site info form.

I will do it for you. and let you know what I did.

Regards,
Albert

9 years 4 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi Albertus thanks again,

I've attached an image so that you can see the area where I want to put the button, unfortunately I'm working locally on the site so I don't know if you'll be able to work directly on it. By the way could you just write an example code I can use for this purpose so I can try it out? The image you will see shows you the 'about me' section collapsed with a blank area aside of all the profile informations, that's where I want to put the button, more or less centered in that area.

Thank you for your patience man, I really appreciate it.

Alfonso

Attachments:
9 years 4 months ago
Licenses:

Hi Alfonso,

you can do it by using overrides:
documentation.jomsocial.com/wiki/Customizing_Template

1. copy userinfo.php from /components/com_community/templates/default/modules/profile/ to /templates/[your active template]/html/com_community/modules/profile/
2. around line 120, find this code

<div class="collapse js-collapse-about">
	<div class="row-fluid">
		<div class="span12">
			<div><?php echo $about; ?></div>
			<dl class="dl-horizontal">
				<dt><?php echo JText::_('COM_COMMUNITY_MEMBER_SINCE'); ?></dt>
				<dd><?php echo JHTML::_('date', $registerDate , JText::_('DATE_FORMAT_LC2')); ?></dd>
				<dt><?php echo JText::_('COM_COMMUNITY_LAST_LOGIN'); ?></dt>
				<dd><?php echo $lastLogin; ?></dd>
				<?php if( $multiprofile->name && $config->get('profile_multiprofile') ){ ?>
					<dt><?php echo JText::_('COM_COMMUNITY_PROFILE_TYPE'); ?></dt>
					<dd><?php echo $multiprofile->name;?></dd>
				<?php } ?>
			</dl>
		</div>
	</div>
</div>

changing it to
<div class="collapse js-collapse-about">
	<div class="row-fluid">
		<div class="span6">
			<div><?php echo $about; ?></div>
			<dl class="dl-horizontal">
				<dt><?php echo JText::_('COM_COMMUNITY_MEMBER_SINCE'); ?></dt>
				<dd><?php echo JHTML::_('date', $registerDate , JText::_('DATE_FORMAT_LC2')); ?></dd>
				<dt><?php echo JText::_('COM_COMMUNITY_LAST_LOGIN'); ?></dt>
				<dd><?php echo $lastLogin; ?></dd>
				<?php if( $multiprofile->name && $config->get('profile_multiprofile') ){ ?>
					<dt><?php echo JText::_('COM_COMMUNITY_PROFILE_TYPE'); ?></dt>
					<dd><?php echo $multiprofile->name;?></dd>
				<?php } ?>
			</dl>
		</div>
		<div class="span6">
			[put your custom button code at here]
		</div>
	</div>
</div>

and replace [put your custom button code at here] with the custom code button.

Regards,
Albert

9 years 4 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Thank you very much Albertus!

This hack works just fine, i've got one last issue to fix: I need the button to be shown only on a profile type since in my community I have two different profiles. Right now the button appears on both profile types. Can you give me a little code for this too?

Thanks again, I wish you a great 2015!

Alfonso

9 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Alfonso,

You can use this code :

<?php if( $multiprofile->name=="YOUR_PROFILE_TYPE" && $config->get('profile_multiprofile') ){ ?>
					<dt><?php echo JText::_('COM_COMMUNITY_PROFILE_TYPE'); ?></dt>
					<dd><?php echo $multiprofile->name;?></dd>
				<?php } ?>

9 years 4 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi Dimas,

I've tryed your hack but nothing happens, the button is still showed on both profile types; here it is:

<?php if( $multiprofile->name=="BAND" && $config->get('profile_multiprofile') ){ ?>
<dt><?php echo JText::_('COM_COMMUNITY_PROFILE_TYPE'); ?></dt>
<dd><?php echo $multiprofile->name;?></dd>
<?php } ?>
</dl>
</div>
<div class="span6" style="position:relative;left:150px;top:180px">
<button class="btn btn-large btn-primary" type="button">Hire Band!</button>
</div>
</div>
</div>
</div>
</div>
</div>

What's wrong with that?

Thank you very much for your help, I really appreciate it.

Alfonso

9 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

HI Alfonso,

Please provide me backend access and FTP access on private info, I will change it directly.

thank you

9 years 3 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi Dimas, thanks again for your kind reply

unfortunately I'm working locally on the site so I don't know if you'll be able to work directly on it; btw if you write me the whole code I can try and tell you if everything is ok.

Thanks for your support.

Alfonso

9 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Alfonso,

Please you debug to print $multiprofile->name, make sure the print out is same with your if conditional.

Hard for us to inspect your issue further, if I cant see and test your issue directly.

thank you

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW