Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
Hi all
Something that I found surprising about Viart 4 is that the global settings description and keywords boxes have been removed.
The idea, apparently having spoken to viart is that these weren't very useful as they were only used on the homepage of the site and the product listings page (when the top category was shown)
Personally though I disagree with this, because it allowed users to define properties in a clear place within the CMS that would vitally be used for the tag data that appears embedded inside the shops homepage. Whilst ideally the data should appear on all pages in a website and also be specific to the page contents, having it on the landing page of the site is vital to be able to influence search engine results.
The approach in Viart 4 is that you have to define seo keywords/descriptions on every single page of the site where you want them. Now this is INCREDIBLY time consuming to do, especially if you want all pages to have such data, as it ideally should.
So, I have made a very small modification to my latest Viart 4 sites to get around this. I believe the solution is simple enough and not too intrusive.
Basically the logic added means that as a page is rendered, if no page specific keywords or descriptions have been set within the CMS for that page (be it a custom page or a standard page via the "page layouts"), then a default set of values will be used instead.
This approach means that you can still use the CMS to add values that are page specific as you wish. However, for most users who I believe wont have gone to the effort of adding SEO data to more than a few pages in their site, this change allows for the automatic population of values and the possibility to save on a huge amount of work adding data around various pages within the CMS!
The only draw back of the example code below is that it doesnt reinstate the gui interface in the CMS to allow a place where users can define these default values.
However, adding such an interface back to the CMS wouldn't be too complex. So follow the steps below (and make sure you backup files before starting)...
1) edit /includes/page_layout.php
2) At around line 235 (just before the comment "// set some meta data" add the following....
// custom mod - start
if (!isset($meta_keywords) || $meta_keywords==""){
if (!isset($meta_description) || $meta_description==""){
// custom mod - end
Now, you just have to define the contents of the two new variables we have added, $default_keywords and $default_description.
3) I found the easiest way to do this that was manageable was to add them to the site specific /includes/var_definition.php file.
So inside this file just add something like the following to the top...
$default_description="description of my website...";
Alternatively; if your doing more customisation to your site, you may want to add a command to include an external file to hold all your settings in. Again, defining this via /includes/var_definition.php is a good place to do it. So for example...
And then inside this custom_settings.php you would paste the $default_keywords and $default_description values.
To reiterate; this change only ever adds keywords or description data if it hasn't already been added by the standard viart logic. On some areas of the site, for example custom pages, the description property will be taken from a stripped down version of the page body copy. However keywords would still be blank as standard. So in such a case, only the $default_keywords values would be added to the page.
I hope this helps someone!?
Last modified: 15 Jan 2011 5:16 PM
Ibn Saeed
Ibn Saeed
Thanks again arkid, for the customization.
Have you tried the above in any live site ?
Thanks for this, it works a treat on the pages that don't already have meta information in.
And, if anyone is still running an old database from an earlier version of Viart, you will find that this modification won't change the meta information on your homepage.
You will need to go into the database and open the table va_cms_pages_settings to be able to change the contents of the meta description.