Solved

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

Posted on 2008-06-24
9
155 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now