Can Drupal tell me what I’m looking at from the URL?
I think on D7 I had previously used something like menu_get_object()
to find out what content I was on
eg, if I was on a URL like mysite.com/content/my-page, that it would be able to tell me that this was a node, of type basic page, and the ID was 5 etc
Ideally I’m trying to do it even if the URL is the site’s homepage, I’d like to be able to reverse engineer what content it is showing me
This article was republished from its original source.
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.