View the CCS layout on the homepage

Source: Internet
Author: User

Many people think it is troublesome to modify the page layout of CCS.
Here, let's take a look at what the CCS homepage has.

1. Load the default homepage Layout
<CS: contentcontainer runat = "server" id = "mpcontainer">
File Location: communityservercontrols \ contentcontainer. CS class inherited from metabuilders. webcontrols. masterpages. contentcontainer

Entity class used to load masterpage (homepage layout)
First, the current set style (homepage control) is accessed. The default value is matser. ascx.
If not ~ The homepage control of the default style is further accessed ~ Default Style

In the specific running process. It first loads ~ /Themes/the selected style name/Masters/master. ascx
If the file does not exist ~ It will run to load ~ /Themes/default/Masters/master. ascx
If not ~ So we won't load anything ~
So when you set a style
You accidentally deleted the folder of this style, or this style does not have anything except folders.
The homepage still has content output ~ Officially because they are loaded by default ~ /Themes/default/Masters/master. ascx
However, because your current style is not default, you can only display the page layout and do not slack off the default CCS style control.
If a new skin is created based on the default layout ~ You can create a new style folder and add only the style control and image needed.

For more information, see <CS: contentcontainer runat = "server" id = "mpcontainer">
Public class region: metabuilders. webcontrols. masterpages. region {}
Public class content: metabuilders. webcontrols. masterpages. Content {}
Public class form: metabuilders. webcontrols. masterpages. nobugform {}
It indicates that region content form inherits the masterpages control of metabuilders.
For more information, see http://www.metabuilders.com/tools/masterpages.aspx.
This control is roughly divided into four categories
(1) content: This control contains the content for a particle Region
These controls contain real content
(2) contentcontainer: This control serves two distincts purposes: -It marks the location where the master page will be inserted into the page-it contains the varous content sections that will be matched to the master page's region controls (based on their ID' s ).
This control has two intentions:
· As a positioning mark, the master page will be inserted into the page;
· Match region controls
(3) nobugform: A server form that does not cause a problem by being inside a master page or other naming container.
No error form. Easy to use
(4) region: the control marks a place holder for content in a master page
Placeholder Control

2. Load files and basic settings
3.1 load JS files
<CS: script src = "utility/updateposts. js" runat = "server"/>
The file is located at: communityservercontrols/script. CS
The file inherits from literalcontrol to indicate an HTML element.
The src attribute is used to define the JS file and output <SCRIPT src = \ "{0}/{1} \" type = \ "text/JavaScript \"> </SCRIPT> such JS references HTML statements
If the src attribute is null, the utility/global. js global JS file is loaded by default.

Default hyperlink settings
<CS: base target = "_ top" runat = "server"/>
Convert the output tag <base target = '_ top'/>

3. Load Custom Skin controls

Many controls that contain skin functions inherit from
Securetemplatedwebcontrol or templatedwebcontrol. CS
Securetemplatedwebcontrol inherits from templatedwebcontrol, while templatedwebcontrol inherits from webcontrol and inamingcontainer.
The templatedwebcontrol control loads the skin of the current style through the skinname attribute. If the skin does not exist, the default layout of the skin file is loaded.
In addition to the templatedwebcontrol function, securetemplatedwebcontrol also checks the current URL function to determine whether the current access is a site-based access
In the class corresponding to each skin control, we can reconstruct the attachchildcontrols method to set the initialization of the control.
To set the variable events corresponding to the controls on the skin.
For example, the <CS: Login skinname = "Skin-LoginSmall.ascx" runat = "server"/>
Will load the layout of the Skin-LoginSmall.ascx
In communityservercontrols \ login. CS, we can see the code of this control.

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.