Reputation: 425
In Drupal, I would like to add a custom field to Basic page content type, but only to one Basic page with a particular node ID.
I know I can add custom fields to the whole content type but this is not what I want.
For example, is it possible to add a file upload field only to Basic page with node ID of 5?
Upvotes: -1
Views: 186
Reputation: 41
Using Views you can create the list of nodes that you would like to display on the page. The new version of views makes it super easy to do that. From there you have a couple options, depending your level of skill with theming and how much control you need to have over where the list of nodes displays:
A Block - Create a block display for your view. Place the block in the same region as the main content block. node--NODEID.tpl.php - You could add a template suggestion to your theme to override the specific node that you want to add the list to. To do that you would need to:
Create a node--NODEID.tpl.php file, replacing the NODEID with the nid of the node you want your list of nodes to show up on. Embed your view in the node template using the following code:
nid); ?>Where MY_VIEW is the machine name of the view you created and MY_DISPLAY is either "default" or the machine name of a specific display in your view.
Here is an example: http://api.drupal.org/api/views/views.module/function/views_embed_view/7#comment-32858
Upvotes: 1