Solved

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

Posted on 2008-06-24
9
160 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SP inserts data with order number, then push the rest one order up 11 44
HTML 5 Input Type Numeric 5 32
type of website 13 53
ninja forms fields lay next to each other 1 23
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

751 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