[TYPO3-mvc] ExtBase Ext without own tables, just using other tables (pages)

Stephen Bungert stephenbungert at yahoo.de
Sat Oct 22 13:05:06 CEST 2011


Thanks for the reply.

What TS am I missing exactly?

I have the book about developing extensions with extbase and fluid, but it 
just says when using other tables as datasources that you just need to add 
to the mapping array

in persistence.classes

In the book, there is an example about using tt_address.

I just changed a few things so that it worked with pages.

I have the pages model Tx_Nextprev_Domain_Model_Pages that has getters and 
setters for all the columns that I mapped.

Isn't the storage pid just the pid field? Pages have them too I believe.

"Henjo Hoeksma" <me at henjohoeksma.nl> schrieb im Newsbeitrag 
news:mailman.1.1319278274.15326.typo3-project-typo3v4mvc at lists.typo3.org...
> Hi Stephen,
>
> building extensions with falling back to existing ones is perfectly 
> possible. Search the list for Single Table Inheritance.
>
> In your case you seem to be missing the TS Setup that tells extbase where 
> to find the repository.
>
> However, you will face a different problem: Pages are no records connected 
> to a storage pid. You will have to work around that too.
>
> Not sure if it will result in a workable solution, but it's always worth 
> trying.
>
> Good luck,
>
> Henjo
>
> On 2011-10-21 20:43:55 +0000, Stephen Bungert said:
>
>> Hello,
>>
>> I want to make an extension that outputs information from the pages 
>> table. It doesn't need it's own tables.
>>
>> I have a view that works, but doesn't have anything to display at the 
>> moment.
>>
>> I then setup the mapping for the pages table:
>>
>> plugin.tx_nextprev {
>>  view {
>>   templateRootPath = {$plugin.tx_nextprev.view.templateRootPath}
>>   partialRootPath = {$plugin.tx_nextprev.view.partialRootPath}
>>   layoutRootPath = {$plugin.tx_nextprev.view.layoutRootPath}
>>  }
>>
>>  persistence {
>>   storagePid = {$plugin.tx_nextprev.persistence.storagePid}
>>
>>   classes {
>>    Tx_Nextprev_Domain_Model_Pages {
>>     mapping {
>>      tableName = pages
>>      recordType = Tx_Nextprev_Domain_Model_Pages
>>      columns {
>>       uid.mapOnProperty = id
>>       title.mapOnProperty = title
>>       doktype.mapOnProperty = type
>>       hidden.mapOnProperty = hidden
>>       deleted.mapOnProperty = deleted
>>       nav_hide.mapOnProperty = notInMenu
>>      }
>>     }
>>    }
>>   }
>>  }
>>
>>  settings {
>>   rootPage {
>>    # Starting page (which page to collect page uids from)
>>    uid = 3
>>
>>    # Should the root page be included in the next/prev chain?
>>    include = 0
>>   }
>>
>>   pages {
>>    # Include shortcut pages
>>    shortcut = 1
>>
>>    # Include notInMenu pages
>>    notInMenu = 1
>>
>>    # Page UIDs to exclude
>>    #excludedUids =
>>   }
>>  }
>> }
>>
>>
>> Here is my action function:
>>
>>
>>
>>  /**
>>   * action buttons
>>   *
>>   * @return void
>>   */
>>  public function buttonsAction() {
>>   $pages = $this->buttonsRepository->findAll();
>>   #t3lib_div::debug($pages, 1);
>>   $this->view->assign('pages', $pages);
>>   $this->view->assign('settings', $this->settings);
>>  }
>>
>> If I leave it as it is the page is generated and fluid shows a message, 
>> like it should. No errors are displayed so i assume findAll() actually 
>> found what it needs to.
>>
>> If I uncomment the debug, the page timesout and is all white.
>>
>> My PHP error log shows a bytes exhausted error in 
>> C:\\xampp\\htdocs\\stephen\\typo3\\4.6\\t3lib\\utility\\class.t3lib_utility_debug.php 
>> on line 154
>>
>> I don't think that findAll is finding pages like I thought it would.
>>
>> Other extbase extensions that I have played around making worked, but 
>> they had their own tables.
>>
>> How can I see what findAll is doing? Can I make an extension that doesn't 
>> have it's own tables? I'm not sure if I have cretaed all the required 
>> files, a lot of the view templates and controllers and things I created 
>> myself based on other extbase extensions that I created as the extension 
>> builder only seems to create these things when you create tables.
>>
>> Stephen.
>
> 



More information about the TYPO3-project-typo3v4mvc mailing list