Project

General

Profile

Actions

Feature #56134

closed

Conditions in page Constants

Added by Rafal Brzeski about 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-02-20
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

I have found a lack of functionality of Constants, when using it with conditions placed in Constants.
Let me explain in simple snippet,

Working example:

Page Setup:

config.baseURL = {$protocol}{$context.live}

[globalString = IENV:HTTP_HOST={$context.develop}]
  config.baseURL = {$protocol}{$context.develop}
[global]

Page Constants:

protocol = http://

context{
  live = somepage.X.com
  develop = somepage.Y.com
}

Above code works fine, but when we moves this code to the Constants you see a problem with {$context.develop} in the line with [globalString = ..]

Not working example:

Page Setup:

config.baseURL = {$baseURL}

Page Constants:

protocol = http://

context{
  live = somepage.X.com
  develop = somepage.Y.com
}

baseURL = {$protocol}{$context.live}

[globalString = IENV:HTTP_HOST = {$context.develop}]
  baseURL = {$protocol}{$context.develop}
[global]

So it seems that conditions i Constants need a small upgrade to full works.

Actions #1

Updated by Benni Mack about 9 years ago

  • Status changed from New to Closed

Hey Rafael,

although this is a nice use-case, this does not and will never work, as the parsing of the constants needs to happen before all values are done. The TypoScript parser works differently. Conditions within Constants only work without constants.

Actions

Also available in: Atom PDF