[TYPO3-content-rendering] [Typo3-dev] Less features, more future
Ernesto Baschny [cron IT]
ernst at cron-it.de
Fri Oct 14 12:58:10 CEST 2005
JoH schrieb am 14.10.2005 12:40:
>>><div class="single_imagecontainer" id="tt_content_123_1_1">
>>><div class="single_imagecontainer" id="tt_content_124_1_2">
>>><div class="single_imagecontainer" id="tt_content_125_1_3">
>>><div class="single_imagecontainer" id="tt_content_125_2_4">
>>><div class="single_imagecontainer" id="tt_content_123_1_5">
>>How to assure this, when dealing with different content elments,
>>different extensions maybe?
> First case: Different content elements
> Look at the above example.
> You have 3 different content elements. One of them is used twice another one
> contains two images.
> Since we are using a counter for each element that is getting a dynamic id
> this seems to be no problem.
Why don't we then just use a single random unique ID, if there is no
real way to predict which id an element will get? This way we don't need
any counter. We already have a function to generate such unique-ids for
a certain page, its called: $TSFE->uniqueHash().
> Second case: different extensions
> If the extension author wants to create dynamic CSS entries to the same
> file, he simply has to use the same counter.
> So we could get things like:
>
> <div class="single_imagecontainer" id="tt_content_123_1_1">
> <div class="news_singleView_imagecontainer" id="tt_news_456_1_2">
> <div class="single_imagecontainer" id="tt_content_124_1_3">
> <div class="myextension_whatever_imagecontainer"
> id="myextension_whatever_789_1_4">
> <div class="single_imagecontainer" id="tt_content_125_2_5">
> <div class="single_imagecontainer" id="tt_content_123_1_6">
An extention author could use the uniqueHash() function, place the "id"
on the needed tag and then add the "dynamic" css style to the page
($TSFE->setCSS). This can already be done, not?
The only missing part would be to have setCSS respect
inlineStyle2TempFile so that this would get to an external temporary
.css file.
> The only thing that has to be done is to provide this counter as a register
> with autoincrement on a per page base.
> To enable/disable this behaviour for elements, we could use a TypoScript
> parameter like
>
> dynamicCSS_entry = 1
> dynamicCSS_entry.prefix = myprefix
>
> This will trigger a function that increments the counter, gets the
> tablename, some additional prefix and the uid.
> Then it creates a string with some underlines and assigns this as the id of
> the element.
It looks like this is something the extention should be doing. Or do you
need any change to the TYPO3-core for this to work?
Cheers,
Ernesto
More information about the TYPO3-project-content-rendering
mailing list