Possible just to insert a <div> on a page

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
NRIELECTRONIC
 
 
Posts: 5
Joined: Wed Mar 05, 2014 9:44 am

Possible just to insert a <div> on a page

Post by NRIELECTRONIC » Thu Aug 09, 2018 3:35 am

I can't find the answer to this one.
What I would like to do is just insert a <div> on a page, ie size and position, just like inserting an image or html. Then use rename or object properties to give it a name.
What I want to do then is just reference the <div> in code on the rest of the page and basically draw something in it (gauge, chart etc) without having to programatically set the size and position.
My guess is that there is a way of doing it in WB14 but I can't find it
Thanks for your help
Robyn

User avatar
rogerl
 
 
Posts: 193
Joined: Tue May 03, 2016 8:24 am

Re: Possible just to insert a <div> on a page

Post by rogerl » Thu Aug 09, 2018 5:16 am

My thoughts would be to insert an html object on the page, positioning where you want it.
Insert html:

Code: Select all

<div>
</div>
Then use css in head tag under page html to style the div using the id generated by Web Builder.
A further thought, I think Web Builder creates a div automatically when you insert an html object, so code may not be necessary as above.

NRIELECTRONIC
 
 
Posts: 5
Joined: Wed Mar 05, 2014 9:44 am

Re: Possible just to insert a <div> on a page

Post by NRIELECTRONIC » Thu Aug 09, 2018 6:06 am

T'is true that html insert generates a <div> but it also generates <html> and if you go to rename the Id of the object in WB14 it only renames the <html> not the <div> object.
I really just want a clean <div> with the ability to rename it to something meaningful like 'Fred' with no other content apart from maybe a style setting likestyle="position:absolute;left:200px;top:500px;width:500px;height:250px;z-index:11;
Other objects like rectangles and such also produce a <div. but you can't rename it without editing the page html.
You can insert a <div> in the page html in the body and name it but then you have to manually edit the size and position.
Just seems to me it should be part of the drag and drop
I can create an extension which creates a <div> only and use that but then it is popped inside another <div>, not all that bad but not perfect

User avatar
BaconFries
 
 
Posts: 4154
Joined: Thu Aug 16, 2007 7:32 pm

Re: Possible just to insert a <div> on a page

Post by BaconFries » Thu Aug 09, 2018 6:41 am

The first thing you need to note is that WYSIWYG Web Builder is not a HTML Editor but a HTML Generator meaning no code actually exists till its published so editing is not possible within the program.
You can insert a <div> in the page html in the body and name it but then you have to manually edit the size and position.
If you just add a <div></div> between the <body></body> how is the program meant to actually know where you want it to be positioned without you actually giving it? (that's like jumping into a car with sat nav and you expect it to know were you want to go) and by adding divs manually it will have effect on other objects position that the program generates!.

You can use the HTML Object to insert code such as a <div> and in the drop down select not to use the <div> generated by the object but then you will need to give the manually add <div> a position or reference due to the program wont know where you want it positioned.

In the extension builder you can select it not use a <div> as you are using your own but then like with the HTML Object it will have no way to know where to position on the page as there is no reference as you have just used <div></div> None of this related to the program using drag'n'drop but how you write and use code manually so that the program knows how to use it as you intend.

User avatar
rogerl
 
 
Posts: 193
Joined: Tue May 03, 2016 8:24 am

Re: Possible just to insert a <div> on a page

Post by rogerl » Thu Aug 09, 2018 7:53 am

Interesting, I jumped in as interested in what the moderator answer might be. In my old software we could create an html object and the positioning was governed by where the object was placed on the page then we manually entered the div html and css. Never had to do anything like that since using Web Builder, but then Web Builder is so much better.

NRIELECTRONIC
 
 
Posts: 5
Joined: Wed Mar 05, 2014 9:44 am

Re: Possible just to insert a <div> on a page

Post by NRIELECTRONIC » Fri Aug 10, 2018 2:37 am

It only makes sense when you know what I intend to do.
I have code which requires a <div> to display an object (chart, gauge etc) in. That code will use the div (its position and size) on the page. It needs a fixed id since my code will create the object in a named div and I don't want to sort through the names that WB14 may give the div when it publishes the page, hence I need to create a div, just like a html object on the page by drag and drop, give it a name (id) and then let my code fill out that postion on the screen. Simple really. Yes I could edit the code that WB14 creates but then everytime I republish the page my code gets overwritten.
I could put my div in the page html , place it in the between body section, then I would not have access to the drag and drop positioning on the page, which is a time saver when you are laying out a page.
I created an extension which basically just adds a div to the body with a name property. When you add it to a page in WB14 and set the name then it is added within another div with the placement and size. That is ok, my extension just sets the style of my div to 100% so it fills out the container div that WB14 allocates to it when i position it on the screen. Works fine to do what I want to do.
I don't seem to be able to post an extension *.wbx file here but if anyone is interested I will email it to you. It can be accessed at this dropbox link
https://www.dropbox.com/s/ef9rw7b8vb7w8 ... v.wbx?dl=0

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests