Answer the question
In order to leave comments, you need to log in
How correct is it to display a node programmatically?
To be clear, I'm not a programmer. Mostly a coder.
For a couple of years of using drupal, I always used views, displayed fields in the admin panel and, for the most part, rarely climbed into the render($page['content'])
code render($page['footer'])
.
Recently, I decided to try to find ways to completely programmatically output a node. And found!
The api describes several ways to type field_view_field()
. So I liked it much more, but I wondered if this method was correct. Let me explain, the projects are mostly not very complicated, but a bunch of extra classes and wrappers has always been annoying. It became especially hard to strain after meeting with BEM.
Actually questions:
How correct is this conclusion when creating a topic?
Does performance suffer?
If you stumble upon such code, will you curse the previous developer?
Is it possible to completely abandon views and do everything programmatically? Does it make sense?
Don't drink too hard :)
Answer the question
In order to leave comments, you need to log in
I can't even imagine why it's like that. In any theme, in any block, the page has always used views and will always be used.
- Through views, by pressing a couple of buttons, you will display any node, any number, anywhere.
- To programmatically display blocks in different regions, you will spend a lot of time on the code.
- I would mother. I would sit and think why?
- Abandoning views, it's like probably abandoning all editors and writing code in a regular notepad in Windows What's the
point? What are the problems with the output?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question