Hi there
I need to build a site that can offer a text-only / low-bandwidth version... can it be done with SilverStripe ?
Cheers
Loic
Web designer Hobart
www.ultimedia.com.au
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi there
I need to build a site that can offer a text-only / low-bandwidth version... can it be done with SilverStripe ?
Cheers
Loic
Web designer Hobart
www.ultimedia.com.au
If you design it that way, you sure can! If you need it to be able to switch on the fly you can try the detection that has been done with Mobile: http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/
I don't need the automatic detection, just the option to view the site without images, etc.
So would it be just a matter of changing templates... sorry I've never used SilverStripe
Yep, that would do it. You could also just use some apache .htacces kung-fu to not serve images if you wanted to take a brass tacks approach.
As previous posters said: It can easily be done with custom templates.
The SilverStripe WYSIWYG Editor allows insertion of images too, so you might want to replace the Editor with a TextAreaField, or just disable the Image Button using HtmlEditorConfig: http://doc.silverstripe.org/doku.php?id=htmleditorconfig
You could also output raw text in the template by using $Content.RAW (http://doc.silverstripe.org/doku.php?id=text).
Hi
Here is the code that pulls content only from the live published pages. We use it for generating printable pages. Modify it to suit your situation.
Create a new page type (maybe contentPage.php)
paste this function in the controller
PHP
public function PrintContent() {
$content = Versioned::get_one_by_stage('SiteTree', 'Live', "SiteTree_Live.URLSegment = '".$_GET['urlSegment']."'");
return $content->Content;
}
Template
<script language="javascript">
function printContent() {
window.open("/contentprint?urlSegment=$URLSegment","mywindow","menubar=1,resizable=1,width=700,height=700,scrollbars=1");
}
</script>
in all templates create an href
<a href="javascript:printContent();">text version</a>
in you ContentPage.ss use
$Content
$PrintContent
and this template can have its own CSS
hope this will help you