BLOG: Web Content Management

Welcome to Oshyn’s Web Content Management Blog where our experts discuss the latest developments and best practices in the Content Management industry with a focus on several leading platforms: Drupal, EPiServer, Jahia, Open Text and Sitecore.

Jahia Print & E-mail Templates

Jahia Print & E-mail Templates

Juan Pablo Albuja... - Tuesday, January 05, 2010

I want to share a possible implementation of how to do a print friendly view and email functionality in Jahia V6. I want to share this because these two types of functionality are very common across websites and Jahia can be used to easily implement them.


Print Friendly View

The print view is a print friendly view of a webpage. The idea of that view is to give the user the option to print only the important information contained in a web page excluding some navigation components such as the header and the footer.

I suggest you read my post "Jahia WCM Quick Review: Maven, Templates and Navigation" if you are new with Jahia.

Consider that we have a jsp page that represents a template in Jahia and looks like this:


<template:template>
    <template:templateHead>
        <script language="javascript" src="${jahia.includes.webPath['main.js']}"></script>
        <link rel="stylesheet" type="text/css" href="${jahia.includes.webPath['main.css']}" media="screen"/>
    </template:templateHead>
    <template:templateBody>    
        <template:include page="common/header.jsp" />
        <!-- Start of Content Section -->

        <!-- End of Content Section -->
        <template:include page="common/footer.jsp" />
    </template:templateBody>    
</template:template>


The idea of the print view is to have a similar above template that shows only the information section of the web page. We can achieve that by calling the same page with different parameters in order to hide those sections that we do not want to include.

The print view link can be done by using a javascript function similar to this one:


window.open(window.location.href + “?print=true”);


In the template we can look if the request parameter print exists and change the stylesheet if necessary and also it is possible to include a different jsp when that parameter is in the request using the taglib template:include.

Following is a print friendly view sample where the header, footer, and navigation are not showed.



E-mail

It is common for new websites to have a link that says "Send Email" in order to send someone else an email containing the link and title of a webpage that has interesting information, and it is usually possible to include some user text in the email. Jahia can be used to implement that functionality by using the following Jahia instructions ${jahia.page.title} and ${jahia.page.url}, where jahia.page.title returns the title set by the editor and jahia.page.url returns the url of the page.

The idea is to create a jsp file in the Jahia template set that is going to handle the email functionality. That page can be called from the template in the following manner:


<a href="javascript:popup('${jahia.includes.webPath['mailTemplate.jsp']}?pageTitle=${jahia.page.title}&pageUrl=${jahia.page.url">send</a>


Where the popup functions is a javascript function that is going to use window.open(), and the url parameter contains the Jahia expression language instruction ${jahia.includes.webPath['mailTemplate.jsp']}, where mailTemplate.jsp is the jsp file that is going to handle all the send email logic using standard java libraries.

Notice that it is very important that this mailTemplate.jsp file should exist in the current Jahia template set project, but should not exists in the templates.xml file declaration like shows the following configuration file.


<templates default="home" homepage="Home">
    <template name="home" display-name="Home page" filename="home.jsp" page-type="my_templates:home"/>
   <template name="twoColumns" display-name="Two Columns" filename="twoColumns.jsp" page-type="my_templates:twoColumns"/>
</template-set>


Following is a screenshot of an Email template, where you can enter the source and destination e-mail, a subject, a text field where you can include a note to the e-mail, and the name of the page.

ajax rotator
Recent Posts

RSS feeds
Tag cloud
Sitecore Active Directory oms Dynamic Data css CMS Training marketing open source content management los angeles optimization portal sitecore online marketing suite, online marketing suite geo APC sitecore ECM EPiServer java concrete5 architecture iphone icefaces presentation layer open text web solutions reddot modules web marketing code design CTA linux Actionscript 3 JSR-168 facebook developers deployment web3.0 ASP.NET MVC web design los angeles website design los angeles search engine content management whitepaper url mobile multilingual mashups mashup mashware consulting liferay Acquia content management white paper cloud performance E-commerce communicating cluster redundant database structure Visual Basic LiveServer integration theming EPiServer Active Directory print AS3 oshyn open text management server foursquare WCM Design Patterns online marketing editing content frontend optimization fbml management command line Business Users call to action SEO VPP drush wcm web services Solr opentext web content management Delivery Server Active Directory content authors reddot cms higher education content mangement twitter web marketing for dummies SMM thoughts drools licencing open text delivery server lead management google google search appliance Marketing Automation project management Visual Studio Live Server html boost location Sitecore open text liveserver ubuntu profile box social media scalability sitecore devices ui LS reddot white paper jquery Flash asp sitecore user group MVC web evolution Web development php Ubuntu Server Database cms white paper ajax jahia wcm campaigns Ubercart javascript content authoring jquery, jquery plugin inbound marketing CMS lead generation ASP.NET VB HubSpot sales 2.0 GIS facebook CMS usability development reddot cms content management systems plugin higher education RFP jahia cms ipc web design Navigation reddot higher education sitecore email campaign manager new sites php5 rdbs google maps template design .net social 2.0 tools templating Drupal CRM data access Maven software design open-source IT Investment tuckey release management VS2010 ajax push geographical search suggest reddot whitepaper open text google analytics web2.0 cms whitepaper sitecore meetup target dynament GSA webcomponent Sharepoint design lucene social network LDAP open text cms facebook app, OS 3.0, three20 postgis keywords cms los angeles, content management los angeles, web development los angeles, website design los angeles, web design los angeles, sitecore meetup, sitecore user group memcache multisite keyword selection design patterns portlets spatial dynament profile tab OO Development jsp configuration management sitecore oms Jahia cloud computing sitecore layout IIS cms los angeles cookie-free domain Velocity web development los angeles missing images enterprise friendly url google appEngine tuning industry challenges patterns mysql
2010 Copyright Oshyn. All rights reserved.