2

So on a drupal site I am working on the client has a page where they have a view without a page template applied to it, and now the client wants to change the url of that page. As soon as I change the url of the view it applies the page template to the view. Obviously this was hard-coded in by url by the person who originally built the site, however, I have no idea how they did it. So i'm hoping someone on here has had a similar experience or knows how to make a view without a page template being applied to it.

6
  • What tpl.php files exist in the theme that have "page" in the name?
    – beth
    Commented Sep 3, 2014 at 15:46
  • page.tpl.php, maintenance-page.tpl.php, page--customerror--404.tpl.php
    – mako
    Commented Sep 3, 2014 at 15:53
  • 1
    hm... how about anything in template.php that is specific to the path of the view?
    – beth
    Commented Sep 3, 2014 at 15:56
  • url for the view is "www.site.com/solutions", found this in the template but it's prob not related. if ($node->type == 'solution') { $variables['myvariable'] = "some text here"; }
    – mako
    Commented Sep 3, 2014 at 15:59
  • I don't understand "url path is solution for the view". What happens if you grep the old path in your codebase, does anything come up?
    – beth
    Commented Sep 3, 2014 at 16:00

1 Answer 1

1

You can create a block view and display it anywhere in the code.

If your text format allow you to use PHP code you can insert a views anywhere in your website by adding something like this.

  <?php
    $block1 = "Name_Of_The_View";
    print views_embed_view($block1);
  ?>

And this will print a view inside of a node without using a page template. The beauty about this is that you can add HTML around this without using the block module.

For more information I will recommend you to read this documentation page Placing the contents of a block in any location

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.