Skip to main content

Author Topic: Page Titles & Categories

  • *****
  • Administrator
  • Full Member
  • Posts: 230
    • XT CMS
Page Titles & Categories
OP: February 24, 2023, 03:29:32 PM
When it comes to page titles and categories the CMS has always fully populated the page title for each category with the category name. This makes things simple and straightforward for site admins when setting up categories because often it is both the desired effect and also a convenience to set one name/page title.

In the back-end however it is quicker and easier to pick out category names when they have a shorter more concise name than you might want for your page title. For example in the back-end you might want to see category names such as "Home" or "About"  but on the front-end more descriptive page titles such as "MySite - Home" or "About My Business in My Location" are usually preferred and better for visitors and SEO.

So can we improve this? And what would we like to achieve?
In summary we ideally we want to be able to set and glance through concise category names quickly in the back-end whilst allowing for more descriptive page titles on the front-end for our visitors and for SEO.

Below I have outlined some possible approaches we might take to address this:

Option 1
Add a new field when adding or editing a category in the admin area perhaps called "Page Title".

Pros: easily edit category name and page title independently in the admin area
Cons: adds an extra field to the UI (possible end-user confusion with fields for title and name)

Considerations: if page title is left blank it could fall back to using the category name as it does currently so it would not be required to fill in. May or may not need to be implemented for products and articles too, noting however it is mostly a category issue.

Option 2
Allow use of template tags in the title tags of the page template eg. <title>MySite - {cms-page-title}</title>.  Currently the CMS strips any existing title tag from the page template and replaces it with fully dynamically generated titles.

Pros: allows an interesting blend of static (set by theme designer) and dynamic page titles
Cons: dynamic customisation of page titles would be limited, ie. the static part wouldn't change.

Considerations:  page templates can be used by many various pages that the CMS delivers so this option seems too limiting always having the same static part in the title of various pages. However you could change the static part on different templates. When no tag is present in title it could fall back to fully replacing title with category name as it does currently so tag would not be required. Or should it keep the static page title if no tag present? Too many extra considerations for theme designer and limits for admins?

Option 3
Allow page title to be changed at the code level through content template files etc. This is already possible to some extent by editing $page->title (used in page content headings) and $page->meta_title (used in the <title> meta tag) although it is hard to set this for categories in particular.

Pros: allows for a lot of flexibility
Cons: not easy to edit page titles, matching to various category, product, article id's is more custom coding

Considerations: this seems less favourable than changing page titles in the admin area although it is always an additional flexibility option, either way should look into improving/making easier.

All-in-all this is a somewhat minor problem which is why I have thus far opted to leave it as-is rather than add extra fields or change the behaviour although it is also something I would like to improve if possible.
  • IP logged
« Last Edit: February 24, 2023, 03:52:59 PM by xtom »

  • *
  • Newbie
  • Posts: 1
Page Titles & Categories
#1: February 24, 2023, 04:07:49 PM
I think Option 1 is very straight forward. A separate Page Title field is, IMHO, clear and easy to use. It could be even better if the field were "variable sensitive", meaning that we for example could use the Website Name like for example "{cms-website-name}" from the CMS Settings, like the attached image.

The Page title could thus be "{cms-website-name} - Home" for the Home category
  • IP logged