Posted by merzikain on February 26, 2010 at 12:14am
I've been trying to get the default drupal comments list and form to show up for this view I've created but it just won't work. I've even tried installing the comment block mod and placing the blocks where they should show up.
The view has a page and a block display (page is articles/%) and I've made sure that the page content type has comments turned on (read and write) yet still nothing. Commenting works everywhere else but not on the views page.
Any idea what could be wrong?
Comments
Views are not nodes
Comments only appear for node types, and views are not nodes.
You could embed the view in a node (there are many choices for this; see http://drupal.org/node/48816 for a start) or place it in a panel page (http://drupal.org/project/panels).
For some reason, when I try
For some reason, when I try to embed the view I get a completely blank page.
My view is named Article_View and I created a block display in it that uses the page title to get the info.
The content type is "article" and pathauto creates aliases like: articles/[title-raw]
I have a page-articles.tpl.php and a node-article.tpl.php and inside of node-article.tpl.php I have the following:
$view = views_get_view("Article_View");
print views_build_view('embed',$view,array($node->title),false,1);
Each time I get nothing when browsing to an article. I use firebug and all i see is . All I can figure is that there is an error somewhere but hell if I know where. I've even added "blah" to the top of my node-article.tpl.php and when I check it I get a blank page with "blah" being displayed.
I've tried it with different display types like page and block instead of embed and still no go.
Any idea what I'm doing wrong?
Also, I tried setting up panels but I have even less of a clue what I'm doing with it and no time to learn it so for this situation I have to stick with views.
latest views style
It depends on your versions, but the latest direct embed style is:
$view = views_get_view('viewname');
print $view->execute_display('default', $args);
It was in a link off that first page; I was directing you there more because of the discussion of different modules, and hadn't noticed that the direct embed code was outdated.
Awesome! Thanks a million,
Awesome!
Thanks a million, man! I've been working on that for the past few days and was getting to the point I thought I'd have to recode the whole thing myself in the node template instead of using views.
I really appreciate it! :D