How do I change page titles if my site uses only a single master template?

If you are reading this article, then you likely know that the content management system is based on the use of a single master template for all pages.  This page is called default.wc and is stored in your templates folder.  As a result, the page title for your pages is managed first in the master template in the html head tag like any other html page.  You can access this page either by ftp or the template editor.

If you are planning to SEO your website and want your dynamic content pages to have different page titles (highly recommended) then this article is exactly what you have been searching for.  Here is the confusion for most newbies to our system.  All of your sites pages will render 'in' the default.wc.  This means if the default.wc has a title and or keyword and or description meta tag all pages will share the same values.  This article shows you a few ways to change this info dynamically.  If you are not a web developer, you'll find this article confusing.  This page is written for an SEO developer or web designer.

As you may already know, Sophio has a collection of hundreds of pages that are immediately ready for your use.  We refer to all of these pages as templates and they can be edited from within the Template Editor found in the control panel.  Most pages you find at your site such as privacy.wws or terms.wws have a template of the same name.  If you place one of these links on your page, the 'master template' from the Sophio Master Template directory is used.  If you edit the template in the template editor, a copy of the template is placed in your templates folder and you will have full control of the html code and content.

If you want to change the title or meta tags inside any of the templates you modify the code is below.  These lines of code should be placed above the html code in your template file.  If you look carefully you will see that the values you put in your template talk to the values you place in your master template.

<%= Process.oView.Set("MetaTitle","My custom Title") %>
<%= Process.oView.Set("MetaDescription","Custom description") %>
<%= Process.oView.Set("MetaKeywords","one, two,three,four") %>

The tags above go in the page you want to have a custom title.  For them to 'show up' you have to first update your default.wc (master template) with the tags to render the dynamic tags.  Edit your default.wc file and remove the 'title' tag and replace it with this code:

<title><%= Process.oView.Get("MetaTitle") %></title>

Once you do that, the system will look for the title for each page.  the default title should be set first.  you can do that from store settings.





Bu cavab sizə kömək etdi? 0 istifadəçi bunu faydalı hesab edir (3 səs)

Powered by WHMCompleteSolution