You are here: start » newsboxes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

newsboxes [2013/05/01 02:09]
Christoph M. Becker [Adding the Newsbox to the Template]
newsboxes [2018/10/26 15:33]
Line 1: Line 1:
-====== Newsboxes ====== 
  
-A feature of CMSimple_XH is the possibility to display the content of another CMSimple page (the "news page") as a so called "​newsbox",​ e.g. in a sidebar outside the regular contents area. 
- 
-Since the page which provides the content of the newsbox should usually not be listed in the navigation, it is possible to "​hide"​ it from the navigation. 
- 
-Using a newsbox is basically the same as inserting the contents of the newsbox directly in the template; the advantage of using a newsbox is, that the contents can be edited more easily afterwards. If you want to show different content in a newsbox for each page, you may want to use [[http://​3-magi.net/?​CMSimple_XH/​Coco_XH|Coco_XH]]. 
-===== Creating a News Page ===== 
- 
-Create a CMSimple page, e.g. named "​News02"​. Insert all the content that you want to appear in the newsbox as usual. From CMSimple_XH 1.5 onwards it is even possible to use [[cmsimple_scripting|CMSimple Scripting]] in newsboxes. 
- 
-===== Hiding the News Page ===== 
- 
-Hide the content page (=newspage) of the newsbox from the navigation by choosing: 
- 
-  * Page => Pageparameters => Show in menu? => no.  
- 
-Alternatively you can put the following code anywhere on the page, preferably directly below the heading: 
-<​code>#​CMSimple hide#</​code>​ 
- 
-===== Adding the Newsbox ===== 
- 
-Integrate the newsbox into your template by entering the following code just where you want the newsbox to appear: 
- 
-<code php> 
-<?php echo newsbox('​News02'​);?>​ 
-</​code>​ 
- 
-If you want to syle your newsbox(es) via CSS, you can embed the newsbox in HTML divs with CSS classes: 
- 
-<code html> 
-<div class="​news">​ 
-<div class="​newsin">​ 
-<?php echo newsbox('​News01'​);?>​ 
-</​div>​ 
-</​div>​ 
- 
-<div class="​news">​ 
-<div class="​newsin">​ 
-<?php echo newsbox('​News02'​);?>​ 
-</​div>​ 
-</​div>​ 
- 
-<div class="​news">​ 
-<div class="​newsin">​ 
-<?php echo newsbox('​News03'​);?>​ 
-</​div>​ 
-</​div>​ 
-</​code>​ 
- 
-Define the classes .news and .newsin in the stylesheet.css of your template with the desired CSS attributes. 
- 
-Note that the double <​div>​s are meant to cater for the different box model in old versions of IE (< 6). Setting widht/​height for the outer, and border/​padding only for the inner <div> will make your newsbox look the same in different browsers. Nowadays it seems IE 5.5 is gone, so probably you can do with a single <​div>​. 
- 
-===== Deleting the Newsbox from the Template ===== 
- 
-Simply delete the code for the newsbox in the template together with all surrounding divs. Depending on your template the code may look different, the above code being just an example. 
- 
-And don't forget to delete the related newspage from the content (except when you're planning to reuse it). 
 
You are here: start » newsboxes
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.3
Valid XHTML 1.0 Valid CSS Driven by DokuWiki