0

I want to control the region the store locator and panel being placed into. I was hoping I could just use a content-type page .tpl to move things around within the rest of the layout, but that doesn't seem to be working.

After trying it and it not working I'm guessing all that would do is change the display of the actual "/name-of-store" path and not the sitename/store-locator path.

Store Locator seems to be an odd duck. I can't find anything in the code that would point to a tpl file. It certainly isn't a view in a block since it's basically being rendered in the primary content area of my standard tpl file.

My first wish is to have a separate page.tpl so I can get all the parts of pieces of the page where I want them. Being that it looks like all the code is generated in JS, I can't even think of a way load that into a view and then but the view in a panel layout that's full width.

Any thought on what the page tpl needs to be and what the right theme hook would need to be in preprocess? This is what I have working for my other hinting for page tpl's.

  if (isset($variables['node'])) {
  // If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
   $variables['theme_hook_suggestions'][] = 'page__'. str_replace('_', '--', $variables['node']->type);
  }

1 Answer 1

0

There are many possible ways to solve this problem. My suggestion, however, would be to use the Page Manager Existing Pages module. This module will let you easily override the callback at that URL and place the content for the page in any region of your Panels layout.

If you want to do it the same way as you've been doing it for other pages, then there will already be template suggestions automatically provided for you, derived from the path. So if the path to the item is sitename/store-locator then the template suggestions that will already be automatically created for you are page__sitename and page__sitename__store_locator. You need only to create those tpls.

That said, I'd still generally recommend the PM Existing Pages module for this type of functionality.

6
  • When I first ran into the issue and my first attempt at the .tpl through the template suggestions didn't work, I immediately figured I could just make a panel page and through things where I need to in my defined layout. The problem with that is that the store locator isn't a view, which means I can't pull it into a panel - unless I'm misunderstanding here. I don't want to make a node view to put that view into a panel just to get it to fit in the right region. All that seems too abstracted for something that should be simple. Commented Aug 10, 2015 at 21:51
  • So...are you still having trouble or did you figure it out?
    – Aaron
    Commented Aug 10, 2015 at 21:53
  • I'm still having trouble. I tried page--store_locator.tpl and that didn't work. Commented Aug 10, 2015 at 21:56
  • What is the path to your page?
    – Aaron
    Commented Aug 10, 2015 at 21:57
  • sitename/store-locator Commented Aug 10, 2015 at 21:58

Your Answer

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

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