Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 32
Trades: 0
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
 
 
Register now for full access!
Old 05-31-2008, 12:11 PM Re: Template Indentation problem
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
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 
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

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
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
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: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
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
Trades: 0
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.
__________________
my company:
Please login or register to view this content. Registration is FREE


my blog:
Please login or register to view this content. Registration is FREE
upstarter is offline
Reply With Quote
View Public Profile Visit upstarter's homepage!
 
Reply     « Reply to Template Indentation problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.65212 seconds with 12 queries