Not able to override entity specific template.

Comments

sriharsha.uppuluri created an issue. See original summary.

slipstreamer’s picture

try putting this in your twig template

<style>
.node_view ul {
  list-style-type: none;
}
.node_view a {
  text-decoration: none;
}
.node_view ul.pre_links li {
  float: left;
}
.node_view ul.pre_links li:first-child {
  background: url(/modules/attr/printable/icons/print_icon.png) left center no-repeat;
  padding-left: 20px;
}
.node_view ul.pre_links li:nth-child(2) {
  background: url(/modules/attr/printable/icons/pdf_icon.png) left center no-repeat;
  padding-left: 20px;
  margin-left: 7px;
}
</style>

<strong class="node_view"><ul class="pre_links"><li class="print"><a href="/node/{{node.id}}/printable/print" target="_blank">Print</a></li><li class="pdf"><a href="/node/{{node.id}}/printable/pdf" target="_blank">PDF</a></li></ul></strong>
</br>
nigelcunningham’s picture

Status: Active » Fixed

I've just added support for printable variants of all templates (via a theme suggestions hook). You can use (for example) printable--node.html.twig to override node.html.twig when a printable version of a page is being made. I haven't done output specific versions (pdf or print) as I don't see a use case yet.

The above change is in printable's git repo and will be in the next release. If you update printable, please also update pdf_api.

Thanks for the suggestion!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.