Russian TYPO3 community

Russian TYPO3 community (http://forum.typo3.ru/index.php)
-   Общие вопросы (http://forum.typo3.ru/forumdisplay.php?f=12)
-   -   Составной Title на страницах (http://forum.typo3.ru/showthread.php?t=1843)

maaboo 15.08.2008 17:39

Я вот пробовал так:

Код:

page.headerData.20 = TEXT
page.headerData.20.field = subtitle
page.headerData.20.wrap = <title>Имя сайта : |</title>
config.noPageTitle = 1

У меня "как бы работает, то есть выдаёт

Имя сайта: Имя страницы

но когда переходишь на подстраницу, выдаёт

Имя сайта: Имя подстраницы

а хочется

Имя сайта: Имя страницы : Имя подстраницы

Что надо добавить?

-=UncleByte=- 15.08.2008 17:46

Не оно? http://www.typo3wizard.com/en/snippe...le.html?jaja=1

maaboo 15.08.2008 18:02

Оно-то оно, только вот не выводит от в формате:

Имя сайта: Имя страницы : Имя подстраницы

-=UncleByte=- 15.08.2008 18:28

http://www.typo3wizard.com/en/snippe...ent-level.html

maaboo 15.08.2008 19:06

Что-то не вьезжаю как это склеить воедино...

maaboo 17.08.2008 21:28

Итак, решение:
для
Имя сайта : Страница 1 : Страница 2

1. В Странице 2 пишем Subtitle с именем Страница 1.
2. Вставляем следующий код:
Код:

page.headerData.20 = TEXT
page.headerData.20.value = Имя сайта
page.headerData.20.wrap = <title> |
page.headerData.30 = TEXT
page.headerData.30.field = subtitle
page.headerData.30.wrap = &nbsp;:&nbsp;|&nbsp;:&nbsp;
page.headerData.30.if.isTrue.field = subtitle
page.headerData.40 = TEXT
page.headerData.40.field = title
page.headerData.50 = TEXT
page.headerData.50.value = </title>

Это разумеется, если page.headerData.20,30,40 и 50 не заняты уже. :-)

dmartynenko 19.08.2008 23:04

Можно сделать так, что бы не думать что там занято а что нет.

page.headerData.20 = COA
page.headerData.20.10 = TEXT
page.headerData.20.10.value = Имя сайта
...
и т.д.

Но это в целом подход не правильный - "В Странице 2 пишем Subtitle с именем Страница 1" - это ж надо помнить что нужно название продублировать, да и работа лишняя для редакторов!

Вам же посоветовали выше такой вариант (по ссылке):

page.10.subparts.TITLE = TEXT
page.10.subparts.TITLE.data = leveltitle:0

Т.е. способ взять title из предыдущего уровня страниц в дереве.

maaboo 20.08.2008 13:25

И как это в конечном виде будет выглядеть? Что-то заменил я всю конструкцию на эти две строчки, поставил - отображает только текущую, причём смена цифры - не влияет...

dmartynenko 20.08.2008 19:11

Может быть эта информация будет полезной для решения вопроса:

http://typo3.org/documentation/docum....1.0/view/2/2/

Цитата:

getText - get content from the $cObj->data-array[header]. This returns a value from somewhere in PHP-array, defined by the type. The syntax is "type : pointer".

leveltitle, leveluid, levelmedia: [levelTitle, uid or media in rootLine, 0- , negative = from behind, ” , slide” parameter forces a walk to the bottom of the rootline until there's a ”true” value to return. Useful with levelmedia.]

levelfield: Like ”leveltitle” et al. but where the second parameter is the rootLine field you want to fetch. Syntax: [pointer, integer], [fieldname], [”slide”]

get the title of the page on the first level of the rootline:

= leveltitle : 1

get the title of the page on the level right below the current page AND if that is not present, walt to the bottom of the rootline until there's a title:

= leveltitle : -2 , slide

get the id of the root-page of the website (level zero)

= leveluid : 0

Gets the value of the user defined field ”user_myExtField” in the root line (requires additional config in TYPO3_CONF_VARS to include field!)

= levelfield : -1 , user_myExtField , slide
Еще там же второй способ:

Цитата:

Gets the title of the page right before the start of the current website:

= fullRootLine : -1, title

fullRootLine : This gets the title ”1. page before” in a page tree like the one below provided we are are the page ”Here you are!” (or ”Site root”) and this TypoScript is in the template with root at ”Site root”. Red numbers indicate what values of keynumber would point to:

- Page tree root -2

|- 1. page before -1

|- Site root (root template here!) 0

|- Here you are! 1

fullRootLine :

Getting a value from the rootline (TSFE->rootLine) going all the way to the root of the page tree.

[keynumber, fieldname, ”slide”]

Keynumber is relative to the current site root, so negative numbers refer to subsequent levels below the site root. Fieldname is the name of the datafield to get. For ”slide”, see levelmedia type above.
Для этой же цели можно использовать меню с .special = rootline.
Но по производительности последний способ будет явно хуже.

alexk 03.09.2010 05:51

Можно ещё вот так сделать:
Код:

config.noPageTitle = 1
page.headerData.20 = COA
page.headerData.20.wrap =  <title>|</title>
page.headerData.20 {
10 = HMENU
10 {
        special = rootline
        special.range =0|-1
        1 = TMENU
        1 {
                NO.linkWrap =  ||:&nbsp; |*| &nbsp;-&nbsp;
                NO.ATagTitle.field = title // subtitle // nav_title
                NO.doNotLinkIt = 1
        }
}       
}



Часовой пояс GMT +4, время: 20:56.

Работает на vBulletin® версия 3.8.1.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot