Link to home
Start Free TrialLog in
Avatar of Daniish
DaniishFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do i modify my template to make it longer when necessary?

Hello,

At present i'm intending to use the attached code snippet to form a template for adding blog entries on my site.

However, because some blog entries will be much longer than others i would like to know how this code can be modified so that i can add another image and several lines of text e.g.

<img style="float:left" src="someimage.jpg" />
<p>Some more text</p>
<p>Some more text</p>
<p>Some more text</p>

So perhaps initially the template would start with just the above (1 pic & several lines of text) and then i could click a button to 'add more'...

Hope you understand me & many thanks for your help
<div> 
<img style="float:left" src="someimage.jpg" /> 
<p>Some text</p>
<p>Some more text</p>
<p>Some more text</p>
<img style="float:right" src="someimage.jpg" /> 
<p>Some more text</p>
<p>Some more text</p>
<p>Some more text</p>
<img style="float:left" src="someimage.jpg" /> 
<p>Some more text</p>
<p>Some more text</p>
<p>Some more text</p>
</div>

Open in new window

Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

That code should stretch to fit the content.  There is nothing there that restricts height in any way.
Avatar of Daniish

ASKER

No, but as it stands the template would only allow 3 images to be added - what if my blog is long enough to encompass 5 images and supporting text - surely the template would be restrictive?
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Daniish

ASKER

Fair point well made, i guess i'm asking how i can build a dynamic template that can be of any length - following the structure laid out above... depending on how much i have to write about a particular place.

There's probably an easy solution for this that i have yet considered :p
How will the template be called?  What scripting environment will you be supporting?
Avatar of Daniish

ASKER

My form uses the WYSISWYG FCKeditor:
http://www.fckeditor.net/

.. with which it is possible to create and use templates:
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Templates

.. supporting these integrations (presumably scripting environments) pref. php or javascript:
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide


 
Okay, now we're getting somewhere.  

When you use the Template button on the toolbar, does it overwrite the existing contents?
Avatar of Daniish

ASKER

Yes. When you select a template it overwrites the existing contents, even if this is another template.
Avatar of Daniish

ASKER

I need to learn to start off with something simple and gradually increase the complexity. I'm not going to use a template for the time being just hardcode what i need, marking up the images that i need.

Thanks for your help