Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypoScript: get page title by page id

Task1. In TypoScript I need to get a page title for a given page id {$my_page_uid} Task2. This page title should be recieved according to the current language

I need this title in the form like temp.pTitle, so I can make then page.10 < temp.pTitle

like image 280
Andriy Avatar asked Jul 07 '11 08:07

Andriy


3 Answers

At a first glance I thought: Haha! That's trivial... but actually it's not. Here is a clever solution for the first part I found in a german forum:

temp.pTitle = HMENU
temp.pTitle {
  special = list
  special.value = {$my_page_uid}
  1 = TMENU
  1 {
    NO {
      doNotLinkIt = 1
    }
  }
}

Don't know if this solves the language part, but it should.

like image 195
Mateng Avatar answered Dec 31 '22 10:12

Mateng


lib.pagetitle = RECORDS
lib.pagetitle {
  source.data = page:uid
tables = pages
conf.pages = TEXT
conf.pages.field = nav_title
}

To get current page title:

lib.pagetitle = TEXT
lib.pagetitle.field=title
like image 40
Sivakumar Avatar answered Dec 31 '22 11:12

Sivakumar


temp.pTitle = TEXT
temp.pTitle.data = DB:pages:{$my_page_uid}:title
like image 40
xian Avatar answered Dec 31 '22 11:12

xian