×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Template override not working

Template override not working 10 years 11 months ago #20871

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Hello,

first off, thank you for this great extension!

I installed it on J!3.1.1 and it works as expected.

Now I want to make my own template. I closely followed the steps explained in the documentation .

When I select my template in backend -> components -> ccomment -> Settings -> your component settings I get an error:
"500 - Layout „readmore“ not found".

When I copy the default template to /components/com_comment/templates/default_backup and select this one in the ccomment backend, everything works fine.


When I copy the default template to my templates html folder, rename it and select it in the ccomment backend, the error occurs.

I am familiar with template overrides in J! and am quite an experienced user.

With the default template enabled, my PHP error log says:
PHP Notice: Undefined property: ccommentComponentContentPlugin::$params in .../administrator/components/com_comment/plugins/com_content/content.php on line 85

I don't now if this PHP error notice is related to my template override problem.

Any help would be much appreciated.

Cheers
gerhard

Template override not working 10 years 11 months ago #20873

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Gerhard,
Thanks for testing, finding and telling me about this error! I just fixed it:
compojoom.com/component/ars/repository/dev-ccomment

It was just a slash missing from a file path:
$this->addTemplatePath(JPATH_THEMES . $appl->getTemplate() . '/html/com_comment/templates/'.$commentTemplate);
 
had to be
$this->addTemplatePath(JPATH_THEMES .'/'. $appl->getTemplate() . '/html/com_comment/templates/'.$commentTemplate);

Sorry about that!
The following user(s) said Thank You: Gerhard Sitzmann

Template override not working 10 years 11 months ago #20879

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Thank you for the quick fix Daniel.

Could you please tell me in which file this needs to be changed.

I'd rather change it there before downloading the whole extension again from the dev repo.

I then wait for the next official release and update.

Many thanks
gerhard

Template override not working 10 years 11 months ago #20880

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
components\com_comment\views\comments\view.html.php
You'll see the line 2 times in that file.

And you can take the dev. release... It contains fixes for few other things as well ;)
The following user(s) said Thank You: Gerhard Sitzmann

Template override not working 10 years 11 months ago #20881

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Never mind, found it in view.html.php

Template override not working 10 years 11 months ago #20882

  • Gerhard Sitzmann
  • Gerhard Sitzmann's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Oops, you're fast :-)
  • Page:
  • 1
Time to create page: 0.331 seconds