Keyword

Is it possible to override generic.php?

  • xaoc
  • xaoc's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 9 months ago - 11 years 9 months ago #109480 by xaoc
Hello!

I try to override generic.php file, which is located inside of my template, in templates/my_template/html/com_k2/generic.php.

Output of both rating with
Log in  or Create an account to join the conversation.

More
11 years 9 months ago #109481 by Jiliko.net
Replied by Jiliko.net on topic Re: Is it possible to override generic.php?
Hi,

Do you mean your override file is not used or what you've added is not displayed ?

You generic.php file override is correctly placed, so the problem is not here.

Olivier

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

  • xaoc
  • xaoc's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 9 months ago - 11 years 9 months ago #109482 by xaoc
Second - i include rating and extra fields into generic.php as described and get in the frontend nothing of rating and extra field values. Extrafields show is setted to on in the search settings of K2.

So i don't really know, is it possible at all without hack, at the user template level (through override) to show extrafields values in generic.php

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

More
11 years 9 months ago #109483 by Jiliko.net
Replied by Jiliko.net on topic Re: Is it possible to override generic.php?
Item rating and extrafields are not loaded for the generic view.

It you want to do this, you'll have to add the code that retrieves these information in your generic.php override. It's not MVC compliant but i think it's the only situation as K2 plugins are not implemented on generic view neither.

You can find the code for this on the models/item.php file in the prepareItem() function.

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

  • xaoc
  • xaoc's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 9 months ago - 11 years 9 months ago #109484 by xaoc
Thanks! I was successful by including of tags into generic.php. But by including of rating and extra fields i fail. Would you please help me with?

Here is the code includign tags into generic.php for those who is looking for:) Add this to your generic.php at the place, where you want see your tags. They will appear like unordered list
Log in  or Create an account to join the conversation.