Thank you Banal for the advices
I tried you solution and this where I got
Here is my Page.php
<?php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
static $extensions = array(
"Translatable"
);
public function ExportContent(){
$viewer = new SSViewer(array('Export' . $this->ClassName, 'ExportPage'));
return $viewer->process($this);
}
}
class Page_Controller extends ContentController {
/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
*
* @var array
*/
public static $allowed_actions = array (
);
/**
* Render the page for export
* @return string
*/
public function export(){
return array();
}
public function init() {
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
Requirements::javascript("mysite/javascript/jquery.js");
}
}
Here is my template/export/ExportPage.ss
<div>
<h1>$Title</h1>
$Content
<% if Children %>
<div class="children">
<% control Children %>
$ExportContent
<% end_control %>
</div>
<% end_if %>
</div>
Here is my template/export/Page_export.ss
<!DOCTYPE html>
<html lang="en">
<head>
<% base_tag %>
<title><% if MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> » $SiteConfig.Title</title>
$MetaTags(false)
<link rel="shortcut icon" href="/favicon.ico" />
<% require themedCSS(layout) %>
<% require themedCSS(typography) %>
<% require themedCSS(form) %>
<!--[if IE 6]>
<style type="text/css">
@import url(themes/blackcandy/css/ie6.css);
</style>
<![endif]-->
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="Header">
$SearchForm
<!--<h1>$SiteConfig.Title</h1>
<p>$SiteConfig.Tagline</p>-->
</div>
<div id="HTMLSiteTree">
<% control Menu(1) %>
$ExportContent
<% end_control %>
</div>
<div id="Footer">
<% include Footer %>
</div>
</div>
</body>
</html>
Now if i do yoursite.com/somepage/export like in you post I do get a page but it is the same page (the regular page linked to Page .ss) that I usally get and I can't see my <div id="HTMLSiteTree"> with you control inside.
I did flush and publish the pages
I think I missed something.
My ohter question is where does the Translatable::get_current_locale() line .
In _config.php
can you help me ?
Thanks again for your advice.