I'm trying to embed a view into a node page which is then sent as plain text as a simplenews newsletter. It's 99% working but I'm having one issue.

when the plain text mail arrives it has the following at the top of it:

 * Edit
http://xxx/admin/build/views/edit/NewContent_Newsletter_View
 * Export
   http://xxx/admin/build/views/export/NewContent_Newsletter_View
 * Clone http://xxx/admin/build/views/clone/NewContent_Newsletter_View 

Obviously, I can't have that stuff going out to my newsletter subscribers, so I want to find a way of only sending the view content (the table, in this case), not the whole view, which evidently includes these edit/export/clone links.

Here is what I'm using to embed now:

<?php
  $view = views_get_view('NewContent_Newsletter_View');
  $result = $view->preview('block');
  print $result;
?>

I know I can switch off the edit/export/clone links across the site, but I really need them - just not here!

thanks for any help with this.

Comments

merlinofchaos’s picture

Status: Active » Fixed

The simplest way to do this would be to edit create a views-view--VIEWNAME.tpl.php template in your theme for that view and remove the admin links. Another method might be to use template_preprocess_views_view and remove the admin links there.

I can't think of a way to do that outside of theming. The proper way to do this involves creating a new display type, but I suspect that's more work than is needed for your purposes.

esllou’s picture

I was just coming on here to say I'd found this: http://drupal.org/node/517028

thanks then and thanks for now.

esllou’s picture

worked a treat. Cheers again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.