seo progress
This commit is contained in:
parent
c152654699
commit
46c1d5ef25
@ -2,10 +2,20 @@
|
|||||||
|
|
||||||
class Controller_home extends Cana_Controller {
|
class Controller_home extends Cana_Controller {
|
||||||
public function init() {
|
public function init() {
|
||||||
|
if (c::getPagePiece(0)) {
|
||||||
$c = Community::permalink(c::getPagePiece(0));
|
$c = Community::permalink(c::getPagePiece(0));
|
||||||
|
|
||||||
if ($c->id_community) {
|
if ($c->id_community) {
|
||||||
|
if (c::getPagePiece(1)) {
|
||||||
|
|
||||||
|
$r = Restaurant::permalink(c::getPagePiece(1));
|
||||||
|
if ($r->id_restaurant) {
|
||||||
|
Cana::view()->restaurant = $r;
|
||||||
|
}
|
||||||
|
}
|
||||||
Cana::view()->community = $c;
|
Cana::view()->community = $c;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Cana::view()->display('home/index');
|
Cana::view()->display('home/index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5,6 +5,10 @@ class Crunchbutton_Category extends Cana_Table {
|
|||||||
return Restaurant::o($this->id_restaurant);
|
return Restaurant::o($this->id_restaurant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function community() {
|
||||||
|
return $this->restaurant()->community();
|
||||||
|
}
|
||||||
|
|
||||||
public function dishes() {
|
public function dishes() {
|
||||||
if (!isset($this->_dishes)) {
|
if (!isset($this->_dishes)) {
|
||||||
$this->_dishes = Dish::q('select * from dish where id_category="'.$this->id_category.'" and dish.active=1');
|
$this->_dishes = Dish::q('select * from dish where id_category="'.$this->id_category.'" and dish.active=1');
|
||||||
@ -20,6 +24,10 @@ class Crunchbutton_Category extends Cana_Table {
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function name() {
|
||||||
|
return $this->name.($this->loc ? (' '.$this->community()->prep.' '.$this->community()->name) : '');
|
||||||
|
}
|
||||||
|
|
||||||
public function __construct($id = null) {
|
public function __construct($id = null) {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this
|
$this
|
||||||
|
|||||||
@ -9,6 +9,10 @@ class Crunchbutton_Restaurant extends Cana_Table {
|
|||||||
->load($id);
|
->load($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function permalink($permalink) {
|
||||||
|
return self::q('select * from restaurant where permalink="'.$permalink.'"')->get(0);
|
||||||
|
}
|
||||||
|
|
||||||
public function meetDeliveryMin($order) {
|
public function meetDeliveryMin($order) {
|
||||||
if (!$this->delivery_min) {
|
if (!$this->delivery_min) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,8 +1,48 @@
|
|||||||
<?
|
<? if ($this->restaurant->id_restaurant) : ?>
|
||||||
$this->title = 'Food Delivery | Order Food Online from Local Restaurants for Takeout & Delivery';
|
<?
|
||||||
?>
|
$this->title = $this->restaurant->name.' Delivery | '.$this->restaurant->community()->name.' | Food Delivery | Order from Local Restaurants | Crunchbutton';
|
||||||
|
?>
|
||||||
|
|
||||||
<? if ($this->community->id_community) : ?>
|
<? if (c::app()->isBot()) : ?>
|
||||||
|
<div class="home-text">
|
||||||
|
<h2>Order <b>delivery</b> or <b>takeout</b> from <?=$this->restaurant->name?>.</h2>
|
||||||
|
</div>
|
||||||
|
<? endif ; ?>
|
||||||
|
|
||||||
|
<div itemscope itemtype="http://schema.org/Restaurant">
|
||||||
|
<link itemprop="name" href="<?=$this->restaurant->name?>"/>
|
||||||
|
<link itemprop="description" href="Order food delivery or takeout from <?=$this->restaurant->name?> in <?=$this->community->name?> on Crunchbutton"/>
|
||||||
|
<link itemprop="url" href="/<?=$this->community->permalink?>/<?=$this->restaurant->permalink?>"/>
|
||||||
|
<link itemprop="image" href="<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="restaurant-name"><h1><?=$this->restaurant->name?></h1></div>
|
||||||
|
<div class="restaurant-pic-wrapper">
|
||||||
|
<div class="restaurant-pic" style="background: url(<?=$this->restaurant->image() ? '/cache/images/'.$this->restaurant->image()->getFileName() : ''?>);"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="main-content-readable">
|
||||||
|
<div class="restaurant-items">
|
||||||
|
<div class="content-item-name content-item-main-name"><h1>Add to your order</h1></div>
|
||||||
|
<? foreach ($this->restaurant->categories() as $category) : ?>
|
||||||
|
<div class="restaurant-item-title"><?=$category->name()?></div>
|
||||||
|
<ul class="resturant-dishes resturant-dish-container" date-id_category="1">
|
||||||
|
<? foreach ($category->dishes() as $dish) : ?>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:;" data-id_dish="1">
|
||||||
|
<span class="dish-name"><?=$dish->name?></span><span class="dish-price">($<?=number_format($dish->price,2)?>)</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<? endforeach ; ?>
|
||||||
|
</ul>
|
||||||
|
<? endforeach ; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<? elseif ($this->community->id_community) : ?>
|
||||||
|
<?
|
||||||
|
$this->title = $this->community->name.($this->community->name_alt ? ' | '.$this->community->name_alt : '').' Food Delivery | Order Food from Local Restaurants | Crunchbutton';
|
||||||
|
?>
|
||||||
<? if (c::app()->isBot()) : ?>
|
<? if (c::app()->isBot()) : ?>
|
||||||
<div class="home-text">
|
<div class="home-text">
|
||||||
<h1><?=$this->community->name?> Online Food Delivery</h1>
|
<h1><?=$this->community->name?> Online Food Delivery</h1>
|
||||||
@ -11,7 +51,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<? endif ; ?>
|
<? endif ; ?>
|
||||||
|
|
||||||
<? $this->title .= ' | '.$this->community->name; ?>
|
|
||||||
<div class="home-tagline">
|
<div class="home-tagline">
|
||||||
<h1>Order the best food <?=$this->community->prep?> <?=$this->community->name?> with a click</h1>
|
<h1>Order the best food <?=$this->community->prep?> <?=$this->community->name?> with a click</h1>
|
||||||
<h2>We've chosen the best food from the best restaurants <?=$this->community->prep?> <?=$this->community->name?>. We save your order, delivery and payment info, so reordering is as easy as the click of a button. Click on a restaurant below to get started.</h2>
|
<h2>We've chosen the best food from the best restaurants <?=$this->community->prep?> <?=$this->community->name?>. We save your order, delivery and payment info, so reordering is as easy as the click of a button. Click on a restaurant below to get started.</h2>
|
||||||
@ -38,10 +77,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<? else : ?>
|
<? else : ?>
|
||||||
|
<?
|
||||||
|
$this->title = 'Food Delivery | Order Food Online from Local Restaurants for Takeout & Delivery | Crunchbutton';
|
||||||
|
?>
|
||||||
|
|
||||||
<? if (c::app()->isBot()) : ?>
|
<? if (c::app()->isBot()) : ?>
|
||||||
<div class="home-text">
|
<div class="home-text">
|
||||||
<h1>Online Food Ordering. </h1>
|
<h1>Online Food Ordering. </h1>
|
||||||
<h2>Order <b>delivery</b> & <b>takeout</b> online using crunchbutton or our <b>iPhone</b> or <b>Android</b> apps.</h2>
|
<h2>Order <b>delivery</b> & <b>takeout</b> using crunchbutton on your iPhone or Android.</h2>
|
||||||
<p>
|
<p>
|
||||||
Order your favorite <b>Pizza</b> with any topping online, delivered to your home. Add toppings to your pizza. Pepperoni, sausage, cheese, sauce, whatever!
|
Order your favorite <b>Pizza</b> with any topping online, delivered to your home. Add toppings to your pizza. Pepperoni, sausage, cheese, sauce, whatever!
|
||||||
Don't want pizza? How about other <b>Italian food</b> like pasta, or a sandwich? Build your own sandwich, or order a <b>Wenzel</b>.
|
Don't want pizza? How about other <b>Italian food</b> like pasta, or a sandwich? Build your own sandwich, or order a <b>Wenzel</b>.
|
||||||
@ -67,5 +110,3 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<? endif ; ?>
|
<? endif ; ?>
|
||||||
|
|
||||||
<? $this->title .= ' | Crunchbutton'; ?>
|
|
||||||
@ -1,9 +1,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<?
|
<?
|
||||||
if ($this->community->id_community && !c::getPagePiece(1)) {
|
if ($this->community->id_community) {
|
||||||
|
if ($this->restaurant->id_restaurant) {
|
||||||
|
$e = ' smaller-width';
|
||||||
|
} else {
|
||||||
$cc = $this->community->restaurants()->count();
|
$cc = $this->community->restaurants()->count();
|
||||||
$e = $cc == 4 ? ' short-meal-list' : '';
|
$e = $cc == 4 ? ' short-meal-list' : '';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$basicPages = ['legal','help','faq','hello'];
|
$basicPages = ['legal','help','faq','hello'];
|
||||||
if (!c::getPagePiece(0) || (c::getPagePiece(0) && !in_array(c::getPagePiece(0), $basicPages) && !$this->community)) {
|
if (!c::getPagePiece(0) || (c::getPagePiece(0) && !in_array(c::getPagePiece(0), $basicPages) && !$this->community)) {
|
||||||
$e = ' short-meal-list';
|
$e = ' short-meal-list';
|
||||||
|
|||||||
@ -171,6 +171,7 @@ App.page.home = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.page.community = function(id) {
|
App.page.community = function(id) {
|
||||||
|
|
||||||
App.lastCommunity = id;
|
App.lastCommunity = id;
|
||||||
App.currentPage = 'community';
|
App.currentPage = 'community';
|
||||||
|
|
||||||
@ -179,7 +180,7 @@ App.page.community = function(id) {
|
|||||||
|
|
||||||
App.track('Community page loaded', {community: App.community.name});
|
App.track('Community page loaded', {community: App.community.name});
|
||||||
|
|
||||||
document.title = 'Crunchbutton - ' + App.community.name;
|
document.title = App.community.name + (App.community.name_alt ? ' | ' + App.community.name_alt : '') + ' Food Delivery | Order Food from Local Restaurants | Crunchbutton';
|
||||||
|
|
||||||
var slogan = App.slogans[Math.floor(Math.random()*App.slogans.length)];
|
var slogan = App.slogans[Math.floor(Math.random()*App.slogans.length)];
|
||||||
var sloganReplace = App.community.prep + ' ' + App.community.name;
|
var sloganReplace = App.community.prep + ' ' + App.community.name;
|
||||||
@ -230,6 +231,7 @@ App.page.community = function(id) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.page.restaurant = function(id) {
|
App.page.restaurant = function(id) {
|
||||||
|
|
||||||
App.currentPage = 'restaurant';
|
App.currentPage = 'restaurant';
|
||||||
App.cartHighlightEnabled = false;
|
App.cartHighlightEnabled = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user