Keyword

Module override in K2

  • bidibule
  • bidibule's Avatar Topic Author
  • Offline
  • New Member
More
14 years 9 months ago #79465 by bidibule
Module override in K2 was created by bidibule
Hi all!We are trying to override the module template and we put the default.php in/my_template/html/mod_k2_content/default.phpIt doesn't workWe tried to put in tmpl with no luck .Any idea ?Thanks !

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

More
14 years 9 months ago #79466 by Chris Yates
Replied by Chris Yates on topic Module override in K2
Hello,

There's a bug in the first line of code in the default.php file within the mod_k2_content/tmp/default folder.

You sould replace the first line of code with the code in the attached text file.

This will enable you to add a module suffix and override styling of the module.

CHRIS
Attachments:

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

More
14 years 8 months ago #79467 by Tom Greuter
Replied by Tom Greuter on topic Module override in K2
Thanks for your answer, Chris. However, that accounts only for CSS overrides. Like bidibule I don't get the module template override working. For example, I'd like to override the file mod_k2_login/tmpl/userblock.php.

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

More
14 years 7 months ago #79468 by Oceanwatcher
Replied by Oceanwatcher on topic Module override in K2
Sorry that I am a little late in this thread, but thought I would add my 2 cents anyway -

I have v. 2.3 beta loaded for a site I am working on and I did this to be able to get an override for the k2_content module:

Go to the following folder:

/templates/your-active-template/html/

Create a folder called mod_k2_content. Inside this folder, you create a new folder with the name you want to give to your new template. In this folder you place the default.php file from the /modules/mod_k2_content/tmp/default folder.

You should then have the following structure:

/templates/your-active-template/html/mod_k2_content/new-template/default.php

Then go to the backend of Joomla, go to Extensions-Module manager and open the module. Choose your new template in the "Select sub-template" drop-down.

Now you just need to edit your template to your liking :-)

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

More
10 years 9 months ago #79469 by George Tarantilis
Replied by George Tarantilis on topic Re: Module override in K2
Thank you! I had only used regular k2 template overriding until now.

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

More
5 years 10 months ago - 5 years 10 months ago #170716 by sjsmit
Replied by sjsmit on topic Module override in K2
Oceanwatcher wrote:

You should then have the following structure:

/templates/your-active-template/html/mod_k2_content/new-template/default.php

Then go to the backend of Joomla, go to Extensions-Module manager and open the module. Choose your new template in the "Select sub-template" drop-down.


Although it's more than 8 years ago you wrote this, it was still very useful for me. Thank you!
Last edit: 5 years 10 months ago by sjsmit.

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

More
5 years 10 months ago #170760 by JoomlaWorks
Replied by JoomlaWorks on topic Module override in K2
Noted to update getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates with info on module overriding as well. Thanks for pointing this out.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum