How to make a fully customizable hosted ASP.NET MVC application - asp.net

This is related to my previous question regarding serving static html files but that doesn't seem to be a good solution,
I want to make a fully customizable ASP.NET MVC application as a hosted service. See allowing the user to customize the look/feel of their own page but it is still dynamic, meaning the data is hosted in the central database.
I looked at the "theme" or "skin" in ASP.NET but I don't think it is customizable enough. It seems only the developer can add new themes. I want to have something like the theme editor in WordPress so you can just change the look in anyway you want from a web-based interface.
I wonder how the theme files will be stored for the popular blogging platform? Are they stored in database or a file in filesystem? I prefer to store it in database, because if it is in filesystem it will have scalability problem. Each user will be tired to a particular web server and I have to determine how much disk space for each webserver.
I thought of doing something like the old MovableType, to generate static HTML when you add new post. This solution is problematic as well, because the flexibility depends on the complexity of the template engine.
Ideas? Suggestions?
Thanks!

"Fully customizable" is the most elusive of the white whales ;-)
I see your question is old, but none the less;
first I'd recommend defining some very clear,
and cohesive rules governing just what the "bottom-line" is,
or an inheritable template of sorts.
You get a pretty good impression of what might be useful during developing, I'd guess.
Next; just what and how is the customizing supposed to be presented and achieved?
The inherit ASP.NET custom custard, Web Parts, need quite some cajoling to behave in MVC views :
https://stackoverflow.com/questions/1106629/using-webparts-in-an-mvc-application
If you're leaning more towards customizable appearance (theme's n' skin's),
how about having a CSS file for each user, saves like a charm as VARCHAR(MAX), and can easily be inserted
in e.g. your Master Page's head.

The theme editor in WordPress simply allows you to edit Theme PHP files...
You can do it exactly like in wordpress but instead of editing PHP files your theme is composed of a set of aspx\ascx files without code-behinds...

Related

Are there good tools which help migrating an existing Website to a CMS-based site?

