[TYPO3-english] TS Code Reuse

bernd wilke t3ng at bernd-wilke.net
Tue Apr 7 08:35:09 CEST 2015


Am 07.04.15 um 05:19 schrieb Scotty C:
> Bernd,
> I've applied your techniques (I think correctly?) and I'm getting a blank page.
 > Here's what I have, paraphrased - note that I need to replace a weird 
parameter, that is, $path:

after a lot of reformatting :(

> temp.Gallery = TEXT
 > temp.Gallery {
 >     wrap = <div class="gallery">|</div>
>     filelist = {$path}||name||0
>     split {
 >	  token = ,
 >	  cObjNum = 1
 >	      1 {
 >	          current = 1
 >	          wrap = |
 >	          filelink {
>                     path = {$path}
>                     icon = 1
>                     icon_image_ext_list = pdf,png,gif,jpg
 >                     iconCObject = IMAGE
 >                     iconCObject {
 >                         makeThumbs = 1
 >                         file {
>                             import = {$path}
>                             import.current = 1
 >                         }
 >                         # end file
 >                     wrap = |
 >                 }
 >                 # end CObject
 >             }
 >             # end filelink
 >         }
 >         # end 1
 >     }
 >     # end split
 > }
 > # end temp.kataloge

> page.19 = TEMPLATE
 > page.19 {
 >     template = FILE
 >     template.file = fileadmin/test/template.html
 >     workOnSubpart = DOCUMENT
>     marks.GALLERY < temp.Gallery
 >     marks.GALLERY.filelist = fileadmin/galleries/gallery1/||name||0
 >     marks.GALLERY.split.1.filelink.path = fileadmin/galleries/gallery1/
 >     marks.GALLERY.split.1.filelink.iconCObject.file.import = 
fileadmin/galleries/gallery1/
>     marks.GALLERY.append < temp.Gallery

here you do an append with the unusable temp-object

 >     marks.GALLERY.filelist = fileadmin/galleries/gallery2/||name||0
 >     marks.GALLERY.split.1.filelink.path = fileadmin/galleries/gallery2/
 >     marks.GALLERY.split.1.filelink.iconCObject.file.import = 
fileadmin/galleries/gallery2/

and here you redefine the pathes of the main object, leaving append 
structure unmodified

> }

this might be the better structure:

page.19 {
	marks.GALLERY = COA
	marks.GALLERY {
		10 < temp.Gallery
		10.filelist = {$path1}
		10.split.1.filelink {
			path = {$path1}
			iconObject.file.import = {$path1}
		}
		20 < temp.Gallery
		20.filelist = {$path2}
		20.split.1.filelink {
			path = {$path2}
			iconObject.file.import = {$path2}
		}
	}
}


for testing: just work with 10 until this part is working.
afterwards remove 10 (comments) and work only with 20.

blank page always means: PHP error without error output
switch to development mode and/or look into your error log file.

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list