Profile Layouts, Joomla Fields, and more!

The latest Community Builder release brings some amazing new features from customizable profile layouts to Joomla fields to new substitutions! Check out the details below.

First up is CB profiles now support a Home and Other layout. The Home layout is visible when a user visits their own profile. The Other layout is visible when a user views another user. This allows splitting the experience to be more useful to a user when they're viewing themselves.

With that let me introduce you to the new layouts feature. This can be found within your CB template parameters by editing your template in CB > Plugin Management. You'll then find the below.

From here you can configure your Home and Other layouts. In addition to that we provide a nice preview of where exactly tabs will be placed. Some great new features of this is our navigation collection feature. This lets us collect tab navigations and place them anywhere! We've also implemented an option to force tab content to scroll into view when using tab navigation.

Now lets take a look at the new Canvas (Home) layout. This adjusts the canvas layout to focus more on the content so a user can interact with their data more comfortable.

This is utilizing the collect navigation feature to move the navigation to the left. A similar layout has also been added when viewing another user encase you want left aligned navigation. Take a look below!

It doesn't stop there. We've included a new layout more tailored to business needs that focuses on the data, is flat, clean, and simple. We've named it Intranet.

The features just keep rolling in because we're not done yet. In addition to this you can now create your very own layout using HTML, substitutions, and Joomla content plugins.

We've also seen a lot of requests to support rendering Joomla user component fields within CB. This is now possible with the included Joomla field type. Note this field type is only available on Joomla 4. Joomla 3 simply lacks the API to properly implement this.

All core Joomla field types have been tested. You can optionally override several parts of the Joomla field with CB field values as well.

Note that Joomla field permissions and access checks are still applied. So for example the Media fieldtype requires media management permissions. The User fieldtype does not have a frontend access so it will not render on frontend. Please note we cannot guarantee compatibility with every 3rd party fieldtype nor can we guarantee these fields will work properly with other integration behavior (e.g. Query Validation).

We're still not done! A new substitution has been added to help with inline translations. You can now translate and render a language string within the middle of other content anywhere substitutions are supported. This is done using the following new substitution.

[cb:translate key="LANGUAGE_KEY_HERE" default="FALLBACK_STRING_HERE" /]

The key should match one for your CB language plugin keys or one of your language override keys. The default parameter is used to output something in the event the language key is missing and is optional. Additionally once the translation is complete substitutions will be applied to the resulting string!

Hope everyone enjoys the new features and can't wait to see what another year of CB will bring!

This functionality has now been extended to profile edit! You can customize your profile edit layout from within your CB template instead of within CB configuration. In addition to this a new Menu layout has been added to display the profile edit tabs as a menu bar (top and left aligned as desired!). It doesn't stop there though. You can now fully customize profile edit using your own HTML in combination with substitutions.

The layout functionality is now officially feature complete. You can now customize your Registration layout from within your CB template. The Menu layout has also been enabled for registration in addition to Custom layouts to provide your own substitution supported HTML layout for registration.

Remaining layout based parameters have also moved to the template configuration. For profile view the main left/middle/right size parameters are now in the template and the registration layout specific parameters (login, canvas, header, and footer) have also moved to the template.



krileon's Avatar
krileon replied the topic: #335267 5 months 3 weeks ago
I don't know what more to suggest. That functionality is built into CB substitutions. It's not specific to layouts. You can see it working fine in my test below.

 

This is with the following.
[cb:if menu_id="112"]Menu ID is 112[/cb:if]

You can see the Itemid is 112 in the URL.
huguesmarcil's Avatar
huguesmarcil replied the topic: #335257 5 months 3 weeks ago
Hello,
It is not working. In fact I made no change as I wrote itemid 240 since the first time.
Thank you!
krileon's Avatar
krileon replied the topic: #335078 6 months 2 weeks ago
Ok, and that's not working for you? or is it now working since changing it?
huguesmarcil's Avatar
huguesmarcil replied the topic: #335075 6 months 2 weeks ago
Sorry I have changed it to [cb:if menu_id="240"]The current menu item is Itemid 240[/cb:if] from what is noted in the body html tag: itemid-240.
krileon's Avatar
krileon replied the topic: #335072 6 months 2 weeks ago
You need to change the values of the menu_id to match the Itemid of the URLs you're trying to match. menu_id is just whatever the current URLs Itemid is. You can find a menus id within Joomla menu manager or by checking the Itemid in the current URL you're wanting to match. What I provided is just an example.
huguesmarcil's Avatar
huguesmarcil replied the topic: #335070 6 months 2 weeks ago
Hello Krileon,

The code I entered exactly this code in the custom layout input :)
[cb:if menu_id="12"]The current menu item is Itemid 12[/cb:if]
[cb:if menu_id="1"]The current menu item is Itemid 1[/cb:if]
krileon's Avatar
krileon replied the topic: #334898 7 months 6 days ago
You'll need to provide exactly what you supplied in the custom layout for me to suggest anything. Simply could just be an error in your substitution syntax. If a tab position doesn't have anything to output it's not going to display anything. For registrations [header] is the registration header as configured in CB > Configuration > Registration. Same as with [footer]. As for menu_id that's just built into CBs substitutions and isn't specific to layouts. It's entirely dependent on what the Itemid is in the current page being displayed.
huguesmarcil's Avatar
huguesmarcil replied the topic: #334897 7 months 6 days ago

