Page 1 of 1

Placing HTML code on a page

Posted: Tue Apr 02, 2024 11:54 am
by BarryZ
When trying to place HTML code on a page, how and where in the Object Properties can i set the location of where I want this HTML to display the content that needs to be displayed?

Yes, I'm aware that in Properties, there are several sections where you select to place HTML code ... Header, after header, bottom of page, etc.. I've used these, but when I try to preview the page, the HTML code does not display what I am expecting it to display in the page location where I want it to display.

Does the Preview function not work here?
Must I publish the page and upload to live server to see if the inserted HTML is in the correct place?

I must be missing a step on this. Please advise.

Thank you
Barry

Re: Placing HTML code on a page

Posted: Tue Apr 02, 2024 12:01 pm
by alan_sh
Preview does work.

Maybe if you posted a link to a sample WBS file, we could see what you were doing and advise better.

Alan

Re: Placing HTML code on a page

Posted: Tue Apr 02, 2024 12:25 pm
by BaconFries
Does any of the code your are trying to insert use php? If so then you cannot "Preview" locally it requires to be uploaded to your host (self hosting or external) which needs to be php enabled.

If it has its own <div></div> but doesn't have a position then it won't get placed correctly it will just get rendered outwith where you inserted in the page html.

If you have inserted css then is it possible you have selected 'external CSS' in Tools -> Options -> HTML if so then it will not show in the page source code as it in an external file. This then needs to be published.

The same applies to jquery/javascript in Tools -> Options -> HTML 'Generate external JS.the code will be placed in a external file and its reference will show only.

To be able to help it is always best to provide a basic "Demo" project the .wbs
See the following:
How do I share my project to get help?

Re: Placing HTML code on a page

Posted: Tue Apr 02, 2024 12:38 pm
by Pablo

Re: Placing HTML code on a page

Posted: Tue Apr 02, 2024 11:50 pm
by crispy68
Some code won't preview and has to be uploaded to a server to work. Some code doesn't. It all depends on the code you are adding and how you are adding it. Without knowing exactly the code you are trying to add, there is no way to tell you what is wrong.

Please provide either a link to a demo webpage so we can see the page live or provide a copy of your .wbs project file to look at along with the code you are trying to insert.