Newsbox management

CMSimple 4.0 und höher
Post Reply
Yerka
Posts: 9
Joined: Thu 21. Jul 2016, 17:11

Newsbox management

Post by Yerka »

Hello. Some templates have hidden pages named "NEWS01", "NEWS02", "NEWS03". Content of this pages is shown in the newsboxes that located near the left (right) border of website. But my website shows only newsbox with the content of page "NEWS01". The website shows this newsbox on all pages of website.

Can I manage, what pages on my website will show the newsbox with content of "NEWS01" and what pages on my website will show the newsbox with content of "NEWS02", "NEWS03"?

Thanks in advance.

Yerka
Last edited by Yerka on Tue 27. Sep 2016, 22:36, edited 1 time in total.
belquant.cf The first website about quantum physics in Belarusian.
Gert
Posts: 2075
Joined: Sun 18. Nov 2012, 14:18

Re: Newsbox management

Post by Gert »

Yerka wrote:Can I manage, what pages on my website will show the newsbox with content of "NEWS01" and what pages on my website will show the newsbox with content of "NEWS02", "NEWS03"?
This is not standard in CMSimple, because it is cmSIMPLE ;)

But there are 2 solutions:


1. Pagedata plugin

https://www.ge-webdesign.de/plugindemo/ ... gedataVars

It's simply to use, but preparing is nothing for beginners, and the help file is in German only.


2. CMSimple Scripting

Write in template.htm:

Code: Select all

<?php 
if(!isset($shown_newsbox)){echo newsbox('News01');}
else {echo newsbox($shown_newsbox);}
?>
Set a variable by CMSimple Scripting anywhere on the page (maybe below the page-headline), if you want to have another newsbox than News01 displayed:

Code: Select all

#CMSimple $shown_newsbox="News02";#
Without this line News01 will be displayed, with this line News02 (or another defined page). This is not effective in edit mode, only in view mode, and of course if you are logged out and for normal visitors,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Yerka
Posts: 9
Joined: Thu 21. Jul 2016, 17:11

Re: Newsbox management

Post by Yerka »

I have unpacked the folder "PagedataVars_1-1" to "plugins" on the site. When I click "Plugins -> PagedataVars_1-1" on the top panel in CMSimple I see empty page. What is the matter?

Dear Gert, could you say in what place of template.htm I should write your script? I have found the following rows:

Code: Select all

<?php echo newsbox('News01');?>
                   <div id="subnav">
I have changed "News01" to "News02" there. Since that moment the content of hidden page "NEWS02" is displaying on the all pages of website. But I want that newsboxes are displayed serially: at first "NEWS01", then "NEWS02". Is this possible?

Yerka
belquant.cf The first website about quantum physics in Belarusian.
Gert
Posts: 2075
Joined: Sun 18. Nov 2012, 14:18

Re: Newsbox management

Post by Gert »

Yerka wrote:I have unpacked the folder "PagedataVars_1-1" to "plugins" on the site.
Have a look about the folder structure of the download and think about it, try to understand, before you upload. Hint: CMSimpleRoot is the location (folder) of your CMSimple installation.

Another good idea would be to read the help file: CMSimpleRoot/plugins/pagedata_vars/help/help.htm (Sorry - German only)
Yerka wrote:could you say in what place of template.htm I should write your script?
Whereever you want to have the Newsbox. I don't know, which template you are using,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Post Reply