Solved

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

Posted on 2008-06-24
9
158 Views
Last Modified: 2012-05-05
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

0
Comment
Question by:Daniish
  • 5
  • 4
9 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21860413
That code should stretch to fit the content.  There is nothing there that restricts height in any way.
0
 

Author Comment

by:Daniish
ID: 21861385
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?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 21861398
The problem with your question is that you are not telling us enough about how your template works.  All the above is is HTML in a div.  From looking at the above, if you need more images, just copy/paste the relevant code and change the src property to get another image.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:Daniish
ID: 21861441
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
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21861472
How will the template be called?  What scripting environment will you be supporting?
0
 

Author Comment

by:Daniish
ID: 21861564
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


 
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21861606
Okay, now we're getting somewhere.  

When you use the Template button on the toolbar, does it overwrite the existing contents?
0
 

Author Comment

by:Daniish
ID: 21863557
Yes. When you select a template it overwrites the existing contents, even if this is another template.
0
 

Author Closing Comment

by:Daniish
ID: 31470065
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
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Find out what you should include to make the best professional email signature for your organization.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question