PDA

View Full Version : CSS editor for site users?



IQAndreas
May 11th, 2010, 01:45 PM
I really have no idea how to ask this question (so if you have any suggestions for a better thread title, please post them), but here is the deal...

I am creating a "banner system" where 'advertisers' are allowed to set the text for the banners that changes every day (it's for a lunch menu). I'm having trouble with allowing them to change the text format in the banner.

I wish it was as simple as giving them a textbox and allowing them to put in the CSS as they want it (for example)
color:#FFFFFF; text-align:left; font-family:serif; font-style:italic;
But of the restaurant owners using the site are NOT experienced with CSS, so this might be a bit tough for them.


I am not sure what to do at all. Any ideas?

mrE
May 11th, 2010, 02:06 PM
That depends on a few things. Do you have a CMS hooked up to this site? Are there going to be more than one title at a time? Does your server support PHP or another server-side language?

Assuming you have some kind of CMS and the ability to use PHP or ASP or another server-side language, perhaps you could set up some variables at the top of every post wherein they can enter the color and other things they want. And then the code can call those variables. That way, they just see something user friendly like "color" and then you can give them a hexidecimal color chart to use as a guide.

Alternatively you could implement some kind of WYSIWYG editor with your CMS so that they can just do whatever they want. Although usually this is a bad idea to give them complete control.

There are many solutions to your question but it all really depends on how much you trust them and how much time you have. Ultimately if you were smart enough you could build something custom using XML or something.

IQAndreas
May 11th, 2010, 02:39 PM
That depends on a few things. Do you have a CMS hooked up to this site? Are there going to be more than one title at a time? Does your server support PHP or another server-side language?
Yes, the site is entirely in Joomla, and rather than creating a new component, I'm modifying an existing one to add a banner to the top of the list depending on what the "lunch of the day" is. Originally it was going to populate the title based on the contents in the list, but (for various reasons) I modified the code so they have to manually set the text for each day.

This link will show how it looks (in progress) in case it makes any difference. Right now the banner is hidden from non-administrators for debugging purposes, but as long as the flag at the end of the URL is set, it will still show up:
http://stadsaktuellt.nu/index.php?option=com_eventlist&view=categoryevents&id=13&Itemid=20&showbanner=1
Note that that page is only for displaying the banner. Administrators or banner owners get a small "edit button" next to it which brings them to the edit page.


I have full control over both the PHP and MySQL database. Right now it is storing only the text color in the database, but most will probably want more control over the text such as size, alignment, position etc. I have no problem storing or retrieving those settings in the database and applying them to the text.


perhaps you could set up some variables at the top of every post wherein they can enter the color and other things they want. And then the code can call those variables. That way, they just see something user friendly like "color" and then you can give them a hexidecimal color chart to use as a guide.I have been thinking about that.

I have no problem creating custom controls for simple things like textBoxes for font size and and dropdown boxes for alignment, but controls for "color pickers" and "font selectors" might be a bit too much work for a simple 4 hour job.

However, if anyone knows of any good premade components out there that can be easily implemented, please tell me, that's one reason I made this thread. Keep in mind, I don't want it to get too cluttered either with 12 different components that all do their own thing and will confuse the users, the more controls a single component has in it the better.


"Restaurant owners" will likely only change their formatting 2 or 3 times a year. Sadly, most of them are not developers or designers at all, and they need a simple way to change the formatting without getting confused or overwhelmed. :(


I guess I'm just looking for that "miracle solution" which solves all my problems and is friendly to both developer and end user. :ponder:

mrE
May 11th, 2010, 03:14 PM
You could probably write something simple in PHP that would save values to the database. at that point it's pretty simple. you just give the client a couple predefined options and they click on them and then click save and it saves that info to your database for the image to pull from.

I mean obviously it's a little more complicated than that but I'm sure you could write something custom fairly easily. Sorry I'm not very specific but it's more of a server-side thing than a client-side thing, IMO.

IQAndreas
May 11th, 2010, 03:30 PM
Sorry I'm not very specific but it's more of a server-side thing than a client-side thing, IMO.
Sorry, I should have clarified better.

I have NO PROBLEMS storing or parsing the values on the server side. I just need some easy to use interface or system for site users to choose and modify the CSS that will then be applied to their banners.


Sorry, I'm not good at asking questions. :sigh:

mrE
May 11th, 2010, 03:58 PM
ahh. ok. in that case- I'm afraid I'm not too experienced with this particular CMS to help. Sorry if I just caused problems. I'll let others give their thoughts now :)