<html> and <head> placeholders
Hi
This is a question for Covoxer I imagine...
I'm experimenting with the <head> and <html> tags and would like to clarify their exact usage.
Please see the attached file. I've created 3 <head> and 3 <html> placeholders. Export the page and open up the html in a text editor.
The <head> placeholders appear in the <HEAD> section as expected but not in the order I would have assumed, given their placement on the design board.
The <html> placeholders appear in the <HEAD> section and not in the <BODY> as I thought they would and again they are not in the order I would have expected.
Cheers
1 Attachment(s)
Re: <html> and <head> placeholders
Attaching the file might help :o
Re: <html> and <head> placeholders
Give objects the name <html> rather than text.
In your example, if you group the page text <html 1> and then name it <HTML> the code in the Replace with HTML area will appear at the top of the page as required.
Re: <html> and <head> placeholders
Hi Sledger
Thanks for your reply but I'm afraid that doesn't tally with my experience of XWD5 and 6 (assuming I've not misunderstood you!).
As far as I can tell having the placeholders as text or an object makes no difference to how Xara treats them - a placeholder is a placeholder whatever it is and if you specify it is to be replaced by HTML then it will be.
This can be demonstrated by my original file - these are text placeholders (named <head> and <html> respectively) and they do correctly get replaced as HTML. But there are 2 issues here:
1) The order of the placeholder's HTML in the output file does not reflect the originating placeholder's position on screen and this is very important - you have to be able to control the order they output.
2) The placeholders named <html> also appear in the <HEAD> portion of the HTML file. Surely these should be in the <BODY> section.
I tried creating placeholders as objects (rectangles) as you suggested but I had the same issue as above, namely the output HTML did not reflect the position of the placeholders.
Sorry for the long reply!
Re: <html> and <head> placeholders
Quote:
Originally Posted by
gpholman
2) The placeholders named <html> also appear in the <HEAD> portion of the HTML file. Surely these should be in the <BODY> section.
No, the <HTML> name was designed to place code at the very beginning of the output, in other words at the TOP of the page (for server side scripts), neither in the head section or body section.
This name feature is new to WD6.
Re: <html> and <head> placeholders
Ok, well it's not doing that for me either.
Re: <html> and <head> placeholders
As mentioned earlier, if you group the text object that you are using as the placeholder, it does work.
Re: <html> and <head> placeholders
Hi,
Quote:
Originally Posted by
sledger
As mentioned earlier, if you group the text object that you are using as the placeholder, it does work.
you must not group the text object. I think there is a little bug with the <html> function.
If you use gpholman's example, you see comment's like <!--HTML 2--> in the html-placeholders with the name <html>. After export or preview all html-code is inserted in the head section. If you put a space between "<!--" and the rest of the comment, the html-code is inserted at the very beginning of the exported html. If you now delete the inserted space (not with the undo function) and export again the html-code is inserted at the very beginning and all is ok the comment is <!--HTML 2--> which not worked with the first step .
Maybe this is fixed if you create the project with the XWD6 6.0.0. 12008. If i create a project from scratch i don't have this problem, but with gpholman's example i see the problem.
Sebastian
P.S. it's difficult to explain the problem because my english is bad
Re: <html> and <head> placeholders
Quote:
Originally Posted by
Sebastian
Hi,
you must not group the text object. I think there is a little bug with the <html> function.
No I don't think so.
Grouping the text object forces Xara to ignore it as actual text. You can just as easily make the placeholder a small rectangle. Which I personally find far more usefull (along with a text label like the tweaks to make things easy to identify on the page, but this is also grouped text with the rectangle)
I think the only reason gpholman used text on the page is because he was mistaken about the purpose of the <HTML> naming thinking it could be used in a way to output HTML code in the body area at the exact same line position as placed on the page in Web Designer.
Re: <html> and <head> placeholders
Hi Sledger,
please try it, use gpholman's example and insert only one space after the "<!--" and you will see it is working.
Re: <html> and <head> placeholders
Yes I do see what you have explained (though I don't have to delete the space to see all code is at the very beginning).
My point was that this is unnecessary if a placeholder is a graphic object rather than text. Grouping his text was to allow gpholman to retain the WYSIWYG effect he may have wanted to keep :)
However, there is a circumstance where a text character can be used as a HTML placeholder.. But I will leave you guessing on this one until the WD6 tweaks thread is ready ;)
1 Attachment(s)
Re: <html> and <head> placeholders
Sebastian - Well spotted - that was the problem all along, not having a space after the '<!--' seems to cause problems with the HTML export. I put spaces in and all works 100% now!
Sledger - I hope I'm not going to come across as a dog that just can't let go of a bone but Xara does not need to have a text object grouped for it to work as a placeholder. Please see the attached file - these are all ungroup text objects that work fine as placeholders.
Anyway I'm really looking to the forthcoming tweaks set!
All the best
Grant
Re: <html> and <head> placeholders
I stand corrected. Perhaps there's a wee little bug crawling around ;)
Re: <html> and <head> placeholders
Personally I wouldn't view it as a bug - if I tell XWD that the object/text is to be replaced by HTML then it should do exactly that - which it does :)