Oxite analysis-skinning

Source: Internet
Author: User

Change set: 42944

Download: http://oxite.codeplex.com/SourceControl/ListDownloadableCommits.aspx

In oxite, you can easily switch between skin (skinning) and site skin and Admin skin. The oxite skin consists of three parts: CSS + images, scripts and views. Note that this view is the view part in MVC, which brings more flexibility. Here, skin settings will affect the position where viewengine searches for view files. The official also has the introduction of skinning, not detailed: http://oxite.codeplex.com/Wiki/View.aspx? Title = skinning

1. Set skin

You can set foreground and background skins in site settings of the oxite management background. Go to the background and click the "Site" sub-menu under the "Settings" menu to go to the "Edit site" Page:

Set the total directory of each skin in the skins path field. The default value is/skins. Note that this path is an absolute path, but it is the skins directory under the root directory of the virtual directory where the site is located, that is,/skins actually corresponds ~ /Skins.

Assume that the view of the action index under homecontroller is searched,
When the skins path field value is not empty and the site skin (or admin skin) is empty ~ /Skins/views/home/and ~ /Skins/views/shard/directory. If the directory cannot be found, it will search ~ /Views/home/and ~ /Views/shard/directory.

Note: currently, the oxite version does not support the scripts PATH and styles path fields. That is to say, your settings will not work for the moment. I have passed the source code analysis and have not tested the settings.

Site skin is used to set a specific skin. It is null by default. In this case, you can look back at what we said when analyzing the skins path field. If we directly move the styles, scripts, and views directories in the root directory to the skins directory, the site will be normal.

If we set a value for site skin, for example, myskin. Without moving the official source code, the site will not change. If we directly move the styles, scripts, and views of the root directory to the skins directory, the site will still be normal. If we create a myskin directory under the skins directory and move the styles, scripts, and views directories in the root directory to the directory, the site will still be normal. Why? The reason is that after Site skin sets a value, viewengine only adds two search paths when searching for views. For example, the index action under homecontroller will be searched first :~ /Skins/myskin/views/home/and ~ /Skins/myskin/views/shard ~ /Skins/views/home/and ~ /Skins/views/shard/directory; if it still cannot be found, it will search ~ /Views/home/and ~ /Views/shard/directory.

In addition, if the skins path field is set to null, the site skin field is set to myskin. In this case, the view search path is as follows:
~ /Myskin/views/home/-> ~ /Myskin/views/shard/-> ~ /Views/home/-> ~ /Views/shard/

The skins path field and site skin field can be set to a more complex path. I don't think it is necessary. According to the default oxite configuration, it is enough to put various skins in the skins directory.

Ii. How to Implement skinning in oxite

ASP. net mvc 2.0 pre-view version already supports area (in fact, Lao Zhao also mentioned the solution), so I don't know if oxite will be replaced by this method. I will not discuss it here.

Iii. Other problems
Grouping controllers with ASP. NET MVC
Http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx

Support area controllerfactory
Http://www.cnblogs.com/JeffreyZhao/archive/2009/08/20/controller-factory-with-area-supporting.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.