This topic is locked

Useless   elements and other HTML Formatting issues

3/20/2008 3:05:07 PM
PHPRunner General questions
S
spintz author

Here's an excerpt from near the top of a list page in HTML view in the Visual Editor -

...

<BODY topMargin=5

{$onload}>{$includes}{include_if_exists file="include/header.php"}&nbsp;

<FORM name=frmSearch

...


Notice the - &nbsp; - just ebfore the frmSearch FORM. Why? There are various &nbsp;'s put throughout the code and they force space to be taken up, where it doesn't need to be. These in particular, put useless, screen-real-estate wasting lines at the top of each page. I've deleted them from the HTML view, but they pop back in. I've checked in the template files and they aren't there, they are being added by the code and are driving my nuts.
Also, it's driving me nuts, how the HTML code is indented and where the line breaks are inserted. It's very hard to read. It doesn't line break after an element, but rather, almost always and intentionally, in the middle of elements. Is there any way to disable the auto-formatting of the HTML code from the Visual Editor or will this hopefully improve in future versions?

S
spintz author 3/26/2008

Bump. Any ideas on this? I can live with the HTML Formatting, but the &nbsp; elements that get thrown in are taking up valuable screen real estate (and aren't consistent between pages).

Sergey Kornilov admin 3/26/2008

Those &nbsp; are added by Internet Explorer HTML editing engine that powers Visual Editor. There is nothing you can do about this.

S
spintz author 3/26/2008

Those &nbsp; are added by Internet Explorer HTML editing engine that powers Visual Editor. There is nothing you can do about this.


That's terrible <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=27353&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

S
spintz author 3/26/2008

I've got another issue -
I have added this code to a list page -

{if $user_role != 0}

<B>User Filter : </B>

{if $userfilter}

<LABEL><INPUT type=radio CHECKED name=userfilter>On</LABEL>

<LABEL><INPUT onclick="window.location.href='requests_list.php?userfilter=0';" type=radio name=userfilter>Off</LABEL>

{else}

<LABEL><INPUT onclick="window.location.href='requests_list.php?userfilter=1';" type=radio name=userfilter>On</LABEL>

<LABEL><INPUT type=radio CHECKED name=userfilter>Off</LABEL>

{/if}

{/if}


When I got to Visual Editor GUI and then back to HTML View, it gets changed to this -

{if $user_role != 0}<B>User Filter :

</B>{if $userfilter}<LABEL><INPUT type=radio

name=userfilter>On</LABEL> <LABEL><INPUT

onclick="window.location.href='requests_list.php?userfilter=0';"

type=radio name=userfilter>Off</LABEL>

{else}<LABEL><INPUT

onclick="window.location.href='requests_list.php?userfilter=1';"

type=radio name=userfilter>On</LABEL> <LABEL><INPUT type=radio

CHECKED name=userfilter>Off</LABEL> {/if}{/if}


I've already covered how that formatting is, well, you can't even call it formatting, it's a mess. But anyways, the problem is the CHECKED option for the first INPUT has been removed. It leaves the 2nd, but wipes out the first. Is this a bug, or am I going to have to do everything with "Insert PHP Code Snippet" and use events?
If the answer to this is to use custom events for everything, may I request a feature change? Can we disable the Visual Editor, and make it "read-only". So we can get a reference view for the changes we're making without building, but so that it won't keep screwing up our code?

S
spintz author 4/3/2008

Here's another problem... Here's a diff of a list file -

< autocomplete="off" {$search_searchfor}> &nbsp; <SPAN

-> {$search_searchfor} autocomplete="off"> &nbsp; <SPAN


The visual editor just randomly swaps values. If I commit this change, then later on down the road, it will swap them again, and my TortoiseSVN shows a modified file, even though I did nothing!
This Visual Editor saves time, but I really never use it to modify the template, I only use it as a visual cue of the code changes I made, which saves me from having to build the project. Please, please, please, please give us the option to make this editor Read-Only, it's killing my productivity in so many ways.

J
Jane 4/4/2008

Thank you for your remarks.

We plan to make a lot of changes in the Visual Editor in the next version of PHPRunner.

S
spintz author 4/4/2008

Thank you, can't wait!

S
spintz author 4/14/2008

Is this update coming anytime soon? I've run into an issue where using a function to exectue PHP code does not work ---
I'm trying to embed the stylesheet data for emails to look like the view pages, so in the view page for one of my tables I'm trying to change the top of the file to :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>WKRPs</TITLE>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META content="MSHTML 6.00.6000.16640" name=GENERATOR>

{if $foremail}

{doevent name="requests_EmbedStyleSheet"}

{else}

<LINK href="include/style.css" type=text/css rel=stylesheet>

{/if}

</HEAD>

<BODY bgColor=white>


After changing to the Visual Editor and back (as I always do now, because Visual Editor nearly ALWAYS screws up my code), I end up with this :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>WKRPs</TITLE>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META content="MSHTML 6.00.6000.16640" name=GENERATOR>{if $foremail}</HEAD>

<BODY bgColor=white>{doevent name="requests_EmbedStyleSheet"} {else}<LINK

href="include/style.css" type=text/css rel=stylesheet>{/if}


It's just really screwed up, creates 2 META content GENERATOR tags, moves code in/out of the {if}{else}{/if} blocks. It's just destroying the code. So now, everytime I build my project, I need to manually update this code, and build without going to the Visual Editor, or the page will be messed up.
I was able to get around this by moving the {if}{else}{/if} code into the <BODY> element. However, this is not proper HTML and the stylesheet data should be inside of the <HEAD></HEAD> element. It's working for now, but I'm not liking this solution.
At least a quick option to disable the Code Generator or something?