This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stateId = 3; | |
$stateService = $this->get('ezpublish.api.service.object_state'); | |
$contentService = $this->get('ezpublish.api.service.content'); | |
$contentInfo = $contentService->loadContentInfo(93); | |
$objectStateGroup = $stateService->loadObjectStateGroup(4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here used to be a rough prototype of an | |
implementation, which is now deprecated. | |
in favour of this: | |
https://www.symfony.fi/entry/sharing-state-in-a-symfony-hybrid-app-with-twig-react-etc | |
----- | |
Using this approach you can bootstrap a | |
React application on the server side using | |
PHP/Symfony so that your client application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- vendor/ezsystems/platform-ui-bundle/Resources/public/js/services/ez-googlemapapiloader2.js 2016-11-08 11:20:11.000000000 +0200 | |
+++ vendor/ezsystems/platform-ui-bundle/Resources/public/js/services/ez-googlemapapiloader.js 2016-11-07 11:34:54.000000000 +0200 | |
@@ -14,7 +14,7 @@ | |
var EVENT_MAP_API_READY = 'mapAPIReady', | |
EVENT_MAP_API_FAILED = 'mapAPIFailed', | |
- GMAP_JSONP_URI = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback={callback}'; | |
+ GMAP_JSONP_URI = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback={callback}&key=YOUR_PERSONAL_MAP_KEY_FROM_GOOGLE_HERE'; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
// ...whatever you have here | |
{% if content.versionInfo.contentInfo.id is defined %} | |
<link rel="amphtml" href="{{ url('ez_amp', {'objectId': content.versionInfo.contentInfo.id }) }}" /> | |
{% endif %} | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html amp lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
{% if content is defined and title is not defined %} | |
{% set title = ez_content_name(content) %} | |
{% endif %} | |
<title>{{ title|default('Home')|trans }}</title> | |
<link rel="canonical" href="{{ url( "ez_urlalias", {"locationId": content.contentInfo.mainLocationId} ) }}" /> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'amp/pagelayout.html.twig' %} | |
{% block content %} | |
<h1>{{ ez_render_field(content,'title') }}</h1> | |
{{ ez_render_field(content,'content') }} | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AmpController extends Controller | |
{ | |
public function viewObjectAction($objectId) | |
{ | |
$objectId = (int) $objectId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// imports, etc... | |
class AmpController extends Controller | |
{ | |
/** | |
* @Route("/ez-amp/{objectId}", name="ez_amp") | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AmpController extends Controller | |
{ | |
/** | |
* @Route("/ez-amp/{objectId}", name="ez_amp") | |
*/ | |
public function viewObjectAction($objectId) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Imports, similar to use statements in PHP | |
import { Component, OnInit } from '@angular/core'; | |
import { ListComponent } from './list.component'; | |
import { DomainEntry } from './domain-entry'; | |
import { DomainEntriesService } from './domain-entries.service'; | |
// The component decorator | |
@Component({ |