[Pro] ExpressionEngine Source Formatting

First time on the Dynamo list, I think. My question is somewhat of an anal formatting issue. Currently I’m working on a publication (magazine) site and I have a list of the most recent 5 articles for each of the three publications. To show that, and this may have something to do with it, I’ve embedded a unordered list that looks like this:

<ul id="recent">
	{exp:weblog:entries weblog="publication" limit="5" dynamic="off"}
	<li><a href="{title_permalink="articles/publication"}" title="View This Article"></a></li>
	{/exp:weblog:entries}
</ul>

and am using it as an embedded template since I couldn’t find a way to get the EXP tags inside the UL tag. So, I drew out an HTML item unto my page, attached the Crowbar action to the item, and then embedded the tag using:

{embed="embeds/recent-list"}

with the drop-down option set to beginning.

So my question is, when I go and publish the site and view it in Safari (or any browser for that matter) the embedded template breaks the indenting of the formatted source code so instead of looking like:

<div id="recent-list" style="...">
	<ul id="advertise">
		<li>Item1</li>
		<li>Item2</li>
		<li>Item3</li>
		<li>Item4</li>
		<li>Item5</li>
	</ul>
    </div>

it looks like this:

<div id="recent-list" style="...">
	<ul id="advertise">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
<li>Item5</li></ul>
    </div>

(actually it’d be flush-left with the left part of the view source window with the LI items, but the forum preview wouldn’t show that)

It’s been bugging me and I guess another add-on question would be, is this method the best way to do what I’m trying to do or is there a better way to do this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I don’t think you can fix this from in Freeway. Your PHP (EE) code has
to do this formatting trick for you, because it’s outputting the
variable text. If you had some way to tell EE to put a couple of tabs
out before each line, you could make this line up for “pretty-
printing” code, but I don’t know if that’s something you can do or
not. Basically, though, once you add that tag to your Freeway page,
you’re just saying “put your code here”, and there’s no way to signal
back to the code engine where “here” is. You’re lucky it includes line-
breaks – some engines don’t even do that.

Walter

On Jun 16, 2009, at 5:25 PM, Dan J wrote:

First time on the Dynamo list, I think. My question is somewhat of
an anal formatting issue. Currently I’m working on a publication
(magazine) site and I have a list of the most recent 5 articles for
each of the three publications. To show that, and this may have
something to do with it, I’ve embedded a unordered list that looks
like this:

<ul id="recent">
	{exp:weblog:entries weblog="publication" limit="5" dynamic="off"}
	<li><a href="{title_permalink="articles/publication"}" title="View  
This Article"></a></li>
	{/exp:weblog:entries}
</ul>

and am using it as an embedded template since I couldn’t find a way
to get the EXP tags inside the UL tag. So, I drew out an HTML
item unto my page, attached the Crowbar action to the item, and then
embedded the tag using:

{embed="embeds/recent-list"}

with the drop-down option set to beginning.

So my question is, when I go and publish the site and view it in
Safari (or any browser for that matter) the embedded template breaks
the indenting of the formatted source code so instead of looking like:

<div id="recent-list" style="...">
	<ul id="advertise">
		<li>Item1</li>
		<li>Item2</li>
		<li>Item3</li>
		<li>Item4</li>
		<li>Item5</li>
	</ul>
   </div>

it looks like this:

<div id="recent-list" style="...">
	<ul id="advertise">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
<li>Item5</li></ul>
   </div>

(actually it’d be flush-left with the left part of the view source
window with the LI items, but the forum preview wouldn’t show that
)

It’s been bugging me and I guess another add-on question would be,
is this method the best way to do what I’m trying to do or is there
a better way to do this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks that works, I appreciate your feedback, have a nice day!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I Really would have a hard time answering your question!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

thanks for all of you input that help!
On Jun 16, 2009, at 6:21 PM, Walter Lee Davis wrote:

I don’t think you can fix this from in Freeway. Your PHP (EE) code
has to do this formatting trick for you, because it’s outputting the
variable text. If you had some way to tell EE to put a couple of
tabs out before each line, you could make this line up for “pretty-
printing” code, but I don’t know if that’s something you can do or
not. Basically, though, once you add that tag to your Freeway page,
you’re just saying “put your code here”, and there’s no way to
signal back to the code engine where “here” is. You’re lucky it
includes line-breaks – some engines don’t even do that.

Walter

On Jun 16, 2009, at 5:25 PM, Dan J wrote:

First time on the Dynamo list, I think. My question is somewhat of
an anal formatting issue. Currently I’m working on a publication
(magazine) site and I have a list of the most recent 5 articles for
each of the three publications. To show that, and this may have
something to do with it, I’ve embedded a unordered list that looks
like this:

<ul id="recent">
	{exp:weblog:entries weblog="publication" limit="5" dynamic="off"}
	<li><a href="{title_permalink="articles/publication"}" title="View  
This Article"></a></li>
	{/exp:weblog:entries}
</ul>

and am using it as an embedded template since I couldn’t find a way
to get the EXP tags inside the UL tag. So, I drew out an HTML
item unto my page, attached the Crowbar action to the item, and
then embedded the tag using:

{embed="embeds/recent-list"}

with the drop-down option set to beginning.

So my question is, when I go and publish the site and view it in
Safari (or any browser for that matter) the embedded template
breaks the indenting of the formatted source code so instead of
looking like:

<div id="recent-list" style="...">
	<ul id="advertise">
		<li>Item1</li>
		<li>Item2</li>
		<li>Item3</li>
		<li>Item4</li>
		<li>Item5</li>
	</ul>
  </div>

it looks like this:

<div id="recent-list" style="...">
	<ul id="advertise">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
<li>Item5</li></ul>
  </div>

(actually it’d be flush-left with the left part of the view source
window with the LI items, but the forum preview wouldn’t show that
)

It’s been bugging me and I guess another add-on question would be,
is this method the best way to do what I’m trying to do or is there
a better way to do this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options