CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Suggestion #37069

Set startingpoint to current page via typoscript

Added by Dmitri Pisarev about 1 year ago. Updated 6 months ago.

Status:Resolved Start date:2012-05-10
Priority:Should have Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
TYPO3 Version:4.7 Has patch:No
PHP Version:
Votes: 0

Description

Hey! Sorry for creating so many suggestions, tell me when I should stop :)

I need the ability to display news from current page only. In tt_news it would be pid_list.field = uid, but now the startingpoint isn't parsed as TypoScript (thus no stdWrap).

A couple of ways to solve it:
  • Pass settings.storagepid through stdWrap Typoscript parser.
  • Implement a settings, let's say storagepid=current and then set storagepid from php. A bit less functional, as with stdWrap there are much more options of how to do it, and requires less documentation.
  • ...
    What do you say?
    I can provide a patch for both of the cases.

And I have a more general question: is EXT:news supposed to be configured from TS (without using flexform) at all? In my case a website has hundreds of pages, where on every page I need to display news from this current page. How else would I do it if now via TS?

PS: is it OK to create such issues here or should I first write to some mailing list? If so then to which?


Related issues

related to Extension news - Bug #38006: Nested settings broken by #37069 Resolved 2012-06-13

Associated revisions

Revision ab7a77a5
Added by Georg Ringer about 1 year ago

[FEATURE] Use stdWrap for properties

Make it possible to use stdWrap to manipulate
properties.

Add the settings you wanna manipulate to
settings.useStdWrap =

Example usage:
settings.useStdWrap = startingpoint
settings {
startingpoint = 123 # this would be the current page then ...
startingpoint.override.field = pid
}

Change-Id: I36d0dabaaa5a280c0de5fcbaac6c2e6178df3928
Resolves: #37069

History

Updated by Dmitri Pisarev about 1 year ago

Here's a draft code for the first option:

public function initializeAction() {
        $typoScriptService = $this->objectManager->get('Tx_Extbase_Service_TypoScriptService');
        $settingsAsTypoScriptArray = $typoScriptService->convertPlainArrayToTypoScriptArray($this->settings);
        $this->settings['startingpoint'] = $this->configurationManager->getContentObject()->stdWrap($settingsAsTypoScriptArray['startingpoint'], $settingsAsTypoScriptArray['startingpoint.']);
[...]

It would not hurt to parse some other settings via stdWrap as well. Let's make EXT:News not so ignorant of TypoScript!

Updated by Gerrit Code Review about 1 year ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11744

Updated by Georg Ringer about 1 year ago

wanna test the proposed change? all details in the commit msg

thanks!

Updated by Georg Ringer about 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Updated by Dmitri Pisarev about 1 year ago

  • Status changed from Resolved to New

There's a bug in proposed patch, which at first I missed. How do I provide a fixed patch? When I try to push to gerrit, it says that the issue is already closed. Should I start a new bug-report issue?

Updated by Georg Ringer about 1 year ago

yeah new issue please

Updated by Steffen Müller about 1 year ago

What' wrong with:

plugin.tx_news.persistence.storagePid {
cObject = TEXT
cObject.field = pid
}

Updated by Georg Ringer 6 months ago

  • Status changed from New to Resolved

Also available in: Atom PDF