3 Replies - 1962 Views - Last Post: 28 March 2009 - 07:53 PM Rate Topic: -----

#1 hockey97  Icon User is offline

  • D.I.C Regular

Reputation: -77
  • View blog
  • Posts: 300
  • Joined: 25-September 08

Making a website layout editor...

Posted 28 March 2009 - 04:46 PM

Hi, I am trying to make a layout editor.

The problem I have is like programmers block.

I can't decide if I should store the css values in a myql database or just a plain text file.

On top of that I don't know how to go abouts making a editor.

I know I can use javascript to make a user interface to drag and drop elements etc.

I just don't know how I can grab the elements css values like height,width, postiition values.

I will have a menu bar above the elemets to be the control meaning to delete the element or to add a element inside that element.


What do you guys think? Should I store the values of the css in mysql and plug them in? or store the data in a text file?

Also how should I flow the data? I have heard I can use javascript to grab the css values after the user edits the layout and then replace the old values with the new ones.

So I would like advise on how I should go about making a layout editor.

Is This A Good Question/Topic? 0
  • +

Replies To: Making a website layout editor...

#2 Gevie  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 29
  • Joined: 06-April 08

Re: Making a website layout editor...

Posted 28 March 2009 - 04:52 PM

Hi Hockey97,

I understand what you are trying to achieve to some extent, it sounds like you wish to do some more intermediate stuff with javascript - for this reason I would recommend you have a look at jQuery.

jQuery is extremely minimal and easy to use, it is less frustrating than working with javascript and gives you access to a whole boat load of functions to play around with. You could use it to get attributes from elements, or set attributes to elements in real time.

In regards to saving the CSS, I really dislike the idea of saving css files in the database, you haven't explained your full project properly so it's hard to say.

I would recommend having several set CSS styles, generic.css, forms.css - which don't clash, and give you access to a lot of different classes and elements. Then either include all of them in the layout, or grab the preffered CSS style from a db field (i.e. 'css_style' => 'blue.css')

If you are allowing CSS to be written on the fly, then you may wish to look at creating some sort of parser (OOP Ideally) which will allow you to write the css file, then save the location of that file in the database.

If you are trying to create an online website creation tool, with lots of customisation - well, best of luck to you!

Hope this helps
Was This Post Helpful? 0
  • +
  • -

#3 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: Making a website layout editor...

Posted 28 March 2009 - 05:02 PM

Well you could make a form where it ask all the information and then have a script wich generates the new.css file and overwrites the old.css, but if you want to show the old values on the form then you need to parse the old.css, but you can also make it by storing the css values in mysql or textfile.

You don't need to use Javascript to flow the data, because you can use html forms to do it, but of course you can use .js if you know how to code it.

The question between text file and SQL is between what requirements you want to set for the editor user. If you use SQL then the user have to use another of his/her spare databases, because most people have limited databases. If you choose to use textfile it might be a bit slower, because you need to open and close the file and parse the information from it and write into the files, might be harder and bit slower, but does not need a database from the user.

Well i don't think that .css need a editor, because it is really simple stuff and if you do not get how to use .css then you should stop playing too much Counter Strike: Source!
Was This Post Helpful? 0
  • +
  • -

#4 hockey97  Icon User is offline

  • D.I.C Regular

Reputation: -77
  • View blog
  • Posts: 300
  • Joined: 25-September 08

Re: Making a website layout editor...

Posted 28 March 2009 - 07:53 PM

Here are some more details of my project.


My website is a social network type site for gamers. I want to make a layout editor so each user can customize how their profile looks.

This needs to be a gui no code to copy and paste in. The reason is that it get's complicated for the user. So I want to create a edit system that will be user friendly.

so I plan to make a default layout look with css. I want the users to be able to drag and drop and delete stuff and also add stuff into their layout.

I plan to use jquery. The problem is that how should I do this? Should I use mysql database to hold the css values and then use php to add those values in ? meaning replace the old default value.

I want the users the have max control. They can use any image that is accessable on the internet as backgrounds for elements or the whole layout meaning the body.

So I need a layout editor that will allow customizing colors of elements, and even adding background images or images on the layout, or adding youtube videos or other videos on the layout.

My goal is to make this layout as customizable as possible. This also means resizing elements with the height and width.

hope this is good enough information.


I was told with javascript or jquery you can grab the css values. They recommended me to use jquery to do the drag and drop stuff.

Then when the user is ready they hit a save now button which iwill save their layout meaning it will update the database or text file meaning css file depending what I decide to pick it will update those old css values to the new ones.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1