How do I insert a views in a static html or php website?
And this html be updated according to the update of drupal

Would you like a directing because I am the days looking for a viable solution and not against.

Sorry for my English, I am using the translator.

Comments

bander2’s picture

So, you have an existing Dupal site with a View and you would like to insert that view into a non-Drupal website?

Views is a part of Drupal. So you can't use Views on a non-Drupal site. But you can create an RSS feed Views display or XML using Views Data Export. Then you can parse that data on your other website with PHP or Javascript.

You would lose sorting and filtering functionality from the view, but you would have the data.

- Brendan

EmilioLuiz’s picture

Exactly the case.

I tried to use the export data views, but which does not fit in my requirement was having to update manually, or it is possible to automatically update?

yelvington’s picture

EmilioLuiz’s picture

Thank you, I believe this resolves

EmilioLuiz’s picture

I first created a views field (module Feeds) as feed after I took the xml link and put it in a variable using the simplexml_load_file.

as the fields that should be inserted into html, was simple to find.

<?php
			$feed = simplexml_load_file('http://mysite.com.br/feed_legislacao');
			echo'<table style="width:100%;background-color: white;" border="1">';
						
			foreach($feed->channel->item as $a){
		
			echo'	<tr><td>'.$a->title.'</td>
				<td><a href="'.$a->guid.'">Link</a></td>
				<td><a href="'.$a->pubDate.'">PDF</a></td>
				<td>'.$a->description.'</td></tr>';
			}
			echo'</table>';

?>

Thank you all for the help.