ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Dueling head tags with embedded forum

August 05, 2008 2:57pm

Subscribe [2]
  • #1 / Aug 05, 2008 2:57pm

    karentempler

    104 posts

    Per Derek’s request, a new thread for this question:

    The background is that I am running my forum through the regular EE template engine. The parent template is forum/forum_wrapper and it looks like this:

    {embed="includes/nav_forum"}
    {embed="includes/head_forum"}
    
    <div id="body" class="forum-body">
    
      <div id="main">
       {embed="forum/forum_content"}
      </div>
    
      <div id="sidebar">
      ...
      </div>
    
    {embed="includes/global_footer"}


    “forum/forum_content” contains only {exp:forum}

    Being the topmost piece, “includes/nav_forum” contains the document header along with the actual navigation.

    However, the forum templates contain an HTML Header of their own (Forum Templates / Global Templates / HTML Header), which leaves me with two sets of <head> tags—the one in the non-forum nav template and the one in the forum itself.

    I can’t just delete the forum’s HTML Header data because it contains the following:

    <html >
    <head>
    {include:meta_tags}
    <title>Readerville Forum | {page_title}</title>
    {include:javascript}
    {include:head_extra}
    
    {include:forum_css}
    
    </head>
    
    <body {include:body_extra}>

    And presumably none of those tags will work if I simply move them to my nav_forum template, where the document header lives, because it’s a standard EE template and those are forum template tags. I know for certain that the {page_title} tag doesn’t work when used there, and I’m assuming the same would be true of {include:head_extra} and the rest.

    So what do I do to do away with the second <head> set while preserving the functionality of its parts, including the dynamic page titles?

  • #2 / Aug 05, 2008 5:25pm

    Ingmar

    29245 posts

    To be honest, I don’t see a straight forward way to achieve that, short of giving up on nav_forum alltogether, and put it all in your forum template…

    Perhaps you could pull all the info you need with a few custom queries or some PHP in nav_forum? Just an idea.

  • #3 / Aug 07, 2008 3:33pm

    karentempler

    104 posts

    Hiya, Ingmar. I know I’m not the first to run the forum through the template engine—you don’t have any idea how others have addressed the problem? Unfortunately, it’s not the sort of thing I can really discern by viewing source on them.

  • #4 / Aug 11, 2008 5:55pm

    Ingmar

    29245 posts

    Running your forum through the template engine is fine, but in that case your template should consist of nothing but {exp:forum}. All styles, meta inforamtion etc would then be applied via the forum theme.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases