Announcement

Collapse
No announcement yet.

Raw isn't shoing in 'header'

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

  • [CMS] Raw isn't shoing in 'header'

    Hi,
    I just created a template. in the template, i entered some text.
    When im adding the template to a raw variable, and showing it on the template 'vbcms_page', it works.
    But when im adding this to the 'header' template, id doens't.
    Here is the plugin:
    HTML Code:
    $abcHTML = vB_Template::create('DK')->render();
    
    vB_Template::preRegister('header', array('var' => $abcHTML));
    vB_Template::preRegister('vbcms_page', array('var' => $abcHTML));
    As you see, the template named 'DK'.
    I think the HOOK location isn't good. the location is: process_template_complete.
    but if this is really the problem, why? and i will be happy for a little explain about 'HOOK'.

    Tnx.
    Last edited by Yellow Slider; Mon 15 Feb '10, 10:40am.

  • #2
    You'll probably want to stop making multiple threads about this now.

    It's not as simple in vB4 as it was in vB3. Read [HOW TO - vB4] Rendering templates and registering variables - a short guide - vBulletin.org Forum
    My Live vB5 Site - NZEating.com
    vBulletin Hosting | vBulletin Services - Need hosting for your vB? Need it installed? Something else? Let me take that hassle off your hands.

    Comment


    • #3
      Originally posted by Ace View Post
      You'll probably want to stop making multiple threads about this now.

      It's not as simple in vB4 as it was in vB3. Read [HOW TO - vB4] Rendering templates and registering variables - a short guide - vBulletin.org Forum
      I'm having problem after reading it and trying to find information about my problem, if vB's support would actually - support me, I wouldn't open the same thread in COM and ORG.

      Comment


      • #4
        Custom coding is not something that's supported - you should be posting over at www.vbulletin.org for assistance on this.
        Vote for:

        - *Admin Settable Paid Subscription Reminder Timeframe*
        -
        *PM - Add ability to reply to originator only*
        - Add Admin ability to auto-subscribe users to specific channel(s)
        - "Quick Route" Interface...

        Comment


        • #5
          Yeah,
          no one supporting. what a surprise.

          Comment


          • #6
            Originally posted by Yellow Slider View Post
            Yeah,
            no one supporting. what a surprise.
            vbulletin.org is run by volunteers - just regular users like you and I who help each other.

            I have generally found that the more willing you are to help yourself, the more willing others are to help you. Users who just dump code over there and say "it's broken, fix it" don't get as much help as users who post their code and talk about different things they have tried and explain in detail what is going wrong.

            Please don't PM or VM me for support - I only help out in the threads.
            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
            Want help modifying your vbulletin forum? Head on over to vbulletin.org
            If I post CSS and you don't know where it goes, throw it into the additional.css template.

            W3Schools <- awesome site for html/css help

            Comment


            • #7
              I paid a lot of money for this CMS, and I need to get a support for it.
              Actually, now I think this is a bug.

              Comment


              • #8
                I have to say the description in that article really sucks. It does not work that way at all.

                Here is how I define my variable in a plugin to get it displayed in a template:

                Create a new Template called "customVar" which contains only the following
                PHP Code:
                $customVar 
                Now create a plugin where you want to define the variable
                PHP Code:
                $myVariable=2;
                $templater vB_Template::create('customVar');
                    
                $templater->register('customVar'$myVariable);
                $templatevalues['myTemplateVariable'] = $templater->render();
                vB_Template::preRegister('FORUMHOME'$templatevalues); 
                in your template (in my case it is called FORUMHOME) now put the following to display it:
                PHP Code:
                {vb:raw myTemplateVariable

                It should display the number 2 somwhere when it works. Hope that's what you needed
                Last edited by Wynex; Fri 19 Feb '10, 8:12am.

                Comment


                • #9
                  THIS IS NOW WHAT I WONT. I WANT TO SHOW A TEMPLATE, IN THE TEMPLATE 'header'. YOU CAN SEE MORE DEATIL HERE: http://www.vbulletin.com/forum/proje...?issueid=36405 OH, AND YOU'RE CODE IS SUCKS, IF YOU WANT TO DEFINE A VARIABLE AND SHOW IT ON A TEMPLATE.

                  Comment


                  • #10
                    I already told you in another one of your threads about this same issue that you are preregistering your variables wrong. If you don't want to listen to me, then fine, but don't then go complain about the code not working.

                    Please don't PM or VM me for support - I only help out in the threads.
                    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                    Want help modifying your vbulletin forum? Head on over to vbulletin.org
                    If I post CSS and you don't know where it goes, throw it into the additional.css template.

                    W3Schools <- awesome site for html/css help

                    Comment


                    • #11
                      E.. the code is coreect. Evenmore, you told (after I told you that you chaned only the variable name) me that you don't have an idea. http://www.vbulletin.com/forum/showt...other-template

                      Plz have a look at all the post (with codes) here: http://www.vbulletin.com/forum/proje...?issueid=36405
                      Tnx for help.

                      Comment


                      • #12
                        Could it have anything to do with the choice of variable? 'var' is not something I would ever use, given its complete lack of uniqueness.

                        Have you tried to use a unique variable? "fxz23_potato" rather than "var"?
                        My Live vB5 Site - NZEating.com
                        vBulletin Hosting | vBulletin Services - Need hosting for your vB? Need it installed? Something else? Let me take that hassle off your hands.

                        Comment


                        • #13
                          Yeah...
                          Actuallt it doesn't metter, but i will try again.
                          edit: tried to change to the name 'blash', still the same - work on vbcms_page, not on header.

                          Comment


                          • #14
                            My guess would be you are using a hook location which is rendered after the header template is rendered. Have you looked at the code and looked to see where the header template is rendered? You've picked a hook location which is quite far along.

                            Please don't PM or VM me for support - I only help out in the threads.
                            vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                            Want help modifying your vbulletin forum? Head on over to vbulletin.org
                            If I post CSS and you don't know where it goes, throw it into the additional.css template.

                            W3Schools <- awesome site for html/css help

                            Comment


                            • #15
                              I see.
                              Where can I see where the header template is rendered?
                              I don't know.

                              Comment

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