[opgelost] Background-image

Nederlandse ondersteuning voor CMS Made Simple

Moderator: velden

Post Reply
Haghorst
Forum Members
Forum Members
Posts: 49
Joined: Wed Oct 03, 2007 8:31 am

[opgelost] Background-image

Post by Haghorst »

Goedemiddag,

Voor een website wil ik graag per pagina een andere background-image gebruiken. Is het mogelijk dat deze background-image makkelijk aan te passen is door de eindgebruiker, niet dat de gebruiker in de code hoeft te duiken maar slechts een foto hoeft up te loaden via het adminpaneel?

Hier een voorbeeld van zo'n website met een grote background-image:
http://www.gilesrevell.com/

Alvast bedankt!

Groeten,
Ruud
Last edited by Haghorst on Tue Sep 18, 2012 12:28 pm, edited 1 time in total.
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: Background-image

Post by pedes »

Haghorst
Forum Members
Forum Members
Posts: 49
Joined: Wed Oct 03, 2007 8:31 am

Re: Background-image

Post by Haghorst »

Bedankt :)
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Background-image

Post by velden »

En wat te denken van de 'content_image' tag?
Standaard aanwezig en verschijnt meteen in de gebruiker hoeft niet naar de Options tab te klikken om het aan te passen.

Ik gebruik het zelf vaak voor foto's in de header van de pagina's.

Meer info via CMS -> Extensions -> Tags
Help for the content_image tag Help (new window)
What does this do?

This plugin allows template designers to prompt users to select an image file when editing the content of a page. It behaves similarly to the content plugin, for additional content blocks.

How do I use it?

Just insert the tag into your page template like: {content_image block='image1'}.

What parameters does it take?

(required) block - The name for this additional content block.
Example:

{content_image block='image1'}

(optional) label - A label or prompt for this content block in the edit content page. If not specified, the block name will be used.
(optional) dir - The name of a directory (relative to the uploads directory, from which to select image files. If not specified, the uploads directory will be used.
Example: use images from the uploads/images directory.

{content_image block='image1' dir='images'}

(optional) class - The css class name to use on the img tag in frontend display.
(optional) id - The id name to use on the img tag in frontend display.
(optional) name - The tag name to use on the img tag in frontend display.
(optional) width - The desired width of the image.
(optional) height - The desired height of the image.
(optional) alt - Alternative text if the image cannot be found.
(optional) urlonly - output only the url to the image, ignoring all parameters like id, name, width, height, etc.
(optional) assign (string) - Assign the results to a smarty variable with that name.
Haghorst
Forum Members
Forum Members
Posts: 49
Joined: Wed Oct 03, 2007 8:31 am

Re: Background-image

Post by Haghorst »

Ik heb een sjabloon aangemaakt met de 'content_image' tag:
{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>{sitename} - {title}</title>
{metadata}
{cms_stylesheet}
</head>
</__body>
<div>
{content_image block='afbeelding1' dir='images/achtergronden' id='background'}
</div>
<div id="container">
<div id="logo">
<a id="logolink" href="http://www.vangestelhoveniers.nl/cms">&nbsp;</a>
</div>
<div id="headertitle">
<div id="headertitle_tile">
<div id="headertitle_bg"></div>
<h1>{content block="Koptitel1"}</h1>
<h2>{content block="Koptitel2"}</h2>
</div>
</div>
<div id="menu">
{menu template="Menu_green"}
</div>
<div id="content">
<div id="content_content">
<h1>{title}</h1>
{content}</div>
</div>
<div class="push"></div>
</div><div id="fotos">
</div>
<div id="footergreen">
<div id="footerdiv">
--
</div>
</div>
<__body>
</__html>
In de map uploads/images/achtergronden heb ik enkele images geupload via FileZilla. Ik kan ze ook selecteren wanneer ik een pagina aan maak.

Echter pakt hij hem niet:
http://vangestelhoveniers.nl/cms/index.php?page=wie

Bij de home pagina http://vangestelhoveniers.nl/cms/ pakt hij hem wel.
Iemand enig idee?

Dit is de templatecode van de home pagina:
{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>{sitename} - {title}</title>
{metadata}
{cms_stylesheet}
</head>
</__body>
<div>
{content_image block='Achtergrond' dir='images/achtergronden' id='background'}
</div>
<div id="container">
<div id="logo">
<a id="logolink" href="http://www.vangestelhoveniers.nl/cms">&nbsp;</a>
</div>
<div id="headertitle01">
<div id="headertitle_tile01">
{content block="Koptitel"}
</div>
</div>
<div id="menu">
{menu template="Menu_green"}
</div>
<div id="content">
{content}
</div>
<div class="push"></div>
</div><div id="fotos">
</div>
<div id="footergreen">
<div id="footerdiv">
--
</div>
</div>
<__body>
</__html>
UPDATE: OPGELOST
Ik heb ipv 'id' een 'class' gebruikt, dan werkt het wel.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Background-image

Post by Rolf »

Werkt inderdaad keurig! ;)

Wil je nog even [opgelost] in de titel van de eerste post zetten?

Bedankt,
Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Dutch - Nederlands”