By wal on
Is there a way through PHP code or HTML to include a node or path (taxonomy/term/2) in an HTML/PHP page? I would like to create a page with some static information but also have the contents updated dynamically.
I know 'include()' works with the entire URL but that includes the whole page. I just want the node, not the header and blocks and all. Can you get 'include()' to work without the php extension?
Comments
You can use PHP filter in
You can use PHP filter in your page.
Then you can use any php code, but I recemmend you to use Drupal API.
For example:
this code loads node object, then creates node view, and then print it out.
You can also manipulate node's object to obtain desired view.
- I wonder how am I perceived when passion enters me :-) -
Works great... Almost.
Works great but now let me explain what I REALLY meant. I guess I misunderstood what a node was. When I said I wanted to include a node what I really want is to include a category or taxonomy. I would like to include all nodes related to a specific category (taxonomy/term/6 for example).
Is that possible using a similar method? It seems like it might be but I can't figure it out via trial and error just yet.
Thanks for the help.
Found the code...
I found the code on the snippets page.
Thanks for the help!!!
Do you have only dynamic
Do you have only dynamic content on your static page or a combination of both static and dynamic? My understanding was that the latter was not possible (since you have to select php as the input format).
If my understand was wrong, I would like to correct it.
Thanks.
A page set to 'php code' can include HTML
A page to to 'php code' can include HTML outside the <?php and ?> tags
Oh dear! That's PHP basics.
Oh dear! That's PHP basics. Thanks for pointing that out.
node view
Hello Zygmunt,
the snippet is working OK but I'm wondering whether exists a way to specify the node after its alias rather than its id.
Gigi
HI, I am new in Drupal, I am
HI, I am new in Drupal, I am trying to learn a way to create with the Page Content HTML+PHP pages including for example listing of Stories, etc... I am totally new in this topics and Because that I need some documentation or tutorials on how to work with snippets or something to do that but I don't found it yet :(
Can anybody help me ? give me any link to learn those skills?
Thanks a lot! Really ;)
Tomas!
Sorry, my english is patetic! :P
With Drupal 6 I tend to ask
With Drupal 6 I tend to ask what people want to do. With views 2 a lot of the need for snippets really goes away and snippets are harder to maintain (at least in my opinion).
So I would suggest starting with what you want to list and looking at view 2.