Jump to content

Page title is empty, how to get page title (not meta title)?


Greg1234

Recommended Posts

I believe this is a bug, during editing CMS page, there is field "title" and it's described that it should display in template h1

image.png.2b3756c0b4727aeeaf4455fc8ba1dff3.png

But not only the classic template uses meta title instead of this, but also the "title" in $page variable in .tpl is empty:

image.png.875dd30bf9a563f86d031b8b424294f1.png

image.png.f146fcd2443dfeb95ca62cbf63d984dd.png

 

I think some developer who made it doesn't get the difference between meta title, and page title. These are two separate things, used for totally different purposes. Does someone know, how can I get the page title (not meta title) in the tpl, using some built in mechanism? I know I can query the database, but this is very basic thing and I am sure there has to be some prepared way to do it.

image.png

image.png

image.png

Link to comment
Share on other sites

If anyone else had problems with it:

It turns out, that to get page title (not page meta title) you have to use $cms.meta_title, and to get page meta title you have to use $page.meta.title.

This is not only confusing, but just incorrect. Meta title is not equal title, but they are used interchangeably in the code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...