Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found the answer to be that apparently somewhere in the pipeline of creating a node Drupal uses <code>$path</code> (that is originally set by <code>$_GET['q']</code>) and sometimes also <code>$_GET['q']</code> to determine how to render the page. NOTE that I am using Panels and Ctools Page Manager modules in order to get my things working correctly. </p> <p>It turns out Panels, if you search the code, looks at <code>$_GET['q']</code> for quite an amount of things.</p> <p>Here is what I ended up with:</p> <pre><code>/** * Implementation of hook_menu */ function modulename_menu() { $items = array(); // For department and having nice URL's for their profile pages. $items['my/nice/url/profile/%'] = array( 'description' =&gt; 'This page holds a view that shows profiles based on the %', 'page callback' =&gt; 'website_profile_load', 'page arguments' =&gt; arg(4), 'access callback' =&gt; TRUE, 'type' =&gt; MENU_CALLBACK, ); return $items; } /** * Menu path callback */ function website_profile_load($id = NULL) { // Rename the query internally since other functions base the design // on the way the query is structured and not simply by the node which // is currently loading. if(!empty($id)) { $path = $_GET['q'] = 'node/1221/profile/id/' . $id; } // Use ctools function to correctly display node view since // this site heavily uses ctools rendering for panels and // web parts / web pages. drupal_load('module', 'page_manager'); ctools_include('node_view', 'page_manager', 'plugins/tasks'); if(function_exists('page_manager_node_view')) { $output = page_manager_node_view(node_load(1221)); } else { // Will display incorrectly but still load the UI $output = node_page_view(node_load(1221)); } return $output; } </code></pre> <p>And it works :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload