[TYPO3] template selector, sub template is reachable but contents not visible

Reena reena at srijan.co.in
Thu Feb 24 14:42:51 CET 2005


Hi all,

I am implementing my site using typo3. I have read the documentation "Modern 
Template Building Part 2+3". I have one main template and one subtemplate.
I can include subtemplate in the main template but could not see the 
contents rendered via subtemplate.
My code is as follows:

1. I have created a sys folder and kept the two extensions :+ tmplselector 
html mode and ext: Menu Elements.

The :"+ tmplselector html: contains the code:
// --- SET UP TEMPLATE 
SELECTOR -----------------------------------------------
 page.config.admPanel = 1
plugin.tx_rlmptmplselector_pi1 {

      // Define the paths leading to our HTML template files
   templatePathMain = fileadmin/templates/main/
   templatePathSub = fileadmin/templates/sub/

      // Define the filenames used as the default HTML templates
   defaultTemplateFileNameMain = template_1.html
   defaultTemplateFileNameSub = subtemplate_1.html

      // If there is a page having no template selected, use a template
      // selected earlier in the rootline. If there is none, use the default
    inheritMainTemplates = 1
    inheritSubTemplates = 0
}

// --- CONFIGURE THE AUTOMAKETEMPLATE EXTENSION --------------------------

plugin.tx_automaketemplate_pi1 {

  content < plugin.tx_rlmptmplselector_pi1
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY

    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title

    TD.all = 1
    DIV.all = 1


  }



}

// --- CREATE TS TEMPLATES FOR MAIN AND CONTENT AREA ------------------

temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_HEADER
}

temp.contentAreaTemplate = TEMPLATE
temp.contentAreaTemplate {

   template =< plugin.tx_automaketemplate_pi1

      // Modify the template selector config: This is a sub template!
   template.content.templateType = sub
   workOnSubpart = DOCUMENT_BODY

    subparts.colNormal< styles.content.get



}


temp.mainTemplate  = TEMPLATE
temp.mainTemplate {

  template =< plugin.tx_automaketemplate_pi1

      // Modify the template selector config: This is a sub template!
   template.content.templateType = main

  workOnSubpart = DOCUMENT_BODY
  subparts.content < temp.contentAreaTemplate
  subparts.titleline < temp.titleline

   subparts.tagline < temp.tagline
  // subparts.lefttext  < styles.content.getLeft

   subparts.leftnav  < temp.leftnav
   subparts.logo < temp.logo
   subparts.rightnav < styles.content.getRight
   subparts.footer  < temp.footer

 subparts.colLeft < styles.content.getLeft
    subparts.colRight < styles.content.getRight

  //subparts.content< styles.content.get

}

// --- CREATE THE MAIN PAGE 
OBJECT -------------------------------------------


page.config.renderCharset = windows-1256

page.config.doctype = xhtml_trans
 #page.stylesheet = fileadmin/all.css
page.bodyTag = <BODY BGCOLOR=#FFFFFF LEFTMARGIN=10 TOPMARGIN=15 
MARGINWIDTH=0 MARGINHEIGHT=0>

page = PAGE
page {
   typeNum = 0
   headerData.10 < temp.headTemplate
   10 < temp.mainTemplate
}
And "ext: Menu Elements" contains the code:

# NO.ATagTitle.field = title

# main menu using CSS menus
 temp.leftnav = HMENU
 temp.leftnav.entryLevel = 0
 temp.leftnav.1 = TMENU
 temp.leftnav.1 {
      expAll = 0
      NO.wrap = |
      NO.ATagTitle.field = title
      NO.allWrap = <div class="leftnav_unsel1"> | </div>
      ACT = 1
      ACT.allWrap =  <div class="leftnav_sel1"> | </div>
      ACT.ATagTitle.field = title
 }



 temp.leftnav.2 = TMENU
 temp.leftnav.2 {
      expAll = 1
      NO.ATagTitle.field = title
      NO.wrap = |
      NO.allWrap = <div class="leftnav_unsel2"> | </div>
      ACT = 1
      ACT.allWrap =  <div class="leftnav_sel2">&raquo;&nbsp; | </div>
      ACT.ATagTitle.field = title
 }


 temp.logo = IMAGE
 temp.logo {
  file = fileadmin/images/ccbnlogo.gif

                }



 temp.titleline = TEXT
 temp.titleline {
 value = {page:title}
   insertData = 1
}

temp.footer = TEXT
temp.footer.value = @ 2004  Transform, In c.
-------------------------------------------------------------------------------------------------------

Main template file code is:

 <td height="60" colspan="2" class="content">&nbsp;</td> (Here I want the 
contents of subtemplate to appear)

Subtemplate file code is:
 <td valign="colNormal">&nbsp;</td>



Could anybody help me out in solving this problem.


Thank You,

Warm Regards,
Reena 




More information about the TYPO3-english mailing list