Announcement

Collapse
No announcement yet.

Including a template from within another template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Including a template from within another template

    Hi,

    How do I include a template from within another template?

  • #2
    That generally requires modifying the code. What are you trying to do exactly?
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Originally posted by Steve Machol
      That generally requires modifying the code. What are you trying to do exactly?
      I've added extra data to some standard templates, but that's not easy to update.
      So instead I'd like to add a single include to the standard template and put my extra data in it's own template.
      Then my own data is far easier to edit.

      It's for a mod I distribute, not just for myself.
      Last edited by xtf; Fri 17th Feb '06, 3:52am.

      Comment


      • #4
        If you are creating your own Plug-in/Product, there is info at vBulletin.org on how to create your own templates and include them in the package.

        Comment


        • #5
          That's a bit vague. My guess is that you are going to need to modify the code to do this. Try asking over at www.vbulletin.org.
          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment


          • #6
            Originally posted by feldon23
            If you are creating your own Plug-in/Product, there is info at vBulletin.org on how to create your own templates and include them in the package.
            I know, but I would like to include a template from within another template without additional code.

            At http://vbulletin.org/forum/showthread.php?p=900090 nobody replied yet.

            I guess this isn't possible in the current version, but in that case, I'm wondering if you think this would be a good feature to have.

            Comment


            • #7
              This is not possible.

              Comment


              • #8
                Originally posted by feldon23
                This is not possible.
                So do you think this would be a good feature to have (in a next version)?

                Comment


                • #9
                  No, because it is a piece of cake to load an extra template. It's 1 line of PHP code through the Plugin system:
                  Code:
                  eval('$mynewtemplate = "' . fetch_template('mynewtemplate') . '";');
                  and it's much more efficient because you call it when you need it instead of on every page.

                  Comment


                  • #10
                    Originally posted by feldon23
                    No, because it is a piece of cake to load an extra template. It's 1 line of PHP code through the Plugin system:
                    Code:
                    eval('$mynewtemplate = "' . fetch_template('mynewtemplate') . '";');
                    and it's much more efficient because you call it when you need it instead of on every page.
                    If there is a hook at the right place. What if there is no hook?
                    And aren't the templates preprocessed and cached? The includes could be resolved before they're cached.

                    Comment


                    • #11
                      Even if uncached, templates will still work. There is however a hook available to cahce your templates.

                      I suggest you have a look at the Tutorial section of vBulletin.org.
                      Want to take your board beyond the standard vBulletin features?
                      Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

                      Comment


                      • #12
                        If you find a place where there is no hook, then please either post in the "Hooks Request" thread or use global_start.

                        Comment

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