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

Stephan Schuler Stephan.Schuler at netlogix.de
Thu Nov 8 21:39:50 CET 2012


-----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