The Custom layout supports substitutions and Joomla content plugins so I suppose you could display 2 different modules depending on what URL you're on by IF substitution conditioning against the itemid. Example as follows.
[cb:if menu_id="12"]The current menu item is Itemid 12[/cb:if]
[cb:if menu_id="1"]The current menu item is Itemid 1[/cb:if]

The menu_id would be the Joomla menu id. This lets you display content based off the viewed Joomla menu. As for displaying the modules use normal Joomla content plugin shortcodes for that.

Hello,

I tried this code but it does not display any additional text.
I changed the id with the value corresponding to my itemid.
I also tried [header] and [footer] tags.

I think the profile layout is linked to my registration module because when you change parameters like "show login", "legend", etc. in my layout profile, the layout changes.

Do you know the reason?
Thank you
krileon's Avatar
krileon replied the topic: #334823 7 months 1 week ago

1- how to access that feature (forge.joomlapolis.com/issues/9233)? need to update cb or what?

You'll have to wait for a new build release. Should be available sometime today.

2- Is it possible implement this method for list in cb? if it is possible , my problem from 7 years ago can be resolve

No, there are no plans for userlist layouts at this time. In CB 3.x when we've rewritten our templating system into Twig files we'll support per-userlist twig template then you'd be able to just change all the HTML yourself.
saman2's Avatar
saman2 replied the topic: #334820 7 months 1 week ago
hi.
1- how to access that feature (forge.joomlapolis.com/issues/9233)? need to update cb or what?
2- Is it possible implement this method for list in cb? if it is possible , my problem from 7 years ago can be resolve (www.joomlapolis.com/forum/146-general/235728-can-i-override-cb-userlist-menu-item).it will be very good if possible for each list separately.
krileon's Avatar
krileon replied the topic: #334810 7 months 1 week ago
Have added a feature ticket to review adding placeholder substitutions if a tab position has no content.

forge.joomlapolis.com/issues/9233
saman2's Avatar
saman2 replied the topic: #334806 7 months 2 weeks ago
There is a problem. if you use for example [content_line_1_column_1] in the profile custom layout then it is simply render the corresponding content .But if the user does not have access to view the field or tab in that position for any reason, the expression [content_line_1_column_1] itself will be rendered.
huguesmarcil's Avatar
huguesmarcil replied the topic: #334762 7 months 2 weeks ago
Thank you for the quick reply, I'll check that out I soon as I can!
krileon's Avatar
krileon replied the topic: #334721 7 months 2 weeks ago

One question: I see that there are 4 layouts available. Is it possible to add a new one?

Yes, use the Custom layout and you can provide your own HTML for it to display however you like.

For example, I'd like to have two layouts for two different registration modules on two different pages. Can I do this using the profile layouts?

The Custom layout supports substitutions and Joomla content plugins so I suppose you could display 2 different modules depending on what URL you're on by IF substitution conditioning against the itemid. Example as follows.

[cb:if menu_id="12"]The current menu item is Itemid 12[/cb:if]
[cb:if menu_id="1"]The current menu item is Itemid 1[/cb:if]

The menu_id would be the Joomla menu id. This lets you display content based off the viewed Joomla menu. As for displaying the modules use normal Joomla content plugin shortcodes for that.
huguesmarcil's Avatar
huguesmarcil replied the topic: #334718 7 months 2 weeks ago
Hello Krileon!

I hope I don't resurrect this topic :)
I'm very excited about the profiles, it seems like a great way for us to improve our UX.

One question: I see that there are 4 layouts available. Is it possible to add a new one?
For example, I'd like to have two layouts for two different registration modules on two different pages. Can I do this using the profile layouts?
Thank you!

Hugues
krileon's Avatar
krileon replied the topic: #333612 11 months 1 week ago
cb_right still exists. This feature provides a tab position map so you'll know exactly where things are. Can you clarify what's so confusing about this new feature? You're basically just selecting a profile layout from a dropdown. You do not need to move your tabs. There's also the Custom layout that lets you create your own using HTML and substitutions.

Below is the Canvas (Other) layout, which is the layout used for profiles in previous releases of CB. I've highlighted where cb_right is.

 
trlbldr's Avatar
trlbldr replied the topic: #333609 11 months 1 week ago
Okay, this has thoroughly confused me. Positions (cb_right) aren't found. I need to study this to find out how I'm going to re-arrange the Profile view to approximate what it used to be. Current "home" confuses many of our elderly retired Navy veterans.
krileon's Avatar
krileon replied the topic: #332426 1 year 2 months ago
The layout functionality is now officially feature complete. You can now customize your Registration layout from within your CB template. The Menu layout has also been enabled for registration in addition to Custom layouts to provide your own substitution supported HTML layout for registration.

 

Remaining layout based parameters have also moved to the template configuration. For profile view the main left/middle/right size parameters are now in the template and the registration layout specific parameters (login, canvas, header, and footer) have also moved to the template.
fg88's Avatar
fg88 replied the topic: #332416 1 year 2 months ago
**
krileon's Avatar
krileon replied the topic: #332307 1 year 2 months ago
The layout functionality has now been extended to Profile Edit! You'll be able to customize the profile edit layout in your template (previously in CB configuration).

 

In addition to this a new Menu layout has been added to render the tabs as a menu bar. You can also of course supply your own HTML substitution supported layout for profile edit now too!
fg88's Avatar
fg88 replied the topic: #332257 1 year 2 months ago
That's awesome !! Thanks for this new functionnality that was missing ! I look forward to see in action

Facebook Twitter LinkedIn