1

I'm now in process of reducing the numbers of module used in the website. I will disable Panels and several other modules, but still using Views.

(The website is not too complicated, but because many modules involved, it become quite slow.)

Instead of using Panels, I'm customizing the appearance through dozens of template files.

But I just wonder, is it possible to create new page without using Views or Panels?

4
  • <html><body><h1>This is a page</h1></body></html> :P
    – dav_i
    Oct 13, 2012 at 11:52
  • 1
    @dav_i How do you means to use it? If using template suggesion, the page is loaded, but it will be treated as 404 page.
    – apasajja
    Oct 13, 2012 at 12:14
  • I was just being silly - implying that you use plain HTML instead of Drupal - would require absolutely no modules!
    – dav_i
    Oct 13, 2012 at 12:17
  • 1) I believe your question needs to clarify what you mean by "create new page". 2) As the question implies that Panels is (partly) responsible for making the site slow, I feel compelled to point out that that is not inherently the case. Overhead of using panels. If it really is, then it is simply incorrectly configured.
    – Letharion
    Oct 13, 2012 at 13:54

1 Answer 1

1

Yes, You can write a small custom module to create pages with out using heavy panels module.

Please see the hook_menu documentation.

function yourmodulename_menu() {
  $items['page_one'] = array(
    'title' => 'Title of Page', 
    'page callback' => 'page_one_callback', 
    'access arguments' => array('access content'), 
    'type' => MENU_CALLBACK,
  );
  $items['page_two'] = array(
    'title' => 'Title of Page', 
    'page callback' => 'page_two_callback', 
    'access arguments' => array('access content'), 
    'type' => MENU_CALLBACK,
  );    
  return $items;
}

 function page_one_callback() {
   $content = "";
   return $content;
 }

 function page_two_callback() {
   $content = "";
   return $content;
 }

To make your life much more easy without any coding, just go to "node/add/page" and create a new page !

2
  • That was great. But if we can create a page without writing a new module, it will be even better.
    – apasajja
    Oct 13, 2012 at 13:02
  • Yes, you can go to "node/add/page" and create a new page !
    – Anil Sagar
    Oct 13, 2012 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.