[TYPO3-english] typoscript image from parent page

bernd wilke t3ng at bernd-wilke.net
Fri Oct 5 11:31:34 CEST 2012


Am 05.10.2012 10:55, schrieb Rimbu Mircea:
> thank you Bernd
>
> I try your suggestion and I can grab the image but I don't know
> how to replace the image in the record with this image .
> I already have a lot of text with images in my pages and I try
> to change the image only in the topbox record (text w image type)
> and I don't know how to change this specific image with typoscript.
> Something like this :
> if header of record is topbox -> change image with one from the parent
> resource/media field.

if you try to configure this mixage of usage you have to build very 
complex typoscript (I will not say 'it is impossible' as until now 
everything was possible in typoscript, but sometimes (like this) very 
complex)
the easier way would be to change the page build complete to one source.
my recommendation: 'move' all your images into page-data. (= remove all 
your images from content elements (topbox records), insert images into 
page properties where these records were in)

if you have hundreds of pages you may use a script (PHP?) which handles 
this SQL for you

SELECT * FROM tt_content WHERE title = 'topbox'
while row=sql_fetch()
	UPDATE pages SET media=row[image] WHERE uid = row[pid]
	UPDATE tt_content SET image='' WHERE uid = row[uid]
endwhile

as far as I see you have a design-failure in your data:
the images of the pages are stored in the text-CEs of the pages
either these images belong into the page properies or are stored in 
their own column (as simple image CEs)

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


More information about the TYPO3-english mailing list