I'm looking for tools or libraries that load simple but old existing websites and produce an output which can be loaded into wordpress or other CMS. The goal is to keep the existing websites navigating structure and content.
Any hints?
What I've discovered is that it really depends upon the CMS. I would recommend a "tag-pair"-based CMS like the new Craft or ExpressionEngine's free Core version (there're others too) where you drop in a looping control area, replace the fields with the tags and then it just runs. I personally like those because they offer a cleaner separation between content and design.
I'm trying to learn Wordpress now and it's backwards of what you want - you create template environments and half the design seems to be controlled by the code. Great if you want to swap generic templates around, but if you customize them you're doing a lot of work. I'm looking at a site I inherited and conditional statements are a nightmare - half in the templates and other in the plugins themselves (Events, I'm looking at you).

Migating from CakePHP to Drupal, functionality question

(I've posted this on the drupal forum too btw)
I'm converting the company websites to use Drupal, or at least trying to check that its going to be the best way forward. I have a background in PHP development, and I'm currently using the CakePHP framwork. I've built this site (not my design) and I can see how to replicate most of the functionality using Drupal, most likely using the CCK module.
http://preview.tinyurl.com/yk6u8mt
As you can see from the homepage:
A user chooses a country.
The country is passed using an ajax call to a script that decides which phone is best based on 'in country' network coverage.
A div is shown recommending the visitor the best phone for that country.
I'm wondering how to go about this in Drupal, I'm definitely not after a step by step guide, I just want to know if this kind of thing is possible with Drupal, and what approach to use.
If someone can help that would be superb. Thanks.
Okay, so you've got a path you're defining in hook_menu, which is where your form is being presented - or else you've got it set up as a webform in a node, that could work too.
Either way, in your form you're going to be using AHAH - check out http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah and http://drupal.org/node/348475 .
Basically, you're going to define another path in hook_menu that's of type MENU_CALLBACK, and which will receive the country as input, and then will return the div that you'll display on the screen.
One core example of AHAH that may be useful to you is where you're entering a password and it lets you know if the password is secure enough - check that out.
Edit: There's also some good examples at http://drupal.org/project/examples.
I would look into using CCK and views. you can set up filters for the views. If filters don't work, you have the ability to include php code. I have also successfully added jquery code in the header of a view through which I was then able to have my view filtered by what is typed in a text box.
Coming from CakePHP using Drupal is a pain in the a** - even more for developers.
It's application structure might be designed to ease extensibility but this only means you have a system to enable your own plugins and themes.
While modules are basically the M+C-part the themes are the V-part of an MVC-application. The problem is that this seperation is not very strict in Drupal - in fact you have to break it sometimes in order to make things work (e.g. you have to include a theme_mymodule_myfunction() into your module as default output which you then can override with your theme using mytheme_mymodule_myfunction() ) And don't even bother looking for classes ( see http://drupal.org/node/547518 ).
Also there is no real link from a module to a theme. On many occations this is a good thing as you can switch modules and themes seperatly without creating a problem. For application builders coming from CakePHP (or any other framework) you often feel a lack of "wholesomeness" - you create parts for a base software and have to live with it's drawbacks.
IMHO I wouldn't recommend this step. Drupal is fine if you have to manage a website and might add a few modules to add neccessary value (image gallery etc.) but I definetly don't recommend it as a base for a customized web-app.

Customizing GraffitiCMS

I downloaded GraffitiCMS the other day(now open source and free), and like a lot of what I see, but what I really want to use it for, is to add CMS capabilities to an existing asp.net database/application.
Without getting bogged down with all the details of my app, can someone give me the basic 'approach' that should be taken to add custom content to Graffiti; content that won't be a 'post'?
I've seen for example, how to add custom-widgets to Graffiti - basically inherit from the widget class, compile your dll and plop it into the correct directory and it becomes part of the system. Is there a way to do something similar for the main content areas?
For simplicity sake, pretend I have a non-graffiti database with gig's of data that I want to display on the website using standard asp.net grid's and forms. I realize I could just go in and hack apart the source code to integrate my existing app, but that is likely not the correct approach.
Not looking for a complete solution her, just a pointer and what areas to investigate...thanks.
If you check out the latest source of Graffiti (or the 1.3 branch that was recently created), support was added to put widgets anywhere you want on any page. There is a new chalk function - $macros.Widget - that provides you with this ability. Dan Hounshell wrote a blog post on how you can use this new functionality:
http://danhounshell.com/blog/graffiti-cms-1-3-add-a-widget-anywhere-in-a-view-with-new-widget-macro/
If you're looking for something different than that, just let me know - we're working to make Graffiti even better for situations just like you are currently in.
What we have done to be able to integrate Graffiti CMS with our current ASP.NET projects is to create a post in Graffiti called "hidden" and then with our standard .ASPX pages we call a class in our Render Override that pulls the "hidden" post (ie: site.com/hidden/) and uses the header and footer to wrap the Graffiti theme around our custom .ASPX page. We use some HTML comments in the "hidden" post to be able to parse the header and the footer. It is kind of a hack, but has worked out really well for us.
I think you're trying to put the cart before the horse - depending on the size and amount of functionality, I would be looking to rebuild it after learning the development platform of my CMS system of choice.
I'm pretty much in the same boat right now. I have avoided Graffiti because I have to learn "Chalk" (whatever that is) and Umbraco (using XSLT for layouts is retarded). So far, this leaves me with Sitefinity at the top of my list and Telerik have just pulled the free version!
I may end up grabbing a very basic CMS which is easier to customize. I know this doesn't directly answer your question, but it may give you some food for thought :-)

How to Build WP Site with Hierarchical Content and Using Custom Design?

A client asked me to redesign her web site, built several years ago in WP by another developer. Although I've never worked with WP before, I'm pretty comfortable with html, css, and php, and I more or less understand how WP stores content and dynamically builds pages. But I'm wondering how to approach these challenges:
My client's site has about 75 pages. There are about 25 that are static (i.e. the content changes infrequently if at all; things like "about us" and "faqs") and there are about 50 pages that are more "blog-like", except that instead of posts, the content contains directory-type info (e.g. 12 DJs in the area) or event-related info (e.g. upcoming shows at local theaters). Both of these categories contain many sub (and sometimes sub-sub) categories (e.g. medical services > pediatric > kid allergy specialists) and the content updates fairly frequently.
I understand the difference in WP between "pages" and "posts". But I need to find out the best way to structure the static content. Should I just set up a parent/child hierarchy of pages, changing the permalinks to something that makes sense? Or is it better / easier to just build the static pages outside WP and somehow link to them from the common navigation?
As a web designer, I want to "wow" my client with a great design. While there are loads of wonderful WP themes available, I really need to create something unique. But I'm wary of breaking something, so what's the best way to take an existing theme and just tweak it enough to make it look a little different?
Finally, other than mounting a massive "copy and paste" effort when the new site is built, is there a way to transfer content from the original site to the new one?
By reading your question, it seems to me that choosing WP for this kind of website was a bad choice.
Redesigning it, though, won't be that hard if it's using page templates for pages.
And yes, there's a import/export tool in WP to tranfer content. (see administration panel)
I, really, advise you to read this great tutorial about creating WP themes.
I've a blog-like WP site myself (contains RPG development articles). Here's what I did. Nested static pages simply have parent-child hierarchy: /about/mingos - that's easy to understand and i value this kind of content organisation (personal opinion).
As for themes, there's a no-brainer tool that, while not exactly apt for real business, has the capability of letting you see how stuff will look in seconds, and can sometimes give you great ideas. It's called Artisteer and there's a demo on its site that you can have a look at. Try your design ideas with it, see how stuff will look like. I'm sure you can come up with some great ideas for a "wow" design :).
Exporting content, as Soufiane Hassou remarked, is possible from within the admin panel.
Don't rule out using categories to create your hierarchy. That way you'd get the benefit of cross categorization of DJs and venues by location to create a robust cross reference system. Pages don't get this benefit without extra work.
To make this in to a directory, though, is gonna either be heavy work on managing the pages or heavy work on creating a solution that will cross reference everything and bring the content together in a usable way on the front end.

How can I provide dynamic CSS styles or custom theme for web site?

There are plenty of ways to provide a dynamic style/theme for a web site, but I am looking for some help on some best practices or techniques that have worked well for others.
I am creating a web site that needs to provide the ability for customers to create or specify their own colors, style, theme, or layout. I'm not convinced how much flexibility I need yet, but basically I need to provide Branding capabilities.
I will be using ASP.NET, and am open to any ideas that will fit within the ASP.NET framework.
Using Themes for ASP.NET 2 and greater will provide you everything you need for this.
Best way to handle it would be to make a nice CSS document that will specify all the areas that you would like to offer customization, such as header background image, background and text colors, etc. Then build application code to allow specification of which theme to load, and bring up that CSS file.
I'd personally go for a CSS-based solution.
You could define the elements' IDs and CSS classes for each page in the web application, so that customers can provide their own set of CSS files.
This approach is platform-agnostic, so that the developer who creates the custom themes is not forced to fit into the ASP.NET themes model - she might as well be a web designer with no programming knowledge.
Themes might be a good solution but having re-read your question I think you might be asking for a method for allowing customers to submit their own branding dynamically, i.e. without you having to modify any files, a hands-off approach? How about having an admin interface consisting of web forms where the customer can upload images and CSS themselves? You could then retrieve that content using a HttpHandler or similar.

Resources