Jump to content

louisstephens

Members
  • Posts

    516
  • Joined

  • Last visited

Everything posted by louisstephens

  1. So I am using a blank template for a page (which is only calling the title of the page). It is also not including the header or footer in the template. I am then calling the page in my basic template using: <?php echo $page->import_page->render(); ?> However, when I go to refresh the page again, I get an error: "Compile Error: Cannot redeclare renderNav() (previously declared in /Applications/MAMP/htdocs/ProcessWire/site/templates/_init.php:20) (line 49 of /Applications/MAMP/htdocs/ProcessWire/site/templates/_init.php) Has anyone had the same issues?
  2. Thank you again Kongondo for all your patience and help. I feel like I am headed in the right direction.
  3. You know, The more I think about this, it might be better to handle this actually in the admin section with a dropdown for the user/admin to select whichever one he wants,. However, I dont know if this will open an entirely new can of worms.
  4. Actually, the content of headerImage.inc (which will changing to just contentheader.inc) will contain a different header piece (image and a brief description) that will be displayed underneath the actual website header (logo, navigation). As for the second question, the content could be static, but I would like to keep the option open to have it dynamic just in case the information in that section needs to change. Keeping in line with my examples, "Whale" will have 10 subpages and will use one of the contentheaders. However, "Guppie" will be identical content with a different contentheader. I guess a better way to explain this would be : "I wish to "brand" each set of pages differently, even though they have the same content". Sorry if I made this more confusing than it probably is.
  5. Thanks again Kongondo! I finally figured out a way to do this (might not be the best). <?php $urlGrab = explode( '/', $page->url);echo $urlGrab[2]; $newHeader = $urlGrab[2]; switch ($newHeader) { case "whale": include( './inc/headerImage.inc'); break; case "guppie": include( './inc/headerImage2.inc'); break; default: include( './inc/headerImage.inc'); } ?> Is there a better way to create the desired effect?
  6. Thanks kongondo! I am falling in love with process wire ( long time user of Wordpress). I was kind of hoping to keep one or two templates to use and just switch the header ( as they will all use the same fields etc etc and the number there will potentially be 25 different versions of one template header) I am sorry, I should have clarified in my original post.
  7. So I have set up a pretty basic template for pages using: <?php include('header.inc'); ?> and page structure is something like mydomain.com/whales/page-name I was hoping to have a different header.inc for every group of pages (so based on the parent page include the relevant header.inc). For example, /whales/ would have a different header than /goldfish/ (sorry for the silly examples). However, I can not for the life of me find a solution, nor am I having any luck in creating the desired outcome. Has anyone done anything like this before? Am I approaching this is the wrong way?
×
×
  • Create New...