0

I am a drupal 8 developer, who just needed to migrate drupal 6 site to drupal 7. I migrated all the content and database successfully, but some node pages displays header, footer but it doesn't display the content which has bunch of nodes of node type FAQ. I have page--faq.tpl.php in template and node--faq.tpl.php. This is what I see when I go to /faq page:

enter image description here

I am not even able to see what is in my $variables array when I hook node via:

function joycone_preprocess_node(&$variables)
{
    kpr($variables);
}

I should at least see whats in $variables when I go to /faq page. But it doesnt even print kpr.

I wanna display FAQ nodes(node type is FAQ) where it says "The requested page '/faq' could not be found.". Here is my question:

Do I need to use some sort of template hook so drupal 7 theme get that dynamically? Because I have product and promotion pages that I wanna display product and promotion nodes at /products and /promotions page.

I am not sure if Drupal 7 gets what nodes will be displayed at what page automatically via template naming. If I need to use preprocess hook what will it be?

Or do I need to create individual modules for each page and pass nodes to template like that?

Any help would be appreciated. Thanks for your time.

  • If the name of your content type is faq the templates should work. But do you really have a page named /faq? This is another different thing go to check if this page really exists. – Adrian Cid Almaguer Aug 24 '18 at 15:42
  • Yes I do have /faq page. Thanks for the quick answer – Mr.T Aug 24 '18 at 16:10
  • The View is missing? What is /faq? – Kevin Aug 24 '18 at 16:15
  • @Kevin /faq is the url that I wanna display all faq nodes. I am not using view module, I am trying to display faq nodes programmatically. – Mr.T Aug 24 '18 at 16:26
  • The question is misleading then.... there’s no code above pertaining to creating your own menu item with page callback in order to do it. Views would have it in two minutes. It can be done programmatically too but the original question is asking something else. – Kevin Aug 24 '18 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.