I’m having some problems creating a view for a node within my website.
The content has a path of ‘content/%’ where % is the title of the node.
What I tried to do is to create a page view in the Views2 module, but to no avail.
When I attempt to preview with the name of one of my nodes, nothing appears, and when I visit the node live, it renders text to the screen without any formatting.
Here are some of the settings from my View…please let me know if I should provide any extra information!
Page Settings
Path: content/%
Arguments
Node:Title
- Title: %1
- Action to take if argument is not present: Provide default argument
- Default argument type: Node ID from URL
Edit
I will describe the behavior I’m expecting to see…
I have a list of nodes in my website in a view….that shows up without any issue.
What I would like to do is click on the node and go to that node’s page, which is basically an expanded view of a single item from my list.
I thought what I could do is clone my list view and then add an argument to trim the scope from a list to a single item, but this isn’t working too well. What is the proper method for styling a single node?
Edit:
Based on your edit, you’ve already used Views to create a list of nodes, and now you want to be able to click on one and get to the node page.
If you just want the default node output, you shouldn’t have to do anything else. Don’t try to use a View to override default node rendering; Drupal will print it out by default.
If you want to theme your node uniquely (beyond what moving the fields around and changing display settings in the UI allows you to do), then you should look at custom template files and theming. Resource here: http://drupal.org/theme-guide
You can change the default
node.tpl.phpfile if you want to change how all nodes are displayed, or you can copy that file and rename it tonode-name_of_custom_type.tpl.phpto uniquely theme a custom content type you’ve created, but I’d suggest reading up on the Drupal theme system before making those changes.End of edit
When you want to assign a path to a Views Page display, you shouldn’t model it after any existing paths (e.g. node paths, as you mention). It should be something unique to avoid path alias conflicts. So for example:
my-path/%
Now, if you’re just looking to embed a view inside of your node (and you want to pass along the node id as the argument), you’re half-way there. Your Arguments setting, based on your description, is correct. However, you don’t need a page display.
Here are a couple of options:
content_bottomregion) to “embed” it in your nodeviews_embed_viewfunction (api docs here) inside your node (the body or a CCK field, just make sure to use the “PHP filter” input format)If you use
views_embed_view, you have the flexibility of sticking your Views results wherever you like, and you don’t even need to create a Views page or block display, because that function can just use the “Default” display.Note: If you export your View and save the export code on a site like pastebin or drupalbin, folks here can import the View and see it directly to help answer your question in full detail.