solved Profiles

gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Hey all

Given Jamroom's focus is on profiles I have an idea to completely customise these for my project.

A few questions.

Is it possible to include a different side bar on each profile tab?

If I wanted to provide different layouts per quota, what would be the best way to achieve this?

Thanks

Gary
updated by @garymoncrieff: 11/30/14 02:22:17AM
michael
@michael
10 years ago
7,715 posts
#1: sure. its in the skins
/skin/(your skin name)/profile_header.tpl

#2: 'best' is difficult because I haven't tried multiple things and found one I prefer. There are many places you could start though. Perhaps take a look at the jrAdminSkin module. The way it works is to catch via a hook what the current section and current skin is, then set it to a different area depending on what the admin chooses.

So the admin area could be jrElastic, the front end jrSage and the profiles jrProjam. You could do the same thing depending on quota. That would be one way.

Another way would be at the template level
{if $_profile.quota_id == '3'}
//something
{elseif $_profile.quota_id == '4'}
//something else
{else}
//another thing
{/if}

There are probably other ways too.
brian
@brian
10 years ago
10,148 posts
Yeah if it was me I'd separate the individual profile side bars into individual template files - i.e.:

{if is_file("`$jamroom_dir`/skins/YourSkin/sidebar_`$profile_quota_id`.tpl"}
    {jrCore_include template="sidebar_`$profile_quota_id`.tpl"}
{else}
    {jrCore_include template="sidebar_default.tpl"}
{/if}

This would never need to be changed, and to add a new custom sidebar for a profile_quota_id you just add the new template - i.e.

skins/YourSkin/sidebar_5.tpl

Make sure you have a default:

skins/YourSkin/sidebar_default.tpl

And that will be the sidebar for any quota that does not have a custom template.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 10/06/14 09:06:31AM
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
That's what I was thinking as I had done a mod for PhpFox 1.6 years ago (when it used smarty template engine) that did the same thing.

Thanks for the input guys.
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
1st stumbling block

I have added an image field to allow a profile cover image to be used, but I need to determine if there is an image or not in code so I can dynamically adjust the profile template.

The field is called

profile_cover_image

it is called in template using the

{jrCore_module_function function="jrImage_display" module="jrProfile" type="profile_cover_image" item_id=$_profile_id}

Is there a way to determine if there is an image or not?

Thanks
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Got it using isset($profile_cover_image_name)
michael
@michael
10 years ago
7,715 posts
or profile_cover_image_size.

Throw a {debug} in there to see what variables you have available if you get stuck.

"{debug}"
http://www.jamroom.net/the-jamroom-network/documentation/development/1477/debug
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
I have now made it so that the 'community' profile as no name box or profile menu giving the effect that the forum is part of the main site rather than being on a profile.

When I clone aparna and add a new module, the module goes to the front of the profile menu, is there any other way short of manually recreating the profile menu to reorder these?

Thanks
michael
@michael
10 years ago
7,715 posts
There is one method described here:
http://www.jamroom.net/the-jamroom-network/forum/suggestions/6429/is-there-a-way-for-users-to-re-order-their-menu-tabs-on-profile-page

Setting the order="..." in the jrProfile_menu of the skin.

Will that work for your situation.

Full docs:

"{jrProfile_menu}"
http://www.jamroom.net/the-jamroom-network/documentation/development/1997/jrprofile-menu
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Thanks Michael, will check on this when I get time.
Developer Networks
Developer Networks
@developer-networks
10 years ago
566 posts
Also I have a module available that might help you achieve what you need. https://www.jamroom.net/b360/networkmarket/122/profile-badges
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Yes b360 I have looked at your module and will pick it up at some stage, I am not at that stage yet and trying to figure out the best route to go with this.

Since profiles have 3 files, header, index, and footer I am wondering would it be easier to combine all 3 into one and go from there?
michael
@michael
10 years ago
7,715 posts
Quote: ...combine all 3 into one...
not a good idea. Since there are more than just
* profile_header.tpl
* profile_index.tpl
* profile_footer.tpl

the header and footer are also used by modules sometimes. One example is the jrTags module which uses the header, then outputs the tags, then uses the footer.

If there was no header/footer to get it would get stuck.

What advantage were you hoping to achieve by combining them?
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Yeah Michael I discovered that yesterday while experimenting. The main reason was to avoid a lot of {if} statements in header file, but I see that will be needed.

Thanks
michael
@michael
10 years ago
7,715 posts
The index file includes the header, so maybe you could include a different file.

If its getting pretty complex, consider using a module. There are a bunch of hook features to use at various different points.

If you could explain a bit about what your trying to achieve I could maybe suggest some options.
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Hi Michael

At the moment I am still mulling over designs in my head for different types of professionals.

For instance band/musicians I would like the index page to look similar to purevolume profile http://www.purevolume.com/thepresidentsoftheunitedstatesofamerica

I haven't yet settled on designs for other profiles yet.

However the index page will be key here I believe, and then include different layouts in that file depending on quota.
michael
@michael
10 years ago
7,715 posts
If you want a ton of different layouts for profiles, Instead of trying to do them all in one skin, revisit the idea of using a module to change the skin depending on the quota.

Check out the jrAdminSkin module that allows different skins to be used in different sections.

eg:
* admin section uses jrFlashback
* profile section uses jrSage
* front section uses jrNova

You could use the same concept for different quotas (although that functionality has not been programmed yet, you'd need to build it.)

eg:
* quota 1 profile uses jrNova
* quota 2 profile uses jrFlashback
* quota 3 profile uses jrSage

But in your case, you'd probably build the skins you wanted.
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Beginning to think you might be right Michael, because to ultimately achieve what's in my head I would need different profile header, footer and index pages depending on the quota. It will get very messy and confusing quickly if I try to do this using {if} statements.

I may need to put this on the back burner for now as it will beyond my skills level I believe.
gary.moncrieff
gary.moncrieff
@garymoncrieff
10 years ago
865 posts
Think I have figured out a solution that should work, now to design the different layouts.
michael
@michael
10 years ago
7,715 posts
nice one. :)

Tags