Solved

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

Posted on 2008-06-24
9
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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).

631 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