How can I add a template link into another one?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arabhw
    Member
    • Jun 2002
    • 46

    How can I add a template link into another one?

    I made a template:
    advertising

    I want this template to be a part of header template

    I pust this:
    $advertising

    It doesnt work, did i miss something?

    Thanks in advance
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Add this code to the phpinclude_start template:

    Code:
    eval('$variable = "' . fetch_template('[color=red]template_name[/color]') . '";');
    Change the red code appropriately. Then you can use $variable in the templates and it will parse to the contents of the template you specify.

    Comment

    • John Campbell
      Senior Member
      • Nov 2004
      • 340

      #3
      This may sound really dumb but what is better (speed wise)

      the full html in the template (like this person needs- sans template)
      or making a template and putting the ad there?

      Sometimes I see banners loading late... could that be due to templated ads?
      Thanks!

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        They should be functionally identical, but calling a template like this will add an extra query to all forum pages. The effect on performance shouldn't be anything to worry about.

        Comment

        • John Campbell
          Senior Member
          • Nov 2004
          • 340

          #5
          Thank you.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...