Call content() with parameter

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Call content() with parameter

Post by Tata » Fri Jun 09, 2017 8:15 am

Solving another issue I think about the way to use the content(); function with a parameter. The purpose is to have e.g. some general content.htm file and other ones named e.g. my_content_1.htm, my_content_2.htm, my_content_3.htm and use it in the function e.g.>

Code: Select all

<?php content('path_to_my_chosen_content_file');?>
I can imagine using this feature while presenting various templates at a webpage without a need of separate multiple installations or having individual content for each presented template. But sure, there are many other purposses for using such feature.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Call content() with parameter

Post by cmb » Fri Jun 09, 2017 9:09 am

Tata wrote:Solving another issue I think about the way to use the content(); function with a parameter. The purpose is to have e.g. some general content.htm file and other ones named e.g. my_content_1.htm, my_content_2.htm, my_content_3.htm and use it in the function e.g.>

Code: Select all

<?php content('path_to_my_chosen_content_file');?>
This way it would not be possible to edit the contents of the other content files.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Call content() with parameter

Post by Tata » Sat Jun 10, 2017 5:06 pm

cmb wrote:This way it would not be possible to edit the contents of the other content files.
This would not be that big problem. The purpose is maybe too specific - so far I thought only about using it with a templates gallery. Creating a list of links (or a simple gallery with linked thumbs) would allow to load the same file always with another template.
Themeswitcher is fine. But I don't know how to use it on a "templates gallery page".
A little "semi-solution" is right now tested on http://169new.cmsimple.sk/rr/. I would be happy to have the demos shown with e.g. the standard demo content.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Call content() with parameter

Post by cmb » Sun Jun 11, 2017 12:51 pm

Tata wrote:Themeswitcher is fine. But I don't know how to use it on a "templates gallery page".
Unfortunately, that is not possible, because I had changed the GET request to a POST request (probably for no good reason :oops:).

If the request were a GET request, you could easily link an URL (similar to the technique described in another thread).

I shall fix that as soon as possible.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply