It seems to me this is not possible, but perhaps it's very simple and I just missed something.

I have a view with one argument and I've embedded it in a page. This page is categorized and some blocks show up on it because of these categories. Let's suppose the url of my page is:

book/this_is_my_page

In the embedded view I specified a page display with url, you guessed it:

book/this_is_my_page

so that if I access:

book/this_is_my_page/this_is_my_argument

I get the view displaying the elements I wanted. So far so good, except for two things:

1) (minor) the breadcrumb is incorrect, as it shows only the homepage
2) (major) the blocks don't show up, because the view page is not categorized

Is there any way to have the blocks show up? Is my setup wrong, do I need to do anything differently or is it just not possible?

Thanks in advance!

Comments

adaven’s picture

I think this is because you're not actually seeing the embedded page, your seeing the view itself. You can verify this out by changing the views path to something different like views/my_view

Unfortunately you can't pass arguments like this to an embedded view. book/this_is_my_page will work fine, but book/this_is_my_page/this_is_my_argument will return a 'page not found' error. This is because the Drupal's menu system handles url argument, and because your looking at an embedded view and not the real view the hook_menu for that view doesn't get called.

You can get around this by passing the arguments like this ?q=book/this_is_my_page&my_args=this_is_my_argument and then in your page have something like:

<?php
  $my_args=$_GET['my_args'];
  if(check_plain($my_args')) // all important input checking 
    print views_embed_view('my_view','page',$my_args);
?>

It would be really nice if there was a module that could do what your asking, but I think right now you'd have to write your own module for each page, have a look at page_example.module.

Hope that helps.

Anonymous’s picture

Status: Active » Fixed

Marking as fixed.

Status: Fixed » Closed (fixed)

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