osclass / Osclass

With Osclass, get your own classifieds site for free. Build your own Osclass installation and start advertising real estate, jobs or whatever you want- in minutes!
http://osclass.org/
649 stars 342 forks source link

Meta title and meta description not updated when working with subdomains #890

Closed ethicapress closed 11 years ago

ethicapress commented 11 years ago

When you choose subdomains as regions, the meta title and description still display the main home page meta tags. Not SEO friendly at all.

robbycandra commented 11 years ago

+1

robbycandra commented 11 years ago

We can add code like this on common/head

?php if(Params::getParam('subdomain')==1) { ?>
    title><?php echo osc_user_name(); ?> - <?php osc_subdomain_host(); ?></title>
    meta name="title" content="Toko online - <?php echo osc_user_name(); ?> - <?php osc_subdomain_host(); ?>" />
    meta name="description" content="<?php echo osc_user_info(); ?>"/>

?php } else if (Params::getParam('page')=='item') { ?>
    title><?php echo osc_item_title(); ?> </title>
    meta name="title" content="<?php echo osc_item_title(); ?>" />
    meta name="description" content="<?php echo osc_item_city().' - '.osc_item_category().' - '.osc_item_title();?>"/>

?php } else { ?>
    title><?php echo meta_title() ; ?></title>
    meta name="title" content="<?php echo osc_esc_html(meta_title()); ?>" />
    ?php if( meta_description() != '' ) { ?>
        meta name="description" content="<?php echo osc_esc_html(meta_description()); ?>" />
    ?php } ?>

?php } ?>

(i use username as subdomian)

conejoninja commented 11 years ago

This issue has been moved to the theme repository : https://github.com/osclass/osclass-themes/issues/47