NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
XHTML shortcut inserts


Joined: 15 Jan 2007
Posts: 18
Reply with quote
Can we have the option to use XHTML shortcut inserts rather than HTML (<strong> instead of <b>, <em> instead of <i>, etc...) to speed up writing of w3c compliant pages ? I tried doing this with autocorrect but it doesn't work (ie autocorrect <b> to <strong> as I type).
View user's profileFind all posts by martinjstevenSend private message
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
This would be very helpful for myself and my team.
View user's profileFind all posts by rudderSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
I'd like to see support for XHTML in general be improved. For instance, there should be XHTML templates pre-installed along with HTML, the tag closing feature (ctrl-shift-space) should recognize when a tag is an XML-style compact tag (i.e., concludes with " />") and not try to close it instead of the next tag up, and the tools should insert XHTML-compliant code. Perhaps a mode switch for XHTML versus HTML mode is warranted....
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website


Joined: 06 Feb 2007
Posts: 8
Reply with quote
Agreed, i found it very surprising that the phped had no support for this considering most things about it are really well done
View user's profileFind all posts by ryanjhawkinsSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
I'd only have to note that XHTML 1.0 is as equally w3c-compliant as HTML 4.0.1.
and I agreed with the remaining part.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Feb 2004
Posts: 93
Reply with quote
dmitri wrote:
I'd only have to note that XHTML 1.0 is as equally w3c-compliant as HTML 4.0.1.
and I agreed with the remaining part.


true, but its hard to write an XHTML w3c compliant page when the IDE keeps inserting HTML 4.0 structured elements Wink
View user's profileFind all posts by gilzowSend private messageAIM Address


Joined: 06 Feb 2007
Posts: 8
Reply with quote
Some sort of intelligence to insert the correct type of code based on the doctype of the page would be a good idea i think, if it's HTML 4.0.1 then use <b> etc, if it's XHTML 1.x then use <strong> etc.
In my experience (of the past few companies i've worked for), all their designers stopped using the HTML 4.0.1 tags a long time ago and switched to XHTML 1.x type tags.

It's like saying that table-based layouts are just as w3c-compliant. Well yes, they'll validate and technically be w3c-compliant - but, as a designer, you just don't do it any more.

I know that this is PhpEd and is used by developers. But us developers are usually bound by what the designer has created...
View user's profileFind all posts by ryanjhawkinsSend private message


Joined: 24 Jan 2008
Posts: 26
Reply with quote
ryanjhawkins wrote:
Some sort of intelligence to insert the correct type of code based on the doctype of the page would be a good idea i think, if it's HTML 4.0.1 then use <b> etc, if it's XHTML 1.x then use <strong> etc.
In my experience (of the past few companies i've worked for), all their designers stopped using the HTML 4.0.1 tags a long time ago and switched to XHTML 1.x type tags.

It's like saying that table-based layouts are just as w3c-compliant. Well yes, they'll validate and technically be w3c-compliant - but, as a designer, you just don't do it any more.

I know that this is PhpEd and is used by developers. But us developers are usually bound by what the designer has created...


I second that idea. There's already dynamic syntax highlighting in place, this could work on the same principle.
View user's profileFind all posts by ygirouardSend private message


Joined: 24 Mar 2010
Posts: 3
Reply with quote
This might be an old thread, but it seems this feature has not been added yet. I have, however, managed to work around this and get the desired effect.

In my case, I wanted to use Ctrl+Shift+B to get <strong></strong> tags instead of <b></b> and likewise for <em> => <i>.
The following steps got it to work for me.

1. Go to Tools>Settings

2. Select 'Editor Shortcuts' and scroll right down to the 'HTML Tags' section.
3. Remove the shortcuts for <b> and <i>

4. Select 'Code Templates' on the left, click the 'Language' dropdown and select 'HTML'.
5. 'Add' a new template, call it 'strong' or something. In the code box on the right enter: <strong>|</strong>
NOTE: the pipe character (|) will insert whatever code you have highlighted when you use this template Smile
6. Click the shortcut field for this template and press Ctrl+Shift+B (or whatever you like to use - this is to replace the default shortcut)

7. Repeat steps 5 & 6 for <em>

Done. Obviously you can use this for any other tags you feel are missing.

Test it out!
View user's profileFind all posts by mwottonSend private message


Joined: 24 Jan 2008
Posts: 26
Reply with quote
dmitri wrote:
I'd only have to note that XHTML 1.0 is as equally w3c-compliant as HTML 4.0.1.
and I agreed with the remaining part.


Dmitri: I'm a web designer and I'm currently in the progress of finishing my BCIT Web Technology certificate, and I can tell you that HTML 4 is no longer used in the current industry or at least not by the majority of web designers. Therefore I think it should only be fair that the phpEd IDE uses XHTML tags and syntax by default.

I have spotted several problems with tag insertion (either using the HTML shortcuts from the toolbar, or when drag-dropping elements into HTML such as images and files).

I think an easy way to satisfy both HTML 4 and XHTML 1.x, would be to have DOCTYPE and DTD declaration detection and have the IDE know which type of tags to insert based on that.

For example, if you have this in your page:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


You know you should be using XHTML syntax, and not HTML... And if you're using this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


Then you know it should be HTML...

Another thing I've noticed is regarding relative paths that are generated when you drag & drop a file into XHTML code to create a pre-filled element. I do that a lot with images for example as it puts the right width and height automatically... Thing is, I always have to adjust the src attribute because it's not relative!

For example, if I drag and drop an image that is in my "img" folder in a page that is at the root of my site, the correct src should be "img/image.jpg", but phpEd does "/img/image.jpg". If you are designing a sub-site that is not at the root of your web server, this is a big problem! Paths should ALWAYS be relative to the page calling them.

EDIT: Oh woops! I just noticed I had already commented the same suggestion before in this thread. Sorry for the duplicate, but It needed a good bump anyway. We're now several builds later since this was first posted and the feature is still not in the IDE...
View user's profileFind all posts by ygirouardSend private message


Joined: 21 Nov 2009
Posts: 37
Reply with quote
ygirouard wrote:
dmitri wrote:
I'd only have to note that XHTML 1.0 is as equally w3c-compliant as HTML 4.0.1.
and I agreed with the remaining part.


Dmitri: I'm a web designer and I'm currently in the progress of finishing my BCIT Web Technology certificate, and I can tell you that HTML 4 is no longer used in the current industry or at least not by the majority of web designers. Therefore I think it should only be fair that the phpEd IDE uses XHTML tags and syntax by default.



ygirouard: I think you have been given the wrong information in your course. HTML is still widely used and long from dead, re HTML5. There are different reason for using html vs xhtml and some prefer xhtml because of stricter standards but don't actually know why they are using it. XHMTL was developed for integrating XML and XSLT into your web pages but if you don't use either on your website it makes no difference whether you use a html or xhtml doctype. There are valid reasons for using either doctype and the difference is how your page is served, ie, text/html for HTML or application/xml for XHTML. If you never parse XML or use XSLT stylesheets then there is nothing wrong with sticking to HTML doctype.

If you are new to design, learning XHTML is probably a good standard to learn but don't write off HTML. It still has a future.

mwotton: Thanks, excellent tip. I had already set up code templates but did think to assign a shortcut to it.
View user's profileFind all posts by waynesSend private message


Joined: 24 Jan 2008
Posts: 26
Reply with quote
waynes wrote:
ygirouard wrote:
dmitri wrote:
I'd only have to note that XHTML 1.0 is as equally w3c-compliant as HTML 4.0.1.
and I agreed with the remaining part.


Dmitri: I'm a web designer and I'm currently in the progress of finishing my BCIT Web Technology certificate, and I can tell you that HTML 4 is no longer used in the current industry or at least not by the majority of web designers. Therefore I think it should only be fair that the phpEd IDE uses XHTML tags and syntax by default.



ygirouard: I think you have been given the wrong information in your course. HTML is still widely used and long from dead, re HTML5. There are different reason for using html vs xhtml and some prefer xhtml because of stricter standards but don't actually know why they are using it. XHMTL was developed for integrating XML and XSLT into your web pages but if you don't use either on your website it makes no difference whether you use a html or xhtml doctype. There are valid reasons for using either doctype and the difference is how your page is served, ie, text/html for HTML or application/xml for XHTML. If you never parse XML or use XSLT stylesheets then there is nothing wrong with sticking to HTML doctype.

If you are new to design, learning XHTML is probably a good standard to learn but don't write off HTML. It still has a future.

mwotton: Thanks, excellent tip. I had already set up code templates but did think to assign a shortcut to it.

I have not been missinformed. The course is given at BCIT, and it's the Web Technologies certification. Look it up... HTML5 is far from being supported by the majority of browser (only partially in some) so a good website designer will never opt for this scripting language if he wants his site to be viewed by the widest possible audience. This is why XHTML is much much more widely used than HTML now as a standard. Any good web design company knows this and wouldn't recommend any client to use HTML 4.x standards over XHTML. Period.

You can debate this all you want, but it doesn't change the facts.
View user's profileFind all posts by ygirouardSend private message
XHTML shortcut inserts
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic