Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Override a module layout

  • emanuelr
  • emanuelr
  • OFFLINE
  • Posts: 38
  • Thanks: 2
  • Karma: 3
11 years 4 months ago #229427 by emanuelr
Override a module layout was created by emanuelr
How can I override a CB module layout (in this case the mod_cbactivity)?
Using the standard Joomla modules override in the template/html folder doesn't work.

Looking at the module file, I see that the code calls for a template and uses 'default'. But I don't see any default template for that module (I do see for the plugin which renders the tab and page)...

Thanks,
Emanuel

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229480 by krileon
Replied by krileon on topic Override a module layout
You can't, it doesn't use Joomla MVC. You need to edit the module directly to fit your needs.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • emanuelr
  • emanuelr
  • OFFLINE
  • Posts: 38
  • Thanks: 2
  • Karma: 3
11 years 4 months ago #229530 by emanuelr
Replied by emanuelr on topic Override a module layout
Yes, I know that your modules don't follow the standard MVC :S

But it seams that the current layout is looking for a template and set 'default' as default, somewhere at the top of the module markup.

Is it for future versions?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229567 by krileon
Replied by krileon on topic Override a module layout

Yes, I know that your modules don't follow the standard MVC

We do this because if we followed Joomla MVC (not Standard MVC) then we'd need to make 3-4 different versions of our modules to support the various Joomla releases that we support. Instead we opt to write the HTML once and make multiple simple XML files so it installs fine. We'll be redoing a lot of this with CB 2.0; so I can't say how it's going to work in the future at this time.

But it seams that the current layout is looking for a template and set 'default' as default, somewhere at the top of the module markup.

The CB Activity module loads in CB Activity template files. Not sure what the default is you're referring to.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • emanuelr
  • emanuelr
  • OFFLINE
  • Posts: 38
  • Thanks: 2
  • Karma: 3
11 years 4 months ago #229587 by emanuelr
Replied by emanuelr on topic Override a module layout
The module rendering starts with:
Code:
$return = '<div class="cbActivity' . htmlspecialchars( $plugin->params->get( 'general_class', null ) ) . ' cb_template_' . selectTemplate( 'dir' ) . '">'

The result is:
Code:
<div class="cbActivity cb_template_default"><div class="cbActivityInner"><div class="activityModule"><div class="activityContent row-fluid">...

So, I thought cb_template_default is a clue ;)

Besides, I truly understand why you chose your own way to integrate everything. It is just a long learning curve for us, with not so easy way to find answers...

The CB Activity module loads in CB Activity template files

I didn't understand that...

I hope that with the future version there will be a way to modify the modules (for example, the cb_login) without touching the core files.

Thanks!
Emanuel.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229588 by krileon
Replied by krileon on topic Override a module layout

So, I thought cb_template_default is a clue

That's the CB template CSS class. It builds and adds a class based off the CB template used. Inspect a CB profile and you'll see the same class surrounding the entire profile. This allows CBs templates to target CB only with its CSS.

Besides, I truly understand why you chose your own way to integrate everything. It is just a long learning curve for us, with not so easy way to find answers...

Basically ATM if you want to alter the HTML you'll have to edit the module. I suppose I can, for CB Activity, turn the module HTML into a CB Activity template file so you'd have the below for example.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/module.php

This would allow you to at least make a template override file within CB Activity like the following.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/mytemplate/module.php

Then you wouldn't lose any HTML changes when upgrading CB Activity, but this won't help you with other CB modules of course.

I didn't understand that...

The CB Activity module loads in CB Activity template CSS file found below. So you could add CB Activity module specific CSS to your CB Activity template file or example.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/template.css

I hope that with the future version there will be a way to modify the modules (for example, the cb_login) without touching the core files.

There will be with CB 2.0.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: emanuelr

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum