Hi,

I am using view module to create a listing page for news content. Successfully created the view, and is displaying properly.

After that I have created a page using 'create content' and pasted the php code (to display the list of news), which I got from the previously created view, using export option. Now the problem is that after saving the details it shows a blank screen. I am unable to understand what the problem is. could any one help me on this.

Comments

gbrussel’s picture

But did you set the input format to PHP? You'll need to set it to post PHP code in a node.

The easier solution is to create a page display in the view setup and create it's path there.

shijina’s picture

Hi gbrussel,

Thank you very much for your reply.

I already set the input format to php, also added the php tags ( ). It works properly if give something to echo or print. But when I save the code (got by exporting the view) shows a blank screen.

I wish to know is it possible to create a page using the code got by exporting any view.

imrook’s picture

I think your going the wrong way about this. The view export code is meant to be used to copy views from one Drupal site to another. You shouldn't need it to embed a view in a page. If you only need the view at one URL, just use the Page options in the view configuration. If you want to embed the view within a node, look at the insert_view module.

vm’s picture

When you export views , I believe you should be making a custom.module with them see: http://views-help.doc.logrus.com/help/views/api-default-views

for more information

shijina’s picture

Thank you very much for your great suggestions. will check both.