[opencms-dev] Template One Example for News page
twinkle
fourrz at yahoo.com
Tue May 23 22:30:36 CEST 2006
I saw this mail in the archive mailing list for the news build page.
I am trying to get the news page working like the example in the demo folder.
I followed all the steps given here by Deiverson. When I click on the index.html file, I get error
Error reading resource from path "/modules/news/"
Reason: Unable to read resource "/modules/news/"
Please help. Should I edit any XML page or make any other changes? What am I missing?
Please help.
-Twinkle
Does anyone have or could post an example of templateone for news. A "how to" would be very wellcome. I'm intending to build a microsite that shows the news created in a subfolder. After a hard time trying I'll describe what I did: 1 - I First created a project and changed its type to "Microsite". 2 - Than created a main_test.jsp, inside the fonder /system/myproject/template/ similar to /system/modules/org.opencms.frontend.templateone/templates/main.jsp 3 - Rebuild the main_test.jsp (based on main.jsp) to show only the news and got to this result: <%@page buffer="none" session="false" import="java.util.*, org.opencms.frontend.templateone.*" %><% // initialize action element to access the API CmsTemplateBean cms = new CmsTemplateBean(pageContext, request, response); String resPath = cms.getResourcePath(); %> <% cms.editable(true); %> <link href="<%= cms.getStyleSheetUri(resPath, cms.getStyleSheetConfigUri(),
cms.getRequestContext().getSiteRoot(), cms.getRequestContext().getLocale()) %>" rel="stylesheet" type="text/css"> <% cms.buildHtmlBodyEnd(); %> 3 - Created a page index.html in /myproject/ and set the template main_test.jsp. Still, I had to set the following properties to make it work: layout.right = /system/shared/templateone/right/news (No content or properties. Didn't get what is this for) template = /system/modules/br.com.oriens/templates/main_teste.jsp 4 - Copied the folder /modules/ from /sites/default/modulesdemo/ to /myproject/. Here is the structure: -> /myproject/ ->/modules ->/news/all news ->index.html I tryied this first: -> /myproject/ ->/news/all news ->index.html But didn't work. 5 - Copied the files foot_links.jsp and nav_head_menus.jsp from /system/modules/org.opencms.frontend.templateone/elements/ to /system/meuprojeto/elements/, cause main_test.html require them. (I believe it's because the
import of org.opencms.frontend.templateone.*). 6 - So when I run /myproject/index.html the /system/meuprojeto/template/main_test.jsp works fine with the foot_links.jsp and nav_head_menus.jsp both in /system/meuprojeto/elements/ and shows the news from /myproject/modules/news/. When I add more news, they are included correctly in /myproject/modules/news/ 7 - I checked the /system/modules/org.opencms.frontend.templateone.modules/elements/list_news_right.jsp, which is loaded to (putted an alert("ok") and confirmed that it really passes through this page) and in the line: String folder = request.getParameter("folder"); The folder value is "/modules/news/". Where this came from? I'd like to change this value to "/news/" to change my project structure to: -> /myproject/ ->/news/all news ->index.html Is this ok? Will be necessery to put the list_news_right.jsp inside /system/myproject/elements/. Who and how it refers to the file
list_news_right.jsp? It shows only the last 5 news. Where can I configure this? Couldn't find tha page or property that controls this behavior. Still, why the files foot_links.jsp and nav_head_menus.jsp are required and who calls them. I have found a sample site in the docs but not the procedures to create a new project. I'd like to have the following structure: -> /myproject/ ->/news/all news ->index.html -> /system/ ->/meuprojeto/ ->/elements/news.jsp (containing list_news_right.jsp, foot_links.jsp and nav_head_menus.jsp) ->/templates/main_test.jsp Does anyone can help? I believe that an example of a site that only shows news would make easier to understand and use the code to other projects. ############################## Deiverson Silveira Programador Java/JSP www.oriens.com.br ##############################
---------------------------------
Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2ยข/min with Yahoo! Messenger with Voice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060523/273de60a/attachment.htm>
More information about the opencms-dev
mailing list