Changing banner image

About the template and stylesheet - and changing the menu
Post Reply
Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Changing banner image

Post by Tata » Fri Jul 25, 2014 7:56 am

It has been discussed here once, but I can't find the thread.
I have a webpage, where I want to see different banners on each page. I have files baner_1.jpg, baner_2.jpg, ...baner_n.jpg prepared in templates/mytemplate/images folder.
I template.htm I adder

Code: Select all

<?php echo tag('img src="' . $pth['folder']['templateimages'] . $headimage.'.jpg"');?>
and on each H1 page e.g.

Code: Select all

{{{$headimage = "banner_1";}}}
But this doesn't work.
I also tried to use morepagedata plugin, but I can't set it correctly. Something is missing in the help file or I do something wrong.

But why this simple way doesn't work?

Using hi_pd_scripting it works, but the variable must be added to each corresponding page.
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.

isometric
Posts: 158
Joined: Thu Jun 12, 2014 8:32 am

Re: Changing banner image

Post by isometric » Fri Jul 25, 2014 8:12 am

The names of the jpg-files are "baner_1" with only one "n".

And the you define $headimage with 2 "nn" in the filename

Code: Select all

{{{$headimage = "banner_1";}}}
in diesem Sinne isometric

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

Re: Changing banner image

Post by cmb » Fri Jul 25, 2014 10:11 am

isometric wrote:And the you define $headimage with 2 "nn" in the filename

Code: Select all

{{{$headimage = "banner_1";}}}
Does this work? I suppose that the scripting will not be evaluated, but instead be displayed in view mode. The plugin call syntax is only to call functions.

You probably need classic CMSimple scripting:

Code: Select all

#CMSimple $headimage = "...";#
Christoph M. Becker – Plugins for CMSimple_XH

lck
Posts: 2967
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Changing banner image

Post by lck » Fri Jul 25, 2014 11:27 am

„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

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

Re: Changing banner image

Post by Tata » Fri Aug 08, 2014 4:22 am

cmb wrote:Does this work? I suppose that the scripting will not be evaluated, but instead be displayed in view mode. The plugin call syntax is only to call functions.
Yes, it works called both as {{{...}}} and by hi_pd_scripting.
http://chateaufeely.cmsimple.sk/
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: Changing banner image

Post by cmb » Fri Aug 08, 2014 5:34 am

Tata wrote:
cmb wrote:Does this work? I suppose that the scripting will not be evaluated, but instead be displayed in view mode. The plugin call syntax is only to call functions.
Yes, it works called both as {{{...}}} and by hi_pd_scripting.
http://chateaufeely.cmsimple.sk/
Um, I've removed the pd_scripting and replaced it with a plugin call on http://chateaufeely.cmsimple.sk/?Vines_ ... _Vineyards. Now the banner is missing on this page.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply