Friday, January 27, 2012

My answer to "Search Engine Optimization"

This is my answer to a Question on Support site for LampCMS project


Are you talking about the main page only?
What do you mean by 'description', do you mean the description meta tag?

I just modified it so that a description that you set in !config.ini as SITE_NAME will be set as default value for 'description' meta tag.

In any controller you can override this at any time by adding this anywhere inside your main() function in any controller:

$this->aPageVars['description'] = $this->_('My cool site');

In this example 'My cool site' will be a translation string, so you can even translate it in your xlif translation files.

If you don't want it to be translatable string then you can just hard code it
$this->aPageVars['description'] = 'My cool site';

As for "All questions" title, you can also modify it.
The best way to do this is to create a xliff file, even for the English strings, which I don't currently have.
This way you can "Translate" strings that are used on the site to your own values.

Look in /translations/messages.ru.xlf file
You can copy that file to your own language and even to messages.en.xlf
Then just write your own translated strings for any string that is used in this site. Anywhere in the code you see something like $this->_('some string') means it's going through translation object, trying to find value in the loaded translation array.

So if you add your own messages.en.xlf and define you own version of 'All questions' then your version will be used on the site.

I will soon make new commit to github, so the default value for 'description' will be there too.
The next changes I am working on is support for categories. Alot has been done already but I still have to write a controller and templates to render a view of all categories.

No comments:

Post a Comment