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.

joomla Custom HTML Module

9 years 5 months ago
  • XD's Avatar
    Topic Author
  • XD
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

Hello.
I have multiple Profiles activated on jomsocial latest version.
User - Team - Partner - Gold

I want to be able to show a different joomla module to each profile. Example:

On USER, i want to show a standard html module to invite users to pay
On PARTNET, i want to a standard html show a module to congratulate being a partner.. etc etc..

I Think you get the idea..

Please advise.
Thank you

9 years 5 months ago
Licenses:

Hi.

JomSocial multiprofiles are not recognized by Joomla! in any way so you can't assign a module to be displayed only for certain Profile.
This can be done ONLY inside JomSocial. We use built-in module positions you could create some new positions in internal sidebar and add a condition that this particular module position is loaded ONLY if user that uses certain multiprofile is logged in.

But you need to specify on what pages you want to display those modules. Then I could write a code snippet for you.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: XD
9 years 5 months ago
  • XD's Avatar
    Topic Author
  • XD
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

Thank you for the fast reply.
Lets suppose that the module i want to be shown its independent of jomsocial content...
I don't want any hack to the jomsocial. I just pretend that, if some user is logged in jomsocial with a specific multiprofile named PARTNER for example, then joomla it self shows a html module or banner inside the page and outside the jomsocial standard modules.
Thank you

9 years 5 months ago
Licenses:

Hi.

Hmmm, I think it still could be done... it will require a SQL query in the template as we'll have logged in user ID already, so wee need to find what Profile ID he/she is related too. So we di a check and load certain ID to variable, then we create condition with module position... yes, this could be done that way.

Just confirm that you are interested in that kind of custom code.

My customizations are SAFE HACKS done with template overrides and NO CORE file hacks ;)


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: XD
9 years 5 months ago
  • XD's Avatar
    Topic Author
  • XD
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

Thank you.
I'm interested in the customisation.
Please informe me the costs and timings please.

9 years 5 months ago
Licenses:

Hi.

No, this will not cost you a thing ;)

I prepared code snippet. This hack NEED TO BE APPLIED INTO CURRENT (DEFAULT) TEMPLATE.
Template may differs with the way modules are rendered. My hack should work with most templates as I used standard method of module rendering.

You'll need to edit index.php of your template (if you use T3 framework based template or any other frameworked template then you'll need to find yourself right place where sidebars are loaded)

In my example I'll use Protostar template as default Joomla! 3.x.x template.

Edit file ROOT/templates/protostar/index.php. In line 174 starts RIGHT sidebar. Here we'll add our code so any module assigned to multiprofile ID will be loaded before any other modules - so on top of column).

After line 174 add this code:

<?php
$user = JFactory::getUser();
$user_profile_id = $user->getProfileType();
?>
<?php if($user_profile_id == 2) { ?>
<jdoc:include type="modules" name="position-name" style="style-name" />
<?php } ?>

First part of code check current user id and query database for multiprofile ID related to it.
Second part is a condition that says if current user related multiprofile id is equal to 2 then load below module position.

So you must know multiprofile ID (you'll find it in Backend -> Components -> JomSocial -> Profiles -> Multi Profiles and first column in table marked as #).

position-name - replace with your own using non-latin letters and no spaces and special signs except - and _. Module position name MUST BE UNIQUE!

style-name - if you know what module style name are defined in your template, you can use style name here.

If you have more multiprofiles and want to display different modules for each then just copy this part:
<?php if($user_profile_id == 2) { ?>
<jdoc:include type="modules" name="position-name" style="style-name" />
<?php } ?>

Change 2 to other multiprofile ID, change module position name. Repeat it for every multiprofile you have.

When assigning module to positions you created here - you'll have to type module position name manually as it will be not listed for the first time.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: XD
9 years 5 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

There is no need to use additional query to get the id of the profiletype, once you have the proper JomSocial user object.
You can extract the profile type ID from the object directly

    $cuser = CFactory::getUser();
    $data = $cuser->getProfileType();
    echo $data;


- Don't say feature not working. Instead, explain what you tried and what was the outcome.
- When you think you found the bug, try to replicate it on a fresh Joomla.
- When looking for support always provide temporary Super Administrative access to your site. We will ask for it anyway.
- Help yourself and read documentation which can give you answers to almost all questions you may have
The following user(s) said Thank You: XD
9 years 5 months ago
  • XD's Avatar
    Topic Author
  • XD
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

Thank you Michal and Sinisa for the excellent support.
I'm glad i bought this software.
I'm going to try to implement this features on my template and i will give some feedback.
Once again 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