Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:46:13+00:00 2026-05-25T01:46:13+00:00

Is it possible to compare variables in TypoScript? If it is possible – then

  • 0

Is it possible to compare variables in TypoScript? If it is possible – then how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:46:13+00:00Added an answer on May 25, 2026 at 1:46 am

    I struggled with the very same issue, so here is what I found out. I was trying to include a plugin, but only if a certain TypoScript configuration variable was already set, which isn’t possible using TypoScript conditions, because these don’t have access to TypoScript variables!

    So the way to go really is the ominous if-function. The documentation says the following:

    This function returns true if ALL of the present conditions are met (they are AND’ed). If a single condition is false, the value returned is false.

    What they do not mention is, that, if the if-function returns false, the Element in question is just not displayed/executed or whatever TypoScript actually does, for example:

    10 = TEXT
    10.value = foobar
    10.if.value = 42
    10.if.equals = 24
    

    This TEXT-element would never be displayed, because the condition does not evaluate to true. The following however, would be displayed:

    10 = TEXT
    10.value = foobar
    10.if.value = 42
    10.if.isGreaterThan = 24
    

    if.value always holds the value you are comparing to, and then there are a bunch of property you may use to compare another value to it.

    The only good example in the documentation is this one:

    This is a GIFBUILDER object that will write “NEW” on a menu-item if the field “newUntil” has a date less than the current date!

    ...
    30 = TEXT
    30.text = NEW!
    30.offset = 10,10
    30.if {
        value.data = date: U
        isLessThan.field = newUntil
        negate = 1
    }
    ...
    

    But beware… these properties are not available on any element type (USER_INT for example, does not have them).

    What I did to workaround that problem was to wrap the USER_INT in a COA as follows:

    config.enableMyStuff = 1
    page.20 = COA
    page.20 {
        10 =< plugin.tx_myextension_pi1
        if.value < config.enableMyStuff
        if.equals = 1
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible in some way to compare multiple variables to one constant in
Is it possible to compare variables of raw datatypes? I'm working with XMLDOM.DomNodes, which
Is it possible to compare whole memory regions in a single processor cycle? More
Using Django templates in Google App Engine (on Python), is it possible to compare
Possible Duplicate: Compare 2 dates with JavaScript I haven't done much JavaScript. I am
Possible Duplicate: Compare 2 dates with JavaScript Hi, I'm working on form validation for
Is it possible to compare touch coordinates made by the users on the UIView
Possible Duplicate: Is there a difference between NSString compare: and isEqual(ToString):? What is the
Possible Duplicate: How do you compare structs for equality in C? In a macro
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.