sitemap(html)design fix
This commit is contained in:
@@ -45,6 +45,7 @@ class SitemapControllerCore extends FrontController
|
||||
|
||||
$categoriesTree = Category::getRootCategory()->recurseLiteCategTree(0);
|
||||
$this->addRoomTypes($categoriesTree);
|
||||
$categoriesTree['children'] = $this->getHotelNodes($categoriesTree);
|
||||
$this->context->smarty->assign('categoriesTree', $categoriesTree);
|
||||
$this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
|
||||
$this->context->smarty->assign('voucherAllowed', (int)CartRule::isFeatureActive());
|
||||
@@ -98,4 +99,18 @@ class SitemapControllerCore extends FrontController
|
||||
$this->addRoomTypes($child);
|
||||
}
|
||||
}
|
||||
protected function getHotelNodes($node)
|
||||
{
|
||||
$hotels = array();
|
||||
if (isset($node['room_types'])) {
|
||||
$node['children'] = array();
|
||||
$hotels[] = $node;
|
||||
} else {
|
||||
foreach ($node['children'] as $child) {
|
||||
$hotels = array_merge($hotels, $this->getHotelNodes($child));
|
||||
}
|
||||
}
|
||||
|
||||
return $hotels;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,13 @@ class QgsHelper
|
||||
return $pages;
|
||||
}
|
||||
|
||||
public static function getMetaIdByPage($page)
|
||||
{
|
||||
return (int) Db::getInstance()->getValue(
|
||||
'SELECT `id_meta` FROM `'._DB_PREFIX_.'meta` WHERE `page` = \''.pSQL($page).'\''
|
||||
);
|
||||
}
|
||||
|
||||
protected static function getProductGroupJoin()
|
||||
{
|
||||
if (!Group::isFeatureActive() || !Configuration::get('PS_UNIDENTIFIED_GROUP')) {
|
||||
|
||||
@@ -42,22 +42,12 @@ class Qlogsitemap extends Module
|
||||
'our-properties' => 'meta',
|
||||
);
|
||||
|
||||
/**
|
||||
* Front pages listed after the CMS pages (page name => URL type).
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $pagesAfter = array(
|
||||
'contact' => 'contact',
|
||||
'authentication' => 'login',
|
||||
'sitemap' => 'sitemapPage',
|
||||
);
|
||||
|
||||
/**
|
||||
* Fixed priority of each URL type.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $priorities = array(
|
||||
'home' => 1.0,
|
||||
'meta' => 0.8,
|
||||
@@ -71,22 +61,12 @@ class Qlogsitemap extends Module
|
||||
'sitemapPage' => 0.2,
|
||||
);
|
||||
|
||||
/**
|
||||
* Cron expression of each automatic generation option (never disables the task).
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $cronOptions = array(
|
||||
'weekly' => '0 0 * * 0',
|
||||
'monthly' => '0 0 1 * *',
|
||||
'yearly' => '0 0 1 1 *',
|
||||
);
|
||||
|
||||
/**
|
||||
* Writer state while a sitemap is generated.
|
||||
*
|
||||
* @var resource|null
|
||||
*/
|
||||
protected $fileHandle = null;
|
||||
protected $fileUrlCount = 0;
|
||||
protected $fileIndex = 0;
|
||||
@@ -405,6 +385,7 @@ class Qlogsitemap extends Module
|
||||
}
|
||||
|
||||
QgsHelper::deleteSitemapFiles();
|
||||
$this->sitemapPageMeta();
|
||||
|
||||
$disabledPages = QgsHelper::getDisabledPages();
|
||||
foreach (Language::getLanguages(true, (int) $this->context->shop->id) as $lang) {
|
||||
@@ -434,6 +415,30 @@ class Qlogsitemap extends Module
|
||||
|
||||
return $result;
|
||||
}
|
||||
protected function sitemapPageMeta()
|
||||
{
|
||||
$idMeta = QgsHelper::getMetaIdByPage('sitemap');
|
||||
$objMeta = new Meta($idMeta ?: null);
|
||||
if (!$idMeta) {
|
||||
$objMeta->page = 'sitemap';
|
||||
$objMeta->configurable = 1;
|
||||
}
|
||||
|
||||
$missing = false;
|
||||
foreach (Language::getLanguages(false) as $lang) {
|
||||
$idLang = (int) $lang['id_lang'];
|
||||
if ($idMeta && Meta::getMetaByPage('sitemap', $idLang)) {
|
||||
continue;
|
||||
}
|
||||
$objMeta->title[$idLang] = $this->l('Sitemap');
|
||||
$objMeta->description[$idLang] = $this->l('Lost? Find what you are looking for');
|
||||
$objMeta->keywords[$idLang] = '';
|
||||
$objMeta->url_rewrite[$idLang] = 'sitemap';
|
||||
$missing = true;
|
||||
}
|
||||
|
||||
return $missing ? (bool) $objMeta->save() : true;
|
||||
}
|
||||
|
||||
protected function startSitemapSet($iso)
|
||||
{
|
||||
|
||||
43
themes/hotel-reservation-theme/css/sitemap.css
Normal file
43
themes/hotel-reservation-theme/css/sitemap.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/******************************************************************
|
||||
Sitemap Page Styles
|
||||
*******************************************************************/
|
||||
#sitemap .sitemap_block .page-subheading {
|
||||
margin-bottom: 16px; }
|
||||
#sitemap .sitemap_block li {
|
||||
line-height: 16px;
|
||||
padding-bottom: 11px; }
|
||||
#sitemap .sitemap_block li a:before {
|
||||
content: "\f105";
|
||||
display: inline-block;
|
||||
font-family: "FontAwesome";
|
||||
padding-right: 10px; }
|
||||
#sitemap .sitemap_block li a:hover {
|
||||
font-weight: bold; }
|
||||
|
||||
#listpage_content div.tree_top {
|
||||
padding: 5px 0 0 27px; }
|
||||
#listpage_content div.tree_top a:before {
|
||||
content: "\f015";
|
||||
display: inline-block;
|
||||
font-family: "FontAwesome";
|
||||
font-size: 20px;
|
||||
color: #333; }
|
||||
#listpage_content div.tree_top a:hover:before {
|
||||
color: #515151; }
|
||||
|
||||
ul.tree {
|
||||
padding-left: 24px; }
|
||||
ul.tree li {
|
||||
margin: 0 0 0 21px;
|
||||
padding: 5px 0 0 33px;
|
||||
border-left: 1px solid #d6d4d4;
|
||||
background: url(../img/sitemap-horizontal.png) no-repeat left 15px transparent; }
|
||||
ul.tree li a:hover {
|
||||
font-weight: bold; }
|
||||
ul.tree > li {
|
||||
margin: 0 0 0 11px; }
|
||||
ul.tree li.last {
|
||||
border: medium none;
|
||||
background: url(../img/sitemap-last.png) no-repeat 0px -4px transparent; }
|
||||
|
||||
/*# sourceMappingURL=sitemap.css.map */
|
||||
BIN
themes/hotel-reservation-theme/img/sitemap-horizontal.png
Normal file
BIN
themes/hotel-reservation-theme/img/sitemap-horizontal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 B |
BIN
themes/hotel-reservation-theme/img/sitemap-last.png
Normal file
BIN
themes/hotel-reservation-theme/img/sitemap-last.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 B |
66
themes/hotel-reservation-theme/sass/sitemap.scss
Normal file
66
themes/hotel-reservation-theme/sass/sitemap.scss
Normal file
@@ -0,0 +1,66 @@
|
||||
@import "compass";
|
||||
@import "theme_variables";
|
||||
|
||||
/******************************************************************
|
||||
Sitemap Page Styles
|
||||
*******************************************************************/
|
||||
#sitemap {
|
||||
.sitemap_block {
|
||||
.page-subheading {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
li {
|
||||
line-height: 16px;
|
||||
padding-bottom: 11px;
|
||||
a {
|
||||
&:before {
|
||||
content: "\f105";
|
||||
display: inline-block;
|
||||
font-family: $font-icon;
|
||||
padding-right: 10px;
|
||||
}
|
||||
&:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#listpage_content div.tree_top {
|
||||
padding: 5px 0 0 27px;
|
||||
a {
|
||||
&:before {
|
||||
content: "\f015";
|
||||
display: inline-block;
|
||||
font-family: $font-icon;
|
||||
font-size: 20px;
|
||||
color: $base-text-color;
|
||||
}
|
||||
&:hover {
|
||||
&:before {
|
||||
color: $link-hover-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ul.tree {
|
||||
padding-left: 24px;
|
||||
li {
|
||||
margin: 0 0 0 21px;
|
||||
padding: 5px 0 0 33px;
|
||||
border-left: 1px solid $base-border-color;
|
||||
background: url(../img/sitemap-horizontal.png) no-repeat left 15px transparent;
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
> li {
|
||||
margin: 0 0 0 11px;
|
||||
}
|
||||
li.last {
|
||||
border: medium none;
|
||||
background: url(../img/sitemap-last.png) no-repeat 0px -4px transparent;
|
||||
}
|
||||
}
|
||||
@@ -148,11 +148,6 @@
|
||||
<div class="sitemap_block box">
|
||||
<h3 class="page-subheading">{l s='Pages'}</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{$categoriescmsTree.link|escape:'html':'UTF-8'}" title="{$categoriescmsTree.name|escape:'html':'UTF-8'}">
|
||||
{$categoriescmsTree.name|escape:'html':'UTF-8'}
|
||||
</a>
|
||||
</li>
|
||||
{if isset($categoriescmsTree.children)}
|
||||
{foreach $categoriescmsTree.children as $child}
|
||||
{if (isset($child.children) && $child.children|@count > 0) || $child.cms|@count > 0}
|
||||
|
||||
Reference in New Issue
Block a user