No subject


Fri May 9 20:50:24 CEST 2008


will match numeric values, and globalString will match characters. So if =
you
wanted to match pages with title "hi", you would use globalString like =
this:

[globalString =3D TSFE:page|title =3D hi]

And you use global var to match numbers, like

[globalVar =3D TSFE:page|uid =3D 332]

So because TSFE:cObj|currentRecord prints "table:uid", I used =
globalString
because it includes the title of the table:

[globalString=3DTSFE:cObj|currentRecord=3Dtt_content:1316]
plugin.tt_news.templateFile=3Dfileadmin/Arts_Co-op/templates/news_templat=
es/ar
ts-co-op-headlines.tmpl
[global]

But I must be either doing something wrong because I can't get that to =
work
in a condition, or it just doesn't work in conditions. Works for just
grabbing the data though.

I also tried using .if**, but it doesn't seem like that works past just
rendering the object or not. So I could do:

dates.10.if=20
....

and decide whether to render the object "dates.10", but I can't do

dates.10.wrap.if=20
...

and determine whether or not to wrap it, so it doesn't look like that =
will
work for the template file / other plugin.tt_news setting, because it =
would
have to be

plugin.tt_news.templateFile.if
...


I'm now using an alternate approach I saw here:
http://www.typo3-jack.net/typo3-english-lists-netfielders-de/11808-typo3-=
how
-set-typoscript-specific-content-element.html

It works, but it means that all of the options (categories, number of =
items
to display, etc) for the object are set via typoscript, which is not =
ideal
because I won't be maintaining the site.=20


*
http://typo3.org/documentation/document-library/references/doc_core_tsref=
/4.
1.0/view/4/1/
**
http://typo3.org/documentation/document-library/references/doc_core_tsref=
/4.
1.0/view/5/7/ =20

=20

Message: 8
Date: Fri, 27 Jun 2008 13:14:14 +0100
From: Tyler Kraft <tyler.kraft at netefficiency.co.uk>
Subject: Re: [TYPO3] TS for specific [news, or other] content elements
To: typo3-english at lists.netfielders.de
Message-ID:
	<mailman.1.1214568993.5985.typo3-english at lists.netfielders.de>
Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed

Hi,

Prehaps I'm missing the idea here, but are globalVar and globalString=20
not two different things? And if you want to test for a specific news=20
record displaying  wouldn't you use tx_ttnews[tt_news]=3D401 and do=20
something like

[globalVar =3D GP:tt_news=3D401]
or
[globalVar =3D GP:tx_ttnews|tt_news=3D401]

What exactly are you trying to do? (you don't really explain that here)=20
Are you wanting to draw out one specific record and place it on one=20
specific page (with out it being in the BE page content)? Can you please =

give a better description of what you want to achieve

Tyler

Kathryn Blair wrote:
> Hi everyone,
>=20
> I want to be able to set separate TS for specific news content =
elements.
> I've seen some potential info inline for this, but not ones which made =
it
> clear to me how I could adapt them to what I wanted to do.=20
>=20
> What I REALLY want to do is use a condition to target a specific news
> elemenet based on its uid (in tt_content). I saw an example here:=20
>=20
>=20
> [globalVar =3D TSFE:tt_content|uid =3D 37]
> plugin.tt_news._LOCAL_LANG.de.preAuthor =3D Autor:
> [global]
>=20
> The reason this doesn't work (and should be taken off that site -- if =
I
can
> figure out an alternate method I'll replace it) is because =
[globalString =3D
> TSFE:fe_user|user|username =3D test] is not basing it's true/falseness =
on
the
> table fe_user, but the variables in the TSFE. I don't know a lot of =
PHP,
but
> I went on an odyssey trying to figure this out and this is what I've =
got:
>=20
> There is no tt_content variable for TSFE, but there is a cObj =
variable.
> (which I saw here:
>
http://www.typo3-unleashed.net/typo3apidocs/typo3api_4.0.0/html/d8/d11/cl=
ass
> _8tslib__fe_8php-source.html). cObj also has variables [sorry if my
> terminology is off], including $currentRecord, which "is set to the
> [table]:[uid] of the record delivered in the $data-array, if the =
cObjects
> CONTENT or RECORD is in operation. Note that
$GLOBALS['TSFE']->currentRecord
> is set to an equal value but always indicating the latest record
rendered."
>
(http://www.typo3-unleashed.net/typo3apidocs/typo3api_4.0.0/html/da/d2c/c=
las
> stslib__cObj-members.html). Yay, you would think this would solve all =
of
my
> problems!
>=20
> Well, this ts does render the table:uid (in this case, because I just =
put
> the typoscript in a template, that was pages:uid-of-current-page):
>=20
>     20 =3D TEXT
>     20.data =3D TSFE:cObj|currentRecord
>     20.wrap =3D TSFE=3D|<br />
>=20
> but I can't seem to write a condition based on this that is successful =
in
> targeting the specific content object. Here's what I'm trying:
>=20
> [globalString=3DTSFE:cObj|currentRecord=3Dtt_content:1316]
>
plugin.tt_news.templateFile=3Dfileadmin/Arts_Co-op/templates/news_templat=
es/ar
> ts-co-op-headlines.tmpl
> [global]
>=20
> I know that
>
plugin.tt_news.templateFile=3Dfileadmin/Arts_Co-op/templates/news_templat=
es/ar
> ts-co-op-headlines.tmpl is correct because I tried it with other
conditions
> (TSFE:id=3D321). I know I can set template files on the tt_news =
content
> element page itself, but the tt_news manual says that it's better to =
do so
> via ts, and I was hoping that doing it via TS I wouldn't have to erase =
and
> reset the template every time I update the file. Also, I might need to =
set
> some other ts this way, and it seems like a logical thing to want to =
do,
> from my perspective.=20
>=20
> I'm sure either I just don't fully grasp how currentRecord is supposed =
to
> work (which would make me sad, unless someone knows a different way to =
do
> this), or I'm just doing something incorrectly. If there's some =
massively
> easier way to do this, please let me know -- although like I said I =
didn't
> think (or understand how) the other solutions I'd seen would work for =
me.=20
>=20
> Here's the ts I'm using to grab the tt_news element and stick it in my
> template:
>=20
> dates.10=3DCONTENT
> dates.10.table =3D tt_content
> dates.10.select.pidInList=3D879
> dates.10.select.uidInList=3D1316
> dates.10.select.wrap =3D <div class=3D"important-dates-employers"> | =
</div>
>=20
> Thanks for any help in advance,
>=20
> Kath
>=20






More information about the TYPO3-english mailing list