Announcement

Collapse
No announcement yet.

Custom template inclusion?

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

  • [vB4] Custom template inclusion?

    What's the new syntax for using a custom template within other templates?

    In 3.x we could use with $template_name as long as we added the templates to the global array, or special array if you wanted it just in a certain page.

    In 4.x, I can't figure out how to do this.

    Now, it's been so long, I can't access my login at vb.org, so please don't just point me there. Any help would be greatly appreciated. The alternative is to rollback to vb3. =/
    House of Night Forums - An online House of Night roleplaying community,

  • #2
    Additional info:

    I've added my template names to the array in class_bootstrap->cache_templates like I would have in the vb3 days. The following is a guess, but it doesn't work. What am I missing?

    {vb:raw custom.layout_top}

    Template "layout_top" is part of the "Custom Templates" group and from what I've seen, templates take lowercase groupname, minus the word "templates", the dot, and the template name. However, I've tried it in all forms I can think of.

    I really REALLY don't want to have to revert to 3.x just to do this.
    House of Night Forums - An online House of Night roleplaying community,

    Comment


    • #3
      Have you checked over at vBulletin.org where they have articles, guides and support forums for custom code?

      Comment


      • #4
        Thanks for replying Zach, but as per my first post, I no longer have access to vb.org and I'm not getting the password reset emails. I haven't tried contacting them yet, it's on slate for tomorrow. I just thought somebody here would know offhand.
        House of Night Forums - An online House of Night roleplaying community,

        Comment


        • #5
          See: http://www.vbulletin.com/forum/entry...emplate-Syntax

          More detailed tutorial: http://www.vbulletin.org/forum/showthread.php?t=228078
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud customization and demonstration site.
          vBulletin 5 Documentation - Updated every Friday. Report issues here.
          vBulletin 5 API - Full / Mobile
          I am not currently available for vB Messenger Chats.

          Comment


          • #6
            Thanks again, but I've seen them. It doesn't work. I'm not working with a custom page, or a plugin. I'm trying to register a new custom template in the same manner that vb itself registers header, headinclude, footer, and the like, so that I can drop {vb:raw layout_top} and so forth into existing templates. I added the custom template to the method in class_boostrap and the templater method register_page_templates, just as you did for header and footer. What I don't see, is where the value is actually set, as in the guide above. That seems to be what I'm missing. Yes, I'm doing this by amending the stock files.
            House of Night Forums - An online House of Night roleplaying community,

            Comment


            • #7
              Your varible name is wrong, what is the code you're using to register this template varible?

              Comment


              • #8
                First, "Create New Style" and gave it a name.
                Second, "Add New Template" and gave it content of "<b>hello</b>" and named it "layout_top". (It appears in the Custom Templates collection as expected.)
                Third, edit class_boostrap, method cache_templates and add:

                // templates to be included in every single page...
                $cache = array_merge($cache, array(
                // the really important ones
                'layout_top',
                'header',

                Fourth, edit class_core, method register_page_templates, and add:

                $this->register_global('layout_top');
                $this->register_global('footer');
                $this->register_global('header');

                Fifth, edit template FORUMHOME and add the following above the header variable:

                <body>
                {vb:raw layout_top}
                {vb:raw header}

                And it doesn't work, even though I did what was done for header. The obvious thing is that you are setting the value for header elsewhere and I can't locate it. That's the element I need resolved.

                Thanks!
                House of Night Forums - An online House of Night roleplaying community,

                Comment


                • #9
                  Confused, are you editing vB files to add templates to existing pages? Thats not really the right way to go about it.
                  You really need to fix your statuts @ .org so you can view the page, it answers many of the questions for you.

                  Comment


                  • #10
                    Your assumption is correct. I got my account there straight this morning, but so far, nothing I've seen actually answers my questions. =/
                    House of Night Forums - An online House of Night roleplaying community,

                    Comment


                    • #11
                      Well start a thread, or post for help in the correct place @ vBulletin.org and I am sure someone will try to help

                      Comment

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