Jump to content

Add Description Meta In The Structure.pdt


activa

Recommended Posts

Hello

 

is nice to add a description meta in the structure.pdt and allow plugins to set it via $this->structure->set("descriptoon","xxxxx");

 

this can help in google seo in some place like the order form , the support manager , and other custom plugin .

 

That's down to the plugins to do... I'm hoping to get that done in my plugin soon which at the moment I do that anyway with if statements.

        <?php if( $page_title == "Welcome" ){ ?>
            <meta name="description" content="Licensecart, sells high quality licenses at affordable prices.">
            <meta name="keywords" content="Blesta,InterWorx,SolusVM,LiteSpeed,R1Soft,Softaculous,Licence,License,Licensecart">
        <?php }elseif( $page_title == 'Blesta' ){ ?>
            <meta name="description" content="Licensecart, sells licenses for the high quality billing system Blesta.">
            <meta name="keywords" content="Blesta,billing system,whmcs,clientexec,whsuite,high quality,license,licensecart.com">
        <?php }elseif( $page_title == 'Our Customers' ){ ?>
          <meta name="description" content="Licensecart's showcases some of our customers.">
          <meta name="keywords" content="customers,customer,businesses,companies,high quality,license,licensecart.com">
        <?php }elseif( $page_title == 'Portfolio' ){ ?>
            <meta name="description" content="Licensecart's integration portfolio showcases some of our Blesta integrations we've done for some customers.">
            <meta name="keywords" content="Blesta,integrations,integration,portfolio,showcase,billing system,licensecart.com">
        <?php }elseif( $page_title == 'InterWorx' ){ ?>
            <meta name="description" content="Licensecart, sells licenses for the high quality control panel InterWorx.">
            <meta name="keywords" content="InterWorx,control panel,cPanel,directadmin,plesk,high quality,license,licensecart.com">
        <?php } [...] ?>
Link to comment
Share on other sites

Hello

 

is nice to add a description meta in the structure.pdt and allow plugins to set it via $this->structure->set("descriptoon","xxxxx");

 

this can help in google seo in some place like the order form , the support manager , and other custom plugin .

 

good addition .

 

 

 

That's down to the plugins to do... I'm hoping to get that done in my plugin soon which at the moment I do that anyway with if statements.

        <?php if( $page_title == "Welcome" ){ ?>
            <meta name="description" content="Licensecart, sells high quality licenses at affordable prices.">
            <meta name="keywords" content="Blesta,InterWorx,SolusVM,LiteSpeed,R1Soft,Softaculous,Licence,License,Licensecart">
        <?php }elseif( $page_title == 'Blesta' ){ ?>
            <meta name="description" content="Licensecart, sells licenses for the high quality billing system Blesta.">
            <meta name="keywords" content="Blesta,billing system,whmcs,clientexec,whsuite,high quality,license,licensecart.com">
        <?php }elseif( $page_title == 'Our Customers' ){ ?>
          <meta name="description" content="Licensecart's showcases some of our customers.">
          <meta name="keywords" content="customers,customer,businesses,companies,high quality,license,licensecart.com">
        <?php }elseif( $page_title == 'Portfolio' ){ ?>
            <meta name="description" content="Licensecart's integration portfolio showcases some of our Blesta integrations we've done for some customers.">
            <meta name="keywords" content="Blesta,integrations,integration,portfolio,showcase,billing system,licensecart.com">
        <?php }elseif( $page_title == 'InterWorx' ){ ?>
            <meta name="description" content="Licensecart, sells licenses for the high quality control panel InterWorx.">
            <meta name="keywords" content="InterWorx,control panel,cPanel,directadmin,plesk,high quality,license,licensecart.com">
        <?php } [...] ?>

 

 

your implementation is a nice solution .

 

what if you have a cms (let say your cms ) and you have 100 posts/pages , you should do 99 IF statement in the structure ?!! or if you have multi-languages the page title will change no ?

 

a sample solution that didn't need any change in the tructure.pdt is to add the description via the custom_head like

$this->structure->set("custom_head",'<meta name="description" content="Description goes here" />');

this will inject the meta in the header , this will have only obstacle if you are using some advanced coding that nee injecting css js, multi meta from different function .

 

another professional solution is to add your custom header var , in structure.pdf , under the title tag .

<title><?php echo $this->Html->safe(($this->Html->ifSet($page_title) ? $page_title . " | " : "") . $this->Html->ifSet($system_company->name));?></title>

add this line

<meta name="description" content="<?php echo $this->Html->ifSet($description_head); ?>" />

in your plugin or any page add this line

$this->structure->set("description_head", "here add your description or any var fetched from database ");

i have used a similar solution but is advanced rules in my custom multi-languages CMS .

Link to comment
Share on other sites

good addition .

 

 

 

 

your implementation is a nice solution .

 

what if you have a cms (let say your cms ) and you have 100 posts/pages , you should do 99 IF statement in the structure ?!! or if you have multi-languages the page title will change no ?

 

a sample solution that didn't need any change in the tructure.pdt is to add the description via the custom_head like

$this->structure->set("custom_head",'<meta name="description" content="Description goes here" />');

this will inject the meta in the header , this will have only obstacle if you are using some advanced coding that nee injecting css js, multi meta from different function .

 

another professional solution is to add your custom header var , in structure.pdf , under the title tag .

<title><?php echo $this->Html->safe(($this->Html->ifSet($page_title) ? $page_title . " | " : "") . $this->Html->ifSet($system_company->name));?></title>

add this line

<meta name="description" content="<?php echo $this->Html->ifSet($description_head); ?>" />

in your plugin or any page add this line

$this->structure->set("description_head", "here add your description or any var fetched from database ");

i have used a similar solution but is advanced rules in my custom multi-languages CMS .

 

Ah never thought about that :) so you can have a if statement e.g.:

<?php if($this->Html->ifSet($description_head)){ ?>
<meta name="description" content="<?php echo $this->Html->ifSet($description_head); ?>" />
<?php } ?>
Link to comment
Share on other sites

 

Ah never thought about that :) so you can have a if statement e.g.:

<?php if($this->Html->ifSet($description_head)){ ?>
<meta name="description" content="<?php echo $this->Html->ifSet($description_head); ?>" />
<?php } ?>

 

a logical & well code version should be like

<?php if($this->Html->ifSet($description_head, false)){ ?>
<meta name="description" content="<?php echo $description_head; ?>" />
<?php } ?>

 but i prefer do it like this :

<meta name="description" content="<?php echo $this->Html->ifSet($description_head,"your description about company"); ?>" />

so if no description are set it show a default description about your company for example .

Link to comment
Share on other sites

<meta name="description" content="<?php echo $this->Html->ifSet($description_head,"your description about company"); ?>" />

so if no description are set it show a default description about your company for example .

 

Also, don't trust the input is safe for display until you've made it so:

<?php
$description = $this->Html->ifSet($description_head, "your fallback description");
?>
<meta name="description" content="<?php $this->Html->_($description);?>" />
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...