Sunday 15 February 2015

Set TYPO3 extbase storagePageIds / storagePid to current -


I'm using the TYPO3 extension feupload, which depends on the extbase. This is my first contact with extbase but the question is about expansion in general.

I hope Typo 3 is expected to include the usual "IN (current page)" PID check by default in queries, unless otherwise called - but in that extb Which appears to be different. Or at least in my case, it is not working.

In detail, there is a static / setup setting, where Storage Pid can be set. This work But we do not want to manually optimize that parameter for every page.

  Persistence {# cat = feupload / persistence; Type = integer; Label = storage storage PID repository PID =}   

How do I get the current page's PID automatically as expected?

(The sub-question: I've tried to set up the plugin. TX_pluginname.persistence.storagePid.data = {Page: UID} is in setup, but that will not work. ?

Well, you should work, but You must type it in this way:

  plugin.tx_pluginname.persistence.storagePid.data = Page: UID   

({} is only necessary when you have a Enter the data field in the normal wrap)

As other people say Or, you have that will make sure to include the configuration of the extensions in your template.

If the above fails, you can programmatically set the storage pad in the initial action of your controller, such as:

  $ query settings = $ this-> MyRepository- & gt; CreateQuery () - & gt; GetQuerySettings (); $ QuerySettings- & gt; SetStoragePageIds (array ($ global ["TSFE"] -> ID); $ This- & gt; MyRepository- & gt; SetDefaultQuerySettings ($ querySettings);    

No comments:

Post a Comment