[TYPO3-english] typoscript: get rid of image reference number

Katja Lampela katja.lampela at lieska.net
Thu Nov 8 22:06:50 CET 2012


Hi Stephan,

And thank you for this very enlightning explanation!

My situation is a bit different from normal:
- for database output extension "browser"
- for upload of normal images "image_autoresize"
- for press folder security "naw_secured"

With this combination I try to achieve maximum easiness for the editor. She/he doesn't need to resize the images for normal/press use. Just upload them to proper folder and only the press images stay huge (BTW thank you Xavier P. for this great ext!). But then again, this press folder must be secured. And all the output is done with browser, wich doesn't quite comprehend every typoscript finesse For example IMAGE when there are multiple image fields.

So I try do the best with these means, but your post really gave me some ideas I will try, thank you!

With kind regards

Katja Lampela
*Lieska-tuotanto*
www.lieska.net


8.11.2012 22:39, Stephan Schuler kirjoitti:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hey Katja.
>
> I think you have a slightly corrupt configuration.
>
> If you're TCA is configured "type: group, internal_type: file", then you *must* stick to uploads/pics/* for both, the linked image and the displayed image.
> You described a problem when uplading an image with an existing name. But that's not the only critical situation. You can still select an image from your fileadmin (read: you already have an image, so you don't need to upload it). Then it gets copied from your fileadmin to uploads/pics, just like if you had it uploaded. If you try to delete it from your fileadmin afterwords, it gets really removed there but it still exists in uploads/pics.
>
> That's the way the file TCA stuff works: The fileadmin is designed to hold data for editors, but for frontend usage, you have to use uploads/pics copy. Ever.
>
> If you want to ensure not demage your output by reorganizing your fileadmin structure: Don't use the fileadmin path directly for frontend output. Always use the uploads/pics.
>
> But there's another option. The former "ever" was changed to "usually" a view versions ago :).
>
> Use "file_reference" instead of "file". Then no image gets copied to uploads/pics and you're free to use tie fileadmin original.
> The reason for this is large files. It's very storage consuming to have several copies of files with several megabytes each.
>
> When using type "file", the database record contains the file name of the image without any path prefix. That's perfectly fine because the upload dir is defined in your TCA.
> When using type "file_reference", then yout database record contains the complete relative path to your image.
>
> That's the way to go here: Avoid file and use file_reference instead.
>
> You can of course pass both types into gifbuilder for automated scaling if you want.
> Just remember to prepend the upload directory for type:file and not to prepend any directory when using type:file_referene.
>
> Regards,
>
>
>
> Stephan Schuler
> Web-Entwickler
>
> Telefon: +49 (911) 539909 - 0
> E-Mail: Stephan.Schuler at netlogix.de
> Website: media.netlogix.de
>
>
> - --
> netlogix GmbH & Co. KG
> IT-Services | IT-Training | Media
> Andernacher Stra?e 53 | 90411 N?rnberg
> Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
> E-Mail: info at netlogix.de | Internet: http://www.netlogix.de
>
> netlogix GmbH & Co. KG ist eingetragen am Amtsgericht N?rnberg (HRA 13338)
> Pers?nlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
> Umsatzsteuer-Identifikationsnummer: DE 233472254
> Gesch?ftsf?hrer: Stefan Buchta, Matthias Schmidt
>
>
>
> ________________________________________
> Von: typo3-english-bounces at lists.typo3.org [typo3-english-bounces at lists.typo3.org]" im Auftrag von "Jost Baron [Jost.Baron at gmx.de]
> Gesendet: Donnerstag, 8. November 2012 21:10
> An: typo3-english at lists.typo3.org
> Betreff: Re: [TYPO3-english] typoscript: get rid of image reference number
>
> Hi Katja,
>
> would it be possible to simply link to "uploads/pics/myimage.jpg"
> instead? As far as I know every image is copied to that folder and then
> used from there. The "_01" appended to the filename results from the
> need of unique filenames in that folder.
>
> Regards,
> Jost
>
> On 11/08/2012 09:03 PM, Katja Lampela wrote:
>> Hi,
>>
>> I have a typoscript situation where I need two different path links to
>> one uploaded image. Let me explain.
>>
>> The database has high resolution press images which I want to show with
>> typoscript as a small image (from uploads/myext/ folder) and as a
>> download link from the original fileadmin/highres folder.
>>
>> Basically I need something like:
>>
>> <a href="fileadmin/highres/myimage.jpg"><img
>> src="uploads/myext/myimage.jpg" />
>>
>> The "myimage.jpg" is uploaded in backend record. Problem arises when the
>> image is uploaded second time, then we have
>>
>> <a href="fileadmin/highres/myimage_01.jpg"><img
>> src="uploads/myext/myimage_01.jpg" />
>>
>> and of course there is no myimage_01.jpg in fileadmin/highres and the
>> link doesn't work anymore.
>>
>> So now I need a clever way to either crop the _number part from link or
>> force the image upload always keep the original name.
>>
>> Any ideas or is it even possible?
>>
>>
>>
>>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP Universal 3.2.1 (Build 4869)
> Charset: us-ascii
>
> wpUDBQFQnBi8pp0IwsibV8MBCOTUBACHo0U7OJIEwjdkxsnuZ9xM8RZn/l10qYbK
> Z4882gPGoDV758yonBQbmHD/6F+KmeprcbeFV7kqdKN2SnMGwmcXUTim7V/5T/e0
> TRzVylEbBnPbveLZmTaNA3okDBJMI1dsw//a/+ncL/J4bFo2IZBSKt3LQ9n7KFK1
> Wk2mnfd4tw==
> =MSZP
> -----END PGP SIGNATURE-----
>


More information about the TYPO3-english mailing list