Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tt_address item from globalVar is not working within userFunc #120

Closed
RonMen opened this issue Dec 7, 2018 · 6 comments
Closed

tt_address item from globalVar is not working within userFunc #120

RonMen opened this issue Dec 7, 2018 · 6 comments

Comments

@RonMen
Copy link

RonMen commented Dec 7, 2018

Hi there,
I wrote a Typoscript 'lib' to get a single tt_address record from a GET parameter, but it only shows the GET as a string representation in userFunc settings.

lib.mycontenelement = USER
lib.mycontenelement {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = TtAddress
    pluginName = ListView
    vendorName = FriendsOfTYPO3
    controller = Address

    ## settings, get them from GET parameters
    settings < plugin.tx_ttaddress.settings
    settings {
        singleRecords = GP:tx_myExtension|myparam
        displayMode = 100

    }

    ## wrap out content
    stdWrap {
        wrap = |
    }
}

Current Behavior
Output of the settings in f:debug seems to be wrong:

settings => array(5 items)
      ...
      singleRecords => 'GP:tx_myExtension|myparam' (25 chars)
      ...

Expected behavior/output
The Output of other settings in f:debug seems right:

settings => array(5 items)
          ...
          singleRecords => '1' (1 chars)
          ...

Environment

  • TYPO3 version: 9.5.1
  • tt_address version: 4.0.0 (download 2018-12-07)
  • Is your TYPO3 installation set up with Composer (Composer Mode): no

Is this a bug or something wrong in my Typoscript lib code? Any suggestions?

Regards
R.

@georgringer
Copy link
Contributor

extbase does not know the concept of stdWrap to resolve something like GP:....
As a feature we could build something in like in EXT:news to have stdwrap available but this won't be in version 4.0.0

@georgringer georgringer added this to the 4.x.0 milestone Dec 7, 2018
@RonMen
Copy link
Author

RonMen commented Dec 8, 2018

Hey Georg.

We have another sample source code working well, but the data comes from tt_address constants file:

lib.mycontenelement = USER
lib.mycontenelement {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = TtAddress
    pluginName = ListView
    vendorName = FriendsOfTYPO3
    controller = Address

    ## settings, get them from plugin
    settings < plugin.tx_ttaddress.settings
    settings {
        singleRecords = {$plugin.tx_ttaddress_pi1.uid_defaultcontact}
        displayMode = 100

    }

    ## wrap out content
    stdWrap {
        wrap = |
    }
}

All is running fine within this sample, the output of settings looks like the expected behaviour in the sample above since {$plugin.tx_ttaddress_pi1.uid_defaultcontact} is defined as 1.

Regards
R.

@georgringer
Copy link
Contributor

Yes this works because constants are replaced a lot earlier, this is not done by stdwrap

@RonMen
Copy link
Author

RonMen commented Dec 8, 2018

Hey Georg.

Thanks for your comment. You mentioned EXT:News. Can you point out how EXT:News ist doing it to solve this. Maybe we can support to make it working. At the moment we do not were to begin.

Regards
R.

@georgringer
Copy link
Contributor

@georgringer
Copy link
Contributor

closing this in favor of #130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants