Announcement

Collapse
No announcement yet.

How to make a conditional statement

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to make a conditional statement

    Hy,

    I am trying to edit the 'Add a group template' (sgadmin_adminsettings)

    When i land on this page site.com/sgadmin/create/settings?groups_section=cars i am adding this in the url : ?groups_section=cars

    In sgadmin_adminsettings template i tried the following:

    <vb:if condition="$_GET['groups_section'] ==cars">Say Hello</vb:if>


    But it is not working.

    Can you please explain to me how this conditions should work?

    Thank you!

    #2
    You need to enclose cars inside quotes as it is a literal string.
    Code:
    <vb:if condition="$_GET['groups_section'] == 'cars'">Say Hello</vb:if>
    If that's still doesn't work then you don't have direct access to GET querystring parameters from there. Try debugging the value of the routeInfo variable to see if groups_section querystring parameter is there.

    Code:
    {vb:debugvardump routeInfo}
    debugvardump is a useful debugging code few people only know.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      Btw, I've moved this topic to the more appropriate forum channel.
      Helpful? Donate. Thanks!
      Buy me a coffeePayPal QR Code
      Fast VPS Host for vBulletin:
      A2 Hosting & IONOS

      Comment


        #4
        Sorry about opening it in the wrong forum. I noticed that because i was working tired, i was trying to add the condition in another style. So now it works ok.

        Thank you for taking out of your time, and replying here!

        Comment

        Users Viewing This Page

        Collapse

        There is 1 user viewing this forum topic.

        • Guest Guest

        Latest Posts

        Collapse

        Working...
        X
        Searching...Please wait.
        An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

        Please push the back button and reload the previous window.'
        An unexpected error was returned: 'Your submission could not be processed because the token has expired.

        Please push the back button and reload the previous window.'
        An internal error has occurred and the module cannot be displayed.
        There are no results that meet this criteria.
        Search Result for "|||"