Skip to content

Commit

Permalink
Added website theming documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Dec 30, 2015
1 parent f93452f commit 44b90e1
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 165 deletions.
3 changes: 0 additions & 3 deletions Index.md

This file was deleted.

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ Frapid was built from the ground up for the cloud. Not only frapid supports web
frapid can also host several (hundred) website and application instances
running as a single IIS Website.

**See Also**
**Documentation**

* [Database Naming Convention](docs/concepts/database-naming-convention.md)
* [Installation Guide](docs/installation/README.md)
* [Developer Documentation](docs/developer/README.md)
* [Installation Guide](docs/installation/README.md)
* [Database Naming Convention](docs/concepts/database-naming-convention.md)
* [Credits](docs/credits/README.md)

# Who Is Using Frapid?

* [Our Own Site (CMS)](http://docs.frapid.com)
* [MixERP (Backend Apps)](https://github.com/mixerp/mixerp/)
* [Salesific CRM (CMS & Backend Apps)](https://github.com/binodnp/salesific-crm)

# Read Further

* [Credits](docs/credits/README.md)
1 change: 0 additions & 1 deletion docs/assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30684,6 +30684,5 @@ function processSocialSharing() {


$(document).ready(function () {
$("img:not(.logo)").addClass("ui bordered centered rounded image");
processSocialSharing();
});
7 changes: 3 additions & 4 deletions docs/assets/scripts/mixdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ function processImages(html) {
images.each(function () {
var el = $(this);
var src = path + el.attr("src");
$(this).attr("src", src);
$(this).addClass("ui bordered rounded image");
$(this).attr("src", src);
});


Expand Down Expand Up @@ -114,7 +113,7 @@ function loadDocument()
var url = window.location.hash.replace("#", "");
if(!url)
{
url = "index.md";
url = "README.md";
window.location.hash = url;
}
processDocument(url);
Expand Down Expand Up @@ -173,7 +172,7 @@ function processDocument(url)
processAnchors();
processSocialSharing();
processVideos();
$("table").addClass("ui celled striped table");
$("table").addClass("ui celled small compact striped collapsing table");
};
xhr.send();
};
29 changes: 15 additions & 14 deletions docs/assets/styles/mixdoc.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
html, body, h1, h2, h3, h4, h5, div, p, li, code {
font-family : "Segoe UI", Arial;
}

p, li, td, a, pre, code
{
font-weight:300;
font-family: "Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
color:#333333;
}

html, body{
font-size:16px;
font-size:12px;
line-height:24px;
}

h1, h2, h3, h4, h5, strong, b, th
{
font-weight:500!important;
color:#333333;
}

#story
Expand Down Expand Up @@ -46,19 +42,23 @@ footer, footer a, footer a:hover, footer li

pre
{
background-color: #EFEFEF;
background-color: rgba(0, 0, 0, 0.04);
padding:16px;
margin:8px 0;
border:1px solid #DDD;
}

pre
{
font-family: Consolas, monospace;
font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace;
}

code {
background-color: #EFEFEF;
padding: 0.2em 0px;
margin:0px;
background-color: rgba(0, 0, 0, 0.04);
border-radius:3px;
word-wrap:break-word;
}

.sticky.contain-to-grid
Expand All @@ -81,12 +81,13 @@ aside a, aside a:hover

a
{
color:blue;
color:#5D78C0;
}

a:hover
a:not(.header):hover
{
color:red;
text-decoration:underline;
color:#073D8A;
}


Expand Down
17 changes: 0 additions & 17 deletions docs/credits/README.md

This file was deleted.

8 changes: 5 additions & 3 deletions docs/developer/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ Meta database contains global objects which are common to all instances. The met

## Sql Bundler

It is advised to use [MixERP Sql Bundler Utility](mixerp-sql-bunlder.md).
It is advised to use [MixERP Sql Bundler Utility](http://github.com/mixerp/sqlbundler).

**Conventions**

* do not create a single SQL script and keep everything on it. It is difficult to manage that way.
* create your own directory structure [similar to frapid](#) and store individual sql files there.
* create your own directory structure [similar to frapid](https://github.com/frapid/frapid/tree/master/src/Frapid.Web/db/meta/1.x/1.0/src) and store individual sql files there.
* use SqlBundler.exe to bundle everything together to generate a single SQL file which contains.

**How Sql Bundler Works?**

Create a `.sqlbundle` file (`yaml` format) on your [db directory]().
Create a `.sqlbundle` file (`yaml` format) on your [db directory](https://github.com/frapid/frapid/tree/master/src/Frapid.Web/db/meta/1.x/1.0).

```yaml
- script-directory : db/1.x/1.0/src
Expand All @@ -52,3 +52,5 @@ path-to\SqlBundler.exe root-path sqlbundle-directory include_sample
**Example**
[https://github.com/frapid/frapid/blob/master/src/Frapid.Web/db/meta/1.x/1.0/rebundle.bat](https://github.com/frapid/frapid/blob/master/src/Frapid.Web/db/meta/1.x/1.0/rebundle.bat)
[Back to Developer Documentation](README.md)
6 changes: 4 additions & 2 deletions docs/developer/overrides.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Overrides
# Overrides

Frapid searches for overridden views on the instance directory and loads them if found.

Expand All @@ -14,4 +14,6 @@ for foo.com and

`~/Catalogs/bar_com/Areas/Frapid.Account/Views/SignUp/Index.cshtml`

for bar.com.
for bar.com.

[Back to Developer Documentation](README.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
126 changes: 126 additions & 0 deletions docs/developer/website-builder/theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Creating a Website Theme

Frapid supports multiple themes per tenant. For foo.com domain, the themes directory is:

`~/Catalogs/foo_com/Areas/Frapid.WebsiteBuilder/Themes/<ThemeName>`

Once a theme is uploaded to the themes directory, frapid will automatically discover it.

## Theme Components:

| Component | File | Description |
| --- | --- | --- |
| Theme Configuration File | Theme.config | Contains theme information and configuration. |
| Homepage Layout File | Layout-Home.cshtml | Homepage layout file. |
| Default Layout File | Layout.cshtml | Layout for site pages. |
| Theme Header | Header.cshtml | Site header |
| Theme Footer | Footer.cshtml | Site footer |
| 404 Document | 404.cshtml | 404 document |
| Theme Preview Image | Preview.png | Screenshot of the theme. |

These file names are mandatory:

* Theme.config
* Preview.png
* 404.cshtml

## Theme.config Example

```xml
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="Author" value="Frapid" />
<add key="AuthorUrl" value="http://frapid.com" />
<add key="AuthorEmail" value="[email protected]" />
<add key="ConvertedBy" value="N/A" />
<add key="ReleasedOn" value="16 December 2015" />
<add key="Version" value="1.0" />
<add key="Category" value="Corporate &amp; Business" />
<add key="Responsive" value="Yes" />
<add key="Framework" value="Semantic UI" />
<add key="Tags" value="business, corporate" />
<add key="HomepageLayout" value="Layout-Home.cshtml" />
<add key="DefaultLayout" value="Layout.cshtml" />
</appSettings>
</configuration>
```

## Quickstart Guide

Let's build a very basic theme using [Semantic UI](http://semantic-ui.com/).

### Basic Layout

* Create a directory named `example` on `~/Catalogs/<YourTenant>/Areas/Frapid.WebsiteBuilder/Themes`.
* Create an empty file called "Layout.cshtml" and Theme.config.
* Paste the following contents.

**Layout.cshtml contents**
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic Frapid Theme</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.7/semantic.min.css" rel="stylesheet">
</head>
<body>
<section id="header" class="ui attached inverted blue segment">
<div class="ui container">
<a class="ui inverted header" href="/">Logo</a>
</div>
</section>
<section id="body" style="height:calc(100% - 92px);">
@RenderBody()
</section>
<section id="footer" class="ui inverted attached segment">
<div class="ui container">
Footer
</div>
</section>
@Html.AntiForgeryToken()
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.7/semantic.min.js"></script>
</body>
</html>
```

**Theme.config contents**

```xml
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="Author" value="Frapid" />
<add key="AuthorUrl" value="http://frapid.com" />
<add key="AuthorEmail" value="[email protected]" />
<add key="ConvertedBy" value="N/A" />
<add key="ReleasedOn" value="16 December 2015" />
<add key="Version" value="1.0" />
<add key="Category" value="Corporate &amp; Business" />
<add key="Responsive" value="Yes" />
<add key="Framework" value="Semantic UI" />
<add key="Tags" value="business, corporate" />
<add key="HomepageLayout" value="Layout.cshtml" />
<add key="DefaultLayout" value="Layout.cshtml" />
</appSettings>
</configuration>
```
### Edit Configuration File

Edit the configuration file `~/Catalogs/<YourTenant>/Areas/Frapid.WebsiteBuilder/WebsiteBuilder.config`
and set `DefaultTheme` to `example`.

### Preview the site

![Basic Layout](images/theming/basic-layout.png)

Congratulations, you have successfully built a theme for frapid.

### Advanced Tutorials
* [Multiple Layouts](multiple-layouts.md)
* [Layout Sections](layout-sections.md)
* [Displaying Menus from Database](menus.md)
Loading

0 comments on commit 44b90e1

Please sign in to comment.