Add SEO tab for a product

This commit is contained in:
touffies
2013-11-28 12:05:03 +01:00
parent 945921048e
commit ba48bc985e
2 changed files with 95 additions and 1 deletions

View File

@@ -0,0 +1,79 @@
<div class="form-container">
<form method="POST" action="{$formAction}" {form_enctype form=$form} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = {$pageUrl}
close_url = {$closeUrl}
}
{* Hidden field *}
<input type="hidden" name="current_tab" value="seo">
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
</label>
<div class="input-group">
<span class="input-group-addon">{$url_language|default:{config key="url_site"}}</span>
<input type="text" id="{$label_attr.for}" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" {if $required} aria-required="true" required{/if} class="form-control" placeholder="{intl l='Use the keyword phrase in your URL.'}">
</div>
</div>
{/form_field}
{form_field form=$form field='meta_title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='The HTML TITLE element is the most important element on your web page.'}</span>
</label>
<div class="control-input">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Make sure that your title is clear, and contains many of the keywords within the page itself.'}">
</div>
</div>
{/form_field}
{form_field form=$form field='meta_description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='Keep the most important part of your description in the first 150-160 characters.'}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="6"{if $required} aria-required="true" required{/if} placeholder="{intl l='Make sure it uses keywords found within the page itself.'}" class="form-control">{$value}</textarea>
</div>
{/form_field}
{form_field form=$form field='meta_keyword'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :{if $required} <span class="required">*</span>{/if}
<span class="label-help-block">{intl l='You don\'t need to use commas or other punctuations.'}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="3"{if $required} aria-required="true" required{/if} placeholder="{intl l='Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.'}" class="form-control">{$value}</textarea>
</div>
{/form_field}
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
page_url = {$pageUrl}
close_url = {$closeUrl}
}
</form>
</div>

View File

@@ -48,6 +48,8 @@
data-toggle="tab">{intl l="General"}</a> data-toggle="tab">{intl l="General"}</a>
</li> </li>
<li><a href="#seo" data-toggle="tab">{intl l="SEO"}</a></li>
<li> <li>
<a href="#details" data-toggle="tab">{intl l="Details"}</a> <a href="#details" data-toggle="tab">{intl l="Details"}</a>
</li> </li>
@@ -79,7 +81,7 @@
{intl l="Documents"} {intl l="Documents"}
</a> </a>
<li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li> <li><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -87,6 +89,18 @@
{include file="includes/product-general-tab.html"} {include file="includes/product-general-tab.html"}
</div> </div>
<div class="tab-pane fade" id="seo">
{form name="thelia.admin.seo"}
{include file="includes/seo-tab.html"
form = $form
currentId = "{$ID}"
formAction = "{url path='/admin/products/seo/save'}"
pageUrl = "{url path='/admin/products/update' product_id=$ID}"
closeUrl = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{/form}
</div>
<div class="tab-pane fade" id="details"> <div class="tab-pane fade" id="details">
{include file="includes/product-details-tab.html"} {include file="includes/product-details-tab.html"}
</div> </div>
@@ -110,6 +124,7 @@
<div class="tab-pane fade" id="modules"> <div class="tab-pane fade" id="modules">
{module_include location='product-edit'} {module_include location='product-edit'}
</div> </div>
</div> </div>
</div> </div>
</div> </div>