Any Smarty Programmers Around?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Big_D
    CRAZY MOFUKKA
    • Jun 2006
    • 3296

    #1

    Any Smarty Programmers Around?

    got a question guys if you got the time. Trying to include a html file into a NATS (smarty) template. I tried the usual

    {include} {/include}

    still doesnt seem to work. any ideas?
  • Thurbs
    The Thrilla in Manila
    • Sep 2004
    • 4785

    #2
    try {literal}{/literal} around the regular include.

    - thurbs

    Comment

    • jimb
      Confirmed User
      • Feb 2005
      • 2514

      #3
      http://www.smarty.net/manual/en/lang...on.include.php

      {include file='page_footer.tpl'}

      Did you try it like that above?

      Jim

      Comment

      • Thurbs
        The Thrilla in Manila
        • Sep 2004
        • 4785

        #4
        Originally posted by jimb
        http://www.smarty.net/manual/en/lang...on.include.php

        {include file='page_footer.tpl'}

        Did you try it like that above?

        Jim
        nice Jim - the true pimpness of nats

        Comment

        • k0nr4d
          Confirmed User
          • Aug 2006
          • 9231

          #5
          Smarty in NATS has including disabled. {include file='page_footer.tpl'} will not work.
          You need to use a smarty plugin. Hit up TheDoc, i wrote one for him some time ago.
          Mechanical Bunny Media
          Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

          Comment

          • jimb
            Confirmed User
            • Feb 2005
            • 2514

            #6
            Originally posted by k0nr4d
            Smarty in NATS has including disabled. {include file='page_footer.tpl'} will not work.
            You need to use a smarty plugin. Hit up TheDoc, i wrote one for him some time ago.
            Yeah your right,

            Here's what someone would need to do if they wanted the custom plugin function:

            Goto your nats/smarty-2.6.18/libs/plugins (or whatever version of smarty you have) and create a file called: function.fileinc.php then enter this into the file:

            <?php
            function smarty_function_fileinc($params)
            { include($params['file']); }
            ?>

            After that file is created and the code inserted, you can use this smarty tag on any of the NATS Templates:
            {fileinc file="path/to/file"}

            Hope this helps everyone, and people in the future

            Jim

            Comment

            • Big_D
              CRAZY MOFUKKA
              • Jun 2006
              • 3296

              #7
              nailed it,

              thanks for the guidance on writing the plugin jim!

              Comment

              Working...