Keyword

Module override in K2

  • bidibule
  • bidibule's Avatar Topic Author
  • Offline
  • New Member
More
9 years 4 months ago #79465 by bidibule
bidibule created the topic: Module override in K2
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
9 years 4 months ago #79466 by Chris Yates
Chris Yates replied the 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
9 years 4 months ago #79467 by Tom Greuter
Tom Greuter replied the 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
9 years 2 months ago #79468 by Oceanwatcher
Oceanwatcher replied the 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
5 years 4 months ago #79469 by George Tarantilis
George Tarantilis replied the 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
6 months 2 weeks ago - 6 months 2 weeks ago #170716 by sjsmit
sjsmit replied the 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: 6 months 2 weeks ago by sjsmit.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
6 months 1 week ago #170760 by Fotis
Fotis replied the 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.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white

Powered by Kunena Forum