Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3627666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:55:01+00:00 2026-05-18T23:55:01+00:00

I have a Drupal site and I have setup a view to power the

  • 0

I have a Drupal site and I have setup a view to power the front page.

My goal is to be able to pass 0-2 arguments to the home page, that get passed into the view. However, I still need the normal Drupal pages to work. The list of arguments is known.

For example:

  • mysite.com/berlin/birds would pass in “berlin” as the first argument and “birds” as the second argument to the view that powers the front page.
  • mysite.com/berlin would just pass in one argument, “berlin”
  • mysite.com/admin would load the normal admin pages in Drupal

I’m not clear on how to achieve this. Is there a hook I can use? I can’t find one or think of one. Is there a way to specify this in the argument for the view itself? Perhaps I can write a hook that interjects when the URL is being loaded, and rewrite in the background?

The solution I currently have is to add these paths (since my arguments are known) to the menu system. This works, except that when I the pages they aren’t the front page, so the pages don’t use the node themes I want (they use the node details theme).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:55:02+00:00Added an answer on May 18, 2026 at 11:55 pm

    I don’t think you can really do this without custom code. The View needs a path before it starts taking arguments, and your URLs start with the arguments. What you can do is fake it with custom code. I’ve used something like this:

    /**
     * Implements hook_init().
     */
    function mymodule_custom_init() {
    
      $item = menu_get_item(); // Matching Drupal path
    
      if (!$item) { // There is no matching Drupal path.
        $_GET['q'] = 'view_path/' . $_GET['q']; // Fake path path.
      } // if
    
    } // mymodule_custom_init
    

    Then you give the view a path of “view_path” and it responds to everything that doesn’t match anything else in Drupal’s paths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather complicated deploy setup for our Drupal site that is a
I have a Drupal 6 site where I've created a view that shows a
Right now I have a Drupal site where I'm integrating a custom front-end interface
i would like to have a block on my drupal site(latest version) that displays
I have a drupal site that runs on nginx and php-fpm with haproxy balancing
I have a Drupal site and the Drupal site's admin is not able to
I have an old drupal site that I'd like to upgrade, but I need
I have a Drupal site built on a shared host and I'm finding that
I have a Drupal site using jQuery 1.3, so that unfortunately I cannot use
I have a Drupal site in production. The site's large enough that I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.