[TYPO3-english] How to exclude some pages in PIDinRootline?
Ugur Kocak
drugurkocak at gmail.com
Tue Nov 13 04:22:24 CET 2012
Hi Stefan,
Thank you very much for your explanation.
I have read related documents and tested your examples.
My observations;
The PIDinRootline permits != in NO way, and the code breaks. But the globalVar permits !=
So, I tried other possibilities :) and found a way.
My aim is to generate Facebook Opengraph metatags using titles and text from content elements. Also some for tt_news elements. I also have a DAM gallery, and I have to exclude it in every condition.
So, I decided to try in two steps;
At first step, I excluded the gallery and news pages in that way; (pid:8 = tt_news list view, pid: 29 = tt_news single view, pid:47 = DAM gallery)
> [globalVar = TSFE:id != 8] && [globalVar = TSFE:id != 29] && [globalVar = TSFE:id != 47]
> #Default Description:
> page.meta{
> description.field = description
> }
> #And the CE header as og:title:
> temp.openGraphHeader = COA
> temp.openGraphHeader {
> 10=CONTENT
> 10.table= tt_content
> 10.select {
> selectFields = header
> }
> 10.renderObj =COA
> 10.renderObj {
> 10=TEXT
> 10 {
> field = header
> stripHtml=1
> crop = 1200 | ... | 1
> }
> wrap = <meta property="og:title" content="|" />
> }
> }
.......
.......
> [global]
and then, I run the Typoscript to generate OG tags for single view of tt_news.
> [globalVar = TSFE: id=29]
> temp.newsTitle = COA
> temp.newsTitle.10 = RECORDS
> temp.newsTitle.10 {
> dontCheckPid = 1
> tables = tt_news
> source.data = GP:tx_ttnews|tt_news
> conf.tt_news = TEXT
> conf.tt_news.field = title
> conf.tt_news.stdWrap.stripHtml=1
> wrap = <meta property="og:title" content="|" />
> }
> page.headerData.39 < temp.newsTitle
.....
.....
......
> [global]
Even, [condition] >>some code [else]>>some code [end] didn't solve my problem because of the third element. Your idea showed me the light.
Kind Regards,
Ugur
On Nov 12, 2012, at 10:45 AM, Stefan Reichelt <eichelt at web.de> wrote:
> Hello Ugur,
>
> I think there was a specific way to exclude PIDs, but I can't remember it..
> Anyway, this might work:
> --
> yourobject{
> # Current page id as the value to check
> if.value.data = page:uid
> # List of page ids the above one will be checked against
> if.isInList = x,y
> # Negating the result, so if the page id is in the specified list, it returns false
> if.negate = 1
> }
> --
> Not sure if the syntax/idea is completely valid though, you might need to do some testing there...
> More about if [1].
>
> Another way with conditions:
> --
> # The first = is always part of the condition, if no operator is given, equal is used. A comma means OR.
> [PIDinRootline = x,y]
> # PID is either X OR Y, do nothing
> [ELSE]
> # PID is not X AND not Y, do your thing here
> [GLOBAL]
> --
>
> Some of the conditions (fe. hour) also allow != operator, but I'm not sure if PIDinRootline does. If it does,
> the syntax would look like this (I think):
> --
> [PIDinRootline = != x] && [PIDinRootline = != y]
> # do you thing
> [GLOBAL]
> --
> Not sure if that might work at all though and it isn't really pretty anyway. More about Conditions [2].
>
> Hope that could help you.
>
> Kind regards
> Stefan
>
> [1] http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.7.0/view/1/5/#id553579
> [2] http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.7.0/view/1/4/
>
> On 12/11/2012 03:13, Ugur Kocak wrote:
>> Hi again,
>>
>> I need to run some Typoscript code except certain pages. I mean I need to exclude some pages. Example code;
>>
>>> #Default Description:
>>> page.meta{
>>> description.field = description
>>> }
>>> #Description if Default Description is empty:
>>> page.meta.description.ifEmpty.stdWrap.cObject = CONTENT
>>> page.meta.description.ifEmpty.stdWrap.cObject {
>>> table= tt_content
>>> select {
>>> selectFields = bodytext
>>> }
>>> renderObj =COA
>>> renderObj {
>>> 10=TEXT
>>> 10 {
>>> field = bodytext
>>> stripHtml=1
>>> crop = 1200 | ... | 1
>>> }
>>> }
>>> }
>>
>> I know that I can run certain code on a specific page via
>> [PIDinRootline = x,y]
>> #put the TS here
>> [end]
>> But, I couldn't find any document explaining how to exclude certain pages (like pages for tt_news).
>> Although globalVar permits usage of != operator, PIDinRootline doesn't I think. I tried that one but failed:
>> [PIDinRootline != x,y]
>>
>> I will be happy if one gives me advice. Is there a way to exclude certain pages?
>>
>> I am sorry if I am asking dummy questions, but as you may expect :)
>> Kind Regards,
>> Ugur
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>>
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list