[TYPO3-english] Change data structure and template recursively

David Bruchmann typo3-en at bruchmann-web.de
Wed Jun 10 10:55:55 CEST 2009

----- Ursprüngliche Nachricht -----
Von:        Tommy Bergeron <t.bergeron at gmail.com>
Gesendet:   Dienstag, 9. Juni 2009 17:11:49
An:         typo3-english at lists.netfielders.de
Betreff:    Re: [TYPO3-english] Change data structure and template 

> I'm talking about 100 pages to be kept, and about 150 to be changed.

Hy Toomy,

you can do it as follows:

1) Create a template somewhere in your pagetree, perhaps you have a 
special folder for templates.
2) Copy the code I'll insert below into the setup-field, replace 
'********* HERE YOU ADD THE uid OF THE CURRENT PAGE ***********' as 
described, save and close.

------ Code Start --------

temp.pageUids = COA
temp.pageUids {
     alluids.cObject = CONTENT
     alluids.cObject {
       select.pidInList = ********* HERE YOU ADD THE uid OF THE CURRENT 
PAGE ***********
        select.recursive = 1
#      select.where =  colPos=0
       renderObj = TEXT
       renderObj.field = uid
       renderObj.wrap = |,
   20 = TEXT
   20.data = register:alluids

page.800 < temp.pageUids

------ Code END --------

3) Open the template in pageroot and add this template in the field 
"Include basis template".
4) Open the Frontend-page. In the bottom of the page a commaseparated 
list with numbers will be shown. These Numbers are the uids of all pages 
in the tree. Control if its right and if no other pages are referenced 
in this list. Copy this list to a texteditor, add the uid of the current 
page also commaseparated. If needed you can change the uid in 
"select.pidInList" as long as required, its also possible to add all 
uids commaseparated as list at once.
5) When your list is finished: open phpmyadmin, choose the right 
database and the table pages, click on "SQL".
6) Add the following line and replace the marker through your list of 

UPDATE pages  SET `tx_templavoila_ds`='', `tx_templavoila_to`='', 
`tx_templavoila_next_ds`='', `tx_templavoila_next_to`='', 
`tx_templavoila_flex`=''WHERE FIND_IN_SET(uid,###YOUR_UID_LIST_HERE###)

That's it.

Best Regards

More information about the TYPO3-english mailing list