Giter Club home page Giter Club logo

Comments (5)

quickapps avatar quickapps commented on June 27, 2024

I was unable to reproduce this issue on my local installation.
I've created a faqs content-type and then created theme_node_faqs.ctp and all seems to be okay.

  • What is the ID of your content_type ?
  • And the name of your .ctp file?

from cms.

Gabri avatar Gabri commented on June 27, 2024

First, a my mistake: I thought that in this way I could override also the LIST of a specific node type, not just the node redering.
So the "false" result was on listing that content (/s/type:example _ type ...there is no spaces betweend underscore char ...but otherwise the editor remove it)
Anyway, showing the specific content I have a problem too.
Strange, the file_exists($tp . 'Elements' . DS . 'theme_node_' . $nodeType . '.ctp') return false, but I put the file in the same folder of theme_node.ctp and its name is theme_node_example_type.ctp.
I tried this line:
debug(file_exists($tp . 'Elements' . DS . 'theme_node_node.ctp'));
and it is false too... (but I have that file and it works)

from cms.

quickapps avatar quickapps commented on June 27, 2024

Exactly, the node theming feature is for the "FULL" view mode only (node's detail page)


Well the result of ´file_exists()´ is very clear. Check that your .ctp file is located where it should:

 debug($tp . 'Elements' . DS . 'theme_node_' . $nodeType . '.ctp');

Instead checking the return of the function, make sure that the argument (file path) is correct and exists in your computer,
It should be:

   /absolute_path/to/your_active_theme/Elements/theme_node_example_type.ctp

from cms.

quickapps avatar quickapps commented on June 27, 2024

After thinking a bit, I think thi is incorrect:
"Exactly, the node theming feature is for the "FULL" view mode only (node's detail page)"

This ferature should simply acts as an alternative theme_node.ctp file. So it should work for any view mode, just as you were thinking at the begining.


I've removed the $this->is('view.node') part, because the same .ctp file may be used for any view mode. Similar as theme_node.ctp works:

c5e606a

from cms.

Gabri avatar Gabri commented on June 27, 2024

Great!
It think it's correct behavior too!
My mistake for the file ...I was trying on another installation with the same Theme...

from cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.