<%@ page import="org.opencms.file.*, org.opencms.jsp.*, org.opencms.xml.content.*, org.opencms.frontend.layoutpage.*" %><%-- --%><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><% CmsJspActionElement cms = new CmsJspActionElement (pageContext, request, response); // get the XML content file that contains the page paragraphs to render CmsFile xmlFile = cms.getCmsObject().readFile(cms.getRequestContext().getUri()); CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cms.getCmsObject(), xmlFile); // initialize the layout bean with the current display variant, body width, paddings and spacings CmsLayoutPageBean layoutBean = new CmsLayoutPageBean(cms, xmlContent, "common", 950, 4, 8); // add default layout patterns to use, use layoutBean.addLayoutPattern("name_of_pattern", "image_width_variant"); // the image width variant can be CmsLayoutPageBean.IMG_WIDTH_LARGE, CmsLayoutPageBean.IMG_WIDTH_MEDIUM or CmsLayoutPageBean.IMG_WIDTH_SMALL layoutBean.createDefaultLayoutPatterns(); // If using other layout patterns for your template, uncomment the line below // and set the VFS path to the folder containing your own layout files. // layoutBean.setPathLayoutElements("/absolute/path/to/your/macros/"); // set fixed image sizes to use for the welcome template, otherwise image sizes would be dynamically calculated layoutBean.setFixedImageSize(true); if (layoutBean.getColumnLayout().indexOf(CmsLayoutPageBean.COLUMNS_LAYOUT_2) != -1) { // 2 columns, set image widths layoutBean.setImgWidthSmall(150); layoutBean.setImgWidthMedium(250); layoutBean.setImgWidthLarge(475); } else { // 1 column, set image widths layoutBean.setImgWidthSmall(200); layoutBean.setImgWidthMedium(350); layoutBean.setImgWidthLarge(950); } String template = cms.property(CmsPropertyDefinition.PROPERTY_TEMPLATE, "search", "/system/modules/org.opencms.welcome/templates/welcome"); cms.include(template, "head"); %><%= layoutBean.buildHtmlParagraphs() %><% cms.include(template, "foot"); %>