1

This is a scenario. I wanted to find the content of the page from a link.

For eg while navigating the website, i clicked a link and the page loads. The page link is like www.example.com/gallery/videos

While checking I found there is a view named Gallery Videos and contains a 4 blocks attached. In the configuration of one block's path setting has been given "gallery/videos". But I did not find the page created for it. How can I easily detect where the content is loading and which view is it?

This seems to be a very basic question , but it seems hard to find when there are lot of contents, views and blocks used in the site.

2
  • Where do you want to find it out? Frontend or Backend? Commented Nov 5, 2015 at 13:16
  • I have the link and loads in front end. But I want to know how to configure the page in back end.
    – Mirza V U
    Commented Nov 5, 2015 at 13:18

1 Answer 1

0

Programatically speaking, if a View is involved in a template, the module injects the $view object into the available variables. So you can get to it pretty easily:

function MYMODULE_preprocess_node(&$vars) {
  if (isset($vars['view']) && $vars['view'] instanceof view) {
    if ($view->name == 'foo') {
      // ...
    }
  }
}

From a UI perspective, enabling the Contextual Links module might be a good solution to your problem. That will add direct edit/delete/etc links to nodes/blocks/views, and others depending on the contrib modules you have installed).

You can browse the site and simply click the edit link on a view to be taken to the edit page, where you can find out everything you need to know. Same for content, assuming it's been rendered in an entity view mode and not as fields.

1
  • Thanks Clive. This was something I was looking for. I thought I have covered all the basics of using drupal by learning its admin functionalities. But also need to look into a long list of modules.
    – Mirza V U
    Commented Nov 5, 2015 at 14:40

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.