Forums / Cotonti / Core Labs / Archive / Proposed TITLE / META generation

Lombi
#1 2008-08-03 21:24
------------------------ TITLES -----------------------------------

This is the proposed generation of titles. All the proposed values would be defaults in your installation and you would be able to change each via a config like this:

"{PAGETITLE} -=- {PAGECAT} -=- {SITENAME}" (without quotes)

Basically you could reorder them how you would want, but the defaults would be the best SEO wise. This is based on the idea that the user coming from the search engines is not looking for you but for what you have to offer on the site (if he was searching for you he would have typed in your domain name).

PAGES

{PAGETITLE} - {CATEGORY} | {SITENAME}
{PAGETITLE}, {PAGE} - {CATEGORY} | {SITENAME}

LISTS

<custom text> {CATEGORY}, {PAGE} | {SITENAME}

(example: "Best recipes for {CATEGORY}, Download drivers for {CATEGORY}")

FORUMS

{TOPIC}, {PAGE} - {SECTION} | {SITENAME}
{SECTION}, {PAGE} | {SITENAME}

EXTRA / CUSTOM URL TITLES

You would be able to input a list of URLs into a textarea and custom titles for them. Example:

hxxp://www.site.com/plug.php?e=contactus,Use this form to send us an email

It would then use this title on the URL chosen.

------------------------ METAS -----------------------------------

PAGES

Metas are generated from the description field, if it's empty it takes the first 250 characters from page text, does a sed_cc and strip_tags on it.

LISTS

Taken from category description, if it's empty create a configable sentence eg. "Interesting pages about {CATEGORY} like {PAGE1} and {PAGE2}"

FORUM TOPICS

Taken from first post, the first 250 characters, cleaned up

FORUM SECTIONS

Taken from description, if not create a configable sentence eg. "Interesting discussions about {SECTION} like {TOPIC1} and {TOPIC2}"

FORUM

Configable description

----------------------------------------------

Ideas welcome.
<a href="http://www.domenlo.com">Surreal Art</a>
Orkan
#2 2008-09-03 22:01
It seems that we can use sed_outputfilters() to modify <title> and <metas> at the end of parsing.

I mean, this should be in core, so each plugin can add to it its own title/metas format.
We can use $location and $z global variables as a KEY

(NOTE: I will discuss this later in Ideas section, where Id like to propose a new plugins feature that will allow for multiple "standalone" pages within one plugin, which makes $location & $z no longer sufficient, so the easiest workaround is to make $location an array instead)


As a "text source" we could use similar "variable mapping system" to this known from XTemplate class, ie:

{PHP.page_title} => replacement defined in PHP as $page_title
{PHP.array.page} => replacement defined in PHP as $array['page']
Perl - the only language that looks the same before and after RSA encryption.
Trustmaster
#3 2008-09-03 23:58
The problem with ob_start handlers is that it overrides as you go. Meaning that overwrite function should be registered before you send a string to output buffer. So if metas were sent to the buffer in header, you cannot override it in plugin without copying buffer contents, smashing it and sending to output again (which is a waste).
May the Source be with you!