Request for a conditional....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klaj3981
    New Member
    • Apr 2014
    • 29
    • 5.0.X

    Request for a conditional....

    What conditional shall I use to hide certain things only when viewing the /register page?
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73979

    #2
    Really depends on what you want to hide but most likely you'll need to edit the actual HTML. If it is a required field (any fields shown by default), you might have to edit the API as well.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • klaj3981
      New Member
      • Apr 2014
      • 29
      • 5.0.X

      #3
      Hi Wayne, I am looking to hide the advertisements and the guest notice on the registration page. I have no problem editing the actual HTML. "<vb:if condition="THIS_SCRIPT != 'REGISTER'">hidden content</vb:if>" is no longer supported in VB 5.1... Does anyone know which conditional I should use?

      Comment

      • glennrocksvb
        Former vBulletin Developer
        • Mar 2011
        • 4011
        • 5.7.X

        #4
        Try adding this to debug and list the available variables and check what you can use.

        Code:
        <pre>{vb:debugvardump page}</pre>

        Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

        Comment


        • klaj3981
          klaj3981 commented
          Editing a comment
          It brought back some pretty nifty results. here are the first 10 or so...

          Code:
          array(34) {
            ["pageid"]=>
            string(1) "3"
            ["parentid"]=>
            string(1) "1"
            ["pagetemplateid"]=>
            string(1) "6"
            ["title"]=>
            string(8) "Register"
            ["metadescription"]=>
            string(28) "Forgot and Retrieve Password"
            ["urlprefix"]=>
            string(8) "register"
            ["routeid"]=>
            string(2) "13"
            ["moderatorid"]=>
            string(1) "0"
            ["displayorder"]=>
            string(1) "0"
            ["pagetype"]=>
            string(6) "custom"
          Now if I were to call "pageid", would this be a functional conditional?
          Code:
          < vb :if condition="$page['pageid'] == 3" > (sorry, I had to break it in order for it to show....)
      • glennrocksvb
        Former vBulletin Developer
        • Mar 2011
        • 4011
        • 5.7.X

        #5
        I think it would be safer to use the urlprefix since the chance of it getting changed in the future is remote. With pageid, it might change when you re-install or upgrade your site.

        Code:
        <vb:if condition="$page['urlprefix'] != 'register'">
             <!-- hidden content for registration page -->
        </vb:if>

        Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

        Comment

        • klaj3981
          New Member
          • Apr 2014
          • 29
          • 5.0.X

          #6
          Originally posted by Glenn Vergara
          I think it would be safer to use the urlprefix since the chance of it getting changed in the future is remote. With pageid, it might change when you re-install or upgrade your site.

          Code:
          <vb:if condition="$page['urlprefix'] != 'register'">
          <!-- hidden content for registration page -->
          </vb:if>
          This works flawlessly, thank you!

          Comment

          Related Topics

          Collapse

          Working...