Reply
Template Indentation problem
Old 05-31-2008, 11:35 AM Template Indentation problem
Banned

Posts: 32
For example i have template A

PHP Code:
<div>
       <
ul>
             {
subtemplate B}
       </
ul>
</
div

And subtemplate B is:

PHP Code:
<li>Item 1</li>
<
li>Item 2</li

if i include subtemplate B into A it shows in page source:

PHP Code:
<div>
       <
ul>
              <
li>Item 1</li>
<
li>Item 2</li>
       </
ul>
</
div

Is there any way to achieve this?

PHP Code:
<div>
       <
ul>
             <
li>Item 1</li>
             <
li>Item 2</li>
       </
ul>
 </
div

Last edited by Elenis : 05-31-2008 at 11:52 AM.
Elenis is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-31-2008, 12:11 PM Re: Template Indentation problem
rogem002's Avatar
Webmaster Talker

Posts: 611
Name: Mike
Location: United Kingdom
Yeah, use \t to create a tab using php.

\t Makes a tav
\n Makes a new line (White space)
\r I have no idea what this ones does.

Use these like:
PHP Code:
echo "Hello \t Woah!";

// This should produce
// Hallo    Woah 
__________________
PHP Code:
Add_Talkupation('rogem002'); // Because sharing is awesome! 

Last edited by rogem002 : 05-31-2008 at 12:18 PM.
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 05-31-2008, 12:16 PM Re: Template Indentation problem
Ultra Talker

Posts: 250
I don't see any problem in your code. It is more important are your page working properly? Some browsers can show good preview of your code, some other not.
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 05-31-2008, 02:27 PM Re: Template Indentation problem
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Whitespace doesn't matter in HTML. If you're really concerned about it though do as rogem002 suggested, or don't tab over for {subtemplate B} (have it left aligned) and just tab over only in the actual subtemplate.

\r is carriage return, if I remember right, Mac uses \r for their new lines, Linux uses \n and windows uses \r\n. Mac ignores \n and Linux ignores \r so using \r\n is actually smartest.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 05-31-2008, 04:19 PM Re: Template Indentation problem
upstarter's Avatar
Average Talker

Posts: 26
Name: Starr Horne
This is a path to insanity. Trust me. I've been there.

The inevitable problem is that you'll want to include one template in multiple other templates, each with different indentation levels.
upstarter is offline
Reply With Quote
View Public Profile Visit upstarter's homepage!
 
Reply     « Reply to Template Indentation problem
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13221 seconds with 12 queries