[go: up one dir, main page]

0% found this document useful (0 votes)
813 views56 pages

InsiteCreation 2010 Administrator & Developer's Guide

Administrator and Developer's Guide 2009, Insite Mitra Inovindo. InsiteCreation 2010 can be installed on most shared hosts or dedicated servers. Create a blank database in MSSQL 2005 / later. 2. Run storeproc.sql in Query Analyzer against your newly created database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
813 views56 pages

InsiteCreation 2010 Administrator & Developer's Guide

Administrator and Developer's Guide 2009, Insite Mitra Inovindo. InsiteCreation 2010 can be installed on most shared hosts or dedicated servers. Create a blank database in MSSQL 2005 / later. 2. Run storeproc.sql in Query Analyzer against your newly created database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Administrator & Developer’s Guide

 2009, Insite Mitra Inovindo, All Right Reserved.

0
Administrator & Developer’s Guide
Contents
Installation Module Development
2 42
2 Installing InsiteCreation 2010 42 Creating a Module

Understanding Channels & Users 42 Embedding a Module


4
7 Creating a Channel 45 Creating an Advanced Module

9 Channel View Permissions


52 Listing Template Development
10 Example 1: Creating a Member Area
53 Creating a Listing Template
12 Example 2: Creating a Client’s Area

14 Creating a User

16 Setting-up Approval Workflow


17 To Approve or Decline a Page

Site’s Language & Settings


19
19 Language Files

21 Mini Sites
21 Creating a Mini Site

24 Template Development
24 Built-in Templates
27 Template Files
27 Adding a New Template
28 Applying Your Template
30 Creating a Template
34 Placeholder Configuration
35 Template Stylesheet
36 Optional Themes/Skins
37 Creating a Template that
allows Online Design
40 Creating Multiple Designs
from a Single Template

1
Administrator & Developer’s Guide
Installation
Installing InsiteCreation 2010
InsiteCreation 2010 can be installed on most shared hosts or dedicated servers that support ASP.NET 3.5.
Below are the general installation instructions for a shared host.

A. Database Setup
1. Create a blank database in MSSQL 2005/later.
2. Run storeproc.sql in Query Analyzer against your newly created database.
3. Run ASPNET_REGSQL.EXE in the .NET framework 2.0 folder:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.x\ASPNET_REGSQL.EXE

Note that you don’t need to run ASPNET_REGSQL.EXE directly from your web server. You can use
any computer running .NET framework v.2.0 which has a connection (via internet or local network)
to your database server. The wizard that comes up will guide you through the setup.

B. Website Setup
1. Unzip InsiteCreation package.
2. Copy/ftp all files under the root of your website so that they can be accessed from:
http://YOURSERVER/
3. Grant ASP.NET “write permission” to the resources folder.
4. Open file web.config using your preferred text editor.
a. Update the database connection setting in the web.config file.
For example:

<connectionStrings>
<add name=”SiteConnectionString”
connectionString=”Data Source=DATABASESERVER;
Initial Catalog=DATABASENAME;
uid=john;pwd=123;trusted_connection=false;”
providerName=”System.Data.SqlClient”/>
</connectionStrings>

2
Administrator & Developer’s Guide
b. Specify your mail settings. For example:

<system.net>
<mailSettings>
<smtp from=info@InsiteCreation.com>
<network host=”mail.InsiteCreation.com”
password=”password”
userName-info@InsiteCreation.com />
</smtp>
</mailSettings>
</system.net>

c. Choose a folder in your web server and grant “write permission” to it.
Then set the FileStorage setting in web.config with the folder location. For example:

<add key=”FileStorage” value=”D:\secure_storage”/>

Note: For secure storage, we recommend that you choose a folder on your hosting server
that is not accessible through HTTP.

C. Finalizing

1. Open http://YOURSERVER/setup/default.aspx where you can specify admin password.


2. Remove the file http://setup/default.aspx from your server.
3. Installation is complete. Open http://YOURSERVER.

3
Administrator & Developer’s Guide
Understanding Channels & Users
In InsiteCreation, content/pages are organized into channels. Channels can be created based on
departments in your company or organization. For example, you (as an Administrator) can create channels
such as “Accounting”, “IT Department”, “Support”, etc. You can even create channels for your customers or
clients.

Below is an illustration of a site structure with its channels:

4
Administrator & Developer’s Guide
In an Article Portal, for example, you can create a channel for each author so that each author has its own
area in which to post articles.

In a Club Website, for example, you can create a channel for Public or Members only.

5
Administrator & Developer’s Guide
When creating a channel, the system will automatically create 6 roles for the channel to which users can be
assigned. For example: if we create a channel named “Members”, the following 6 Roles are created for it:

Members
Subscribers have read-only access to the content of the channel.
Subscribers
Authors can contribute content to the channel (Create a Page, Edit a Page, and Delete a
Members Authors
Page).
Editors are the first tier of the approval workflow. Authors must submit their work for
Members Editors
approval. An editor may approve or reject content submitted by Authors.
Publishers are the top tier of the approval workflow. A page approved by an Editor must go
to the Publisher(s) for final approval and publication; if no one is assigned to this channel,
Members work approved by an Editor is published directly to the site.
Publishers
Note: If no Editor or Publisher is assigned, Authors may publish their work directly to the
site.
Members
Resource managers are able to upload resources (images, media files, documents, etc.) to
Resource
the channel.
Managers
Members Module
Module managers are able to embed modules.
Managers

Because users are assigned to specific channels, it’s easy to give site visitors access to protected areas they
need to see, while keeping them locked out of areas where they don’t belong.

Note that a user may have more than one role.

6
Administrator & Developer’s Guide
Creating a Channel
To create a channel, open your Dashboard, then select the Channels link.

Link to your Dashboard

Select Channels link.


1

7
Administrator & Developer’s Guide
Enter a descriptive name for the
2 All existing channels will be listed.
3 new channel.

Choose a default template for the channel from the drop-


down list. Templates are pre-existing documents that define
4 the layout and overall appearance of your web pages.

Specify who will be able to access/view the channel content by choosing from the View Permission
5 drop-down list. There are 3 options under view permissions for each channel:
• Everyone (Anonymous Users); will make the channel content accessible to the public.
• All Users (Registered); will make the channel content accessible to all registered users.
• Channel’s Users only; will make the channel content accessible only to users who are
assigned rights to this specific channel (users that have one of the 6 channel’s Roles listed
above).
Tick the Disable Collaborative Authoring checkbox if you want only the user who creates a
6 page to be able to edit that page.

7 Click the Create button to add your channel to the system.

8
Administrator & Developer’s Guide
Channel View Permission
When creating a channel, we have three options to allow public or restricted access to the content within
the channel.

The 3 types of channel access (view) permissions are:


• Everyone (Anonymous Users); will make the channel content accessible to the public.
• All Users (Registered); will make the channel content accessible to all registered users.
• Channel’s Users only; will make the channel content accessible only to users who are assigned
rights to this specific channel (users that have one of the 6 channels’ Roles listed above).

Below is a summary of user rights within channels.

Logged-in Users
Anony-
Users Users with Role(s)
mous
Users without Sub- Resource Module Adminis-
Role(s) scribers Authors Editors Publishers
Managers Managers trators
Everyone
View, View, View, View,
(Anony- Embed
View View View Contri- Approve/ Approve/ Contribute All
mous Modules
bute Decline Decline resources
Users)
View All Users View, View, View, View,
Embed
permissions (Regis- - View View Contri- Approve/ Approve/ Contribute All
Modules
tered) bute Decline Decline resources
View, View, View, View,
Channel’s Embed
- - View Contri- Approve/ Approve/ Contribute All
Users only Modules
bute Decline Decline resources

As seen on the table:


• Anonymous users cannot view content within the channel when view permission is set to All Users
(Registered).
Only registered users may view the content.
This type of channel is useful if you want to create a member area on your website where
only registered users may access the content.
• Not all registered users can view content within the channel when view permission is set to
Channel’s Users only. Only users that have one of the 6 Roles in that channel may access the
content. This type of channel is useful if you want to create a more private area on your website,
where only certain users (not all registered users) may access to the content.

Note that if you are the only person who manages your website, after installation, you can just login as an
Administrator and start managing your website’s content. In this case, you don’t need to setup channels
and users.

9
Administrator & Developer’s Guide
Example 1: Creating a Member Area
When planning your website, you may want to make some content available to the general public, while
making other content available only to members, such as club members or website subscribers. The
following steps explain how to create a member area:

Create a channel and set View


Permission to All Users (Registered).
1 In this example, we named the
channel: Members.

Go to a page that you’d like to make viewable by members only. In this


2 example, the page chosen is members.aspx (Creating a page will be explained
in the next section). On the page channel information, click the Change link to
open the Change Channel dialog.

Change the page channel to the


3 new Members channel and click Save.

10
Administrator & Developer’s Guide
When site visitors try to open the members.aspx, a login
form will be displayed, requiring them to enter a valid
4 username and password to access the page. Since the
channel view permission is set to All Users (Registered), all
registered users will be able to login and open the page.

Note:
When creating the channel Members, the system will automatically create 6 Roles to which users can be
assigned:
• Members Subscribers;
• Members Authors
• Members Editors
• Members Publishers
• Members Resource Managers
• Members Modules Managers

Since the Members channel view permission is set to All Users (Registered), then all registered users
(regardless of their own roles) may also view the content.
If you want to allow only users from a certain role, see example 2.

11
Administrator & Developer’s Guide
Example 2: Creating a Clients’ Area
In much the same way that you might want to limit some content to all registered users, you may want to
provide your clients with a unique content area where they can securely view (or even modify) work in
progress, download project contracts, and access other sensitive documents. In this case, not all registered
users are able to open that area. Only users that are members of the Channel can open the area.

Create a Channel and set View


Permission to Channel’s Users only.
This means that pages assigned to this
channel can be opened only by users
1 from this channel and not all
registered users. In this example, we
named the channel: Clients.

When this channel is created, the system will automatically create six roles to which users can be assigned:
1. Clients Subscribers
2. Clients Authors
3. Clients Editors
4. Clients Publishers
5. Clients Resource Managers
6. Clients Module Managers

Go to a page that you’d like to make accessible only to your clients.


2 In this example, the page chosen is clients.aspx. On the page channel
information, click Change link to open Change Channel dialog.

Change the page channel


3 to the new Clients channel and click Save.

12
Administrator & Developer’s Guide
As a result, the page will not be visible on site navigation.
4

Your clients will need to be logged in first (via the login link or login form provided on the
site) to be able to see links to any pages assigned to the Clients channel. Site users that
do not have one of the six roles listed above will not be able to see links to the
5
clients.aspx. Even if they know the URL, they won’t be able to access the page.

13
Administrator & Developer’s Guide
Creating a User
To create a user, open your Dashboard.

1 Select the Users link.

14
Administrator & Developer’s Guide
A list of all existing users will be displayed on the Users screen:

Fill in the new user information


2

Select one or more roles you want


3 the user to have.

Click Create to add the user to the


4 system. The message “Your account has
been successfully created.” will be
displayed.

15
Administrator & Developer’s Guide
Setting up Approval Workflow
InsiteCreation supports approval workflow that consists of Editor and/or Publisher approval.
You can assign users either as an Editor or Publisher in a channel so that the channel has an approval
workflow, otherwise pages in that channel will be published directly without approval.

When editing page content, you have either a Publish button or a Send for Review button.
If approval is needed, the Send for Review button is displayed; otherwise the Publish button will be
displayed.

Publish Button Send for Review Button

16
Administrator & Developer’s Guide
To Approve or Decline a Page
To see a list of pages which have been submitted for approval, open your Dashboard.

Users who have an Editor or Publisher role will be


1 able to see the list of pages which have been
submitted for approval. Note that if a page is
submitted, it is passed to the Editors first and then to
the Publishers. Publishers will not see the page here
until it is approved by an Editor.

An Approval Assistant is also available to users with an Editor or


Publisher role. Try selecting the Approval Assistant link. 2

17
Administrator & Developer’s Guide
Select the page you
wish to approve or
decline from the list by
3 clicking the checkbox
next to that page.

Click the Approve button or the Decline button.


4 When a page is declined, the page is made available for the author to make revisions.

You can also approve or decline a page by opening the page and using the Approve or Decline links in the
Page Info box.

18
Administrator & Developer’s Guide
Site’s Language & Settings
InsiteCreation allows you to change the language (culture) of your site. Your site will render the text,
captions, date, and number format according to the selected language (culture). Go to the Dashboard and
select Update Site Settings.

The Site Settings panel is


1 displayed.

Change culture setting here.


2

Language Files
A culture in InsiteCreation requires language files. If you select a culture for your site that doesn’t have
language files, then the default English language files will be used automatically.

Language files are found in the following folders:


• <yourwebsite>/App_LocalResources
• <yourwebsite>/dialogs/ App_LocalResources
• <yourwebsite>/systems/ App_LocalResources
• <yourwebsite>/modules/ App_LocalResources

Language files (also called resource files) are files with the extension “resx” that contain language
translation of the application text or captions. You can translate the application panels of InsiteCreation by
adding your language resource files. To translate the panels to German for example, duplicate all resource
files in the above folders and add “.de-DE” to the end of the file name. For example:

account.ascx.resx

would be:

account.ascx.de-DE.resx

19
Administrator & Developer’s Guide
You can then translate all the text or captions defined in the new resource files. The translation will be
applied automatically if the site has the culture setting set to German (Germany).

Below are some country codes you can use:


• da-DK - Danish (Denmark)
• de-DE - German (Germany)
• el-GR - Greek (Greece)
• en-US - English (United States)
• fi -FI - Finnish (Finland)
• fr-FR - French (France)
• it-IT - Italian (Italy)
• ja-JP - Japanese (Japan)
• nl-NL - Dutch (Netherlands)
• pl-PL - Polish (Poland)
• sv-SE - Swedish (Sweden)
• zh-CN - Chinese (People’s Republic of China)
• en-GB - English (United Kingdom)
• nl-BE - Dutch (Belgium)
• nn-NO - Norwegian, Nynorsk (Norway)
• es-ES - Spanish (Spain)

20
Administrator & Developer’s Guide
Mini Sites
InsiteCreation allows you to create multiple mini sites with different languages (cultures). With this feature,
you can:
• Create multiple-language sites,
• Create mini sites for each of your company’s departments,
• Create mini sites for each of your club members,
• Etc.

The term “mini” does not refer to the size of the site. You are able to create as many pages as you like on a
“mini” site, just as you would on the main site.

Creating a Mini Site


To create a new site, go to the Dashboard, then select the Manage Mini Sites menu. Follow the steps
below:

Enter the Home Page for the


1 new site (ex. default-de.aspx for
German).

Enter a Description (i.e.


2 “Germany (German)”.

Enter the Instruction Text as it


3 will appear in the country
selection drop-down menu.
Note: The country selection
drop-down menu is displayed
on your site only if you are
using
placeholderCountrySelect on
your template (See Template
Development section).

Country Selection drop-down.

Select the relevant Culture from


4 the drop-down list. This will
determine the formatting of
numbers and dates on the site
and will apply language files if
available. If language files for the
selected culture are not
Click the Create button to Check the Set Active available, the default English
6 create your new site. 5 checkbox to make your new language files will be used.
site visible in the country Language files will be explained
selection drop-down menu. further in the next section.

21
Administrator & Developer’s Guide
A new site is now created. Try clicking the Go To link.
7

8 Now you are on the main page of your new site.

As you can see, the site is still empty. Before adding content, you may want to specify the
9 site name or logo to be displayed on the header, copyright info on the footer, and any
other design aspects.
Go to the Dashboard by selecting the My Dashboard link and then select the Templates
menu.

10 Click the Design link.

22
Administrator & Developer’s Guide
Here you can specify the design aspects of your site.
10
Here are some facts about a mini site:
• A mini site is created in the same location (domain) of your existing site.
• A mini site has a separate menu/navigation system.
• Each mini site has a role called “Site Managers”. You can assign users to this role to be an
administrator of the site.

23
Administrator & Developer’s Guide
Template Development
InsiteCreation uses design templates to separate content from design. You can change the design of your
web page by applying a different template to the page.

Built-in Templates
Below are the built-in templates in InsiteCreation:

Bubble 01 Bubble 02

Bubble 03 Clean 01

Clean 02 Clean 03

24
Administrator & Developer’s Guide
Elegant 01 Elegant 02

Flash 01 Flash 02

Flash 03

Fresh 01

Gradient 01

Fresh 02
25
Administrator & Developer’s Guide
Gradient 02
Simple 01

Simple Blue Simple Green

Simple Orange Simple Red

26
Administrator & Developer’s Guide
Template Files
You can create your own template(s) or use the built-in templates provided by InsiteCreation. You can also
modify the built-in templates to meet your needs.

A basic template contains the following files:

• default.master, main template file.


• default.css, a stylesheet for the template file.
• print.master, template for printer friendly page
• editing.css, stylesheet for WYSIWYG Editor

TIP: You can copy these files from any built-in template and modify them according to your site design.

Adding a New Template


Before we look further at how to create a template, the steps below show how to add a new template to
use in InsiteCreation.

InsiteCreation files

Templates are located in the templates


folder. Copy your template files here.
1 In this example, we named our new
template folder: simple_01.

27
Administrator & Developer’s Guide
Go to the Dashboard
2 and select the
Templates menu.
Here you can register
the template. Fill in the
name and select the
folder simple_01.

Click Save to finish. Now the template is available


3 for use.

Applying your Template


If you want to apply the template to all pages within a certain channel, go to the Dashboard and select the
Channels menu.

Click Edit on the channel in


which you want to apply
1 the template to all pages in
that channel.

Here you can change the


2 default template.

28
Administrator & Developer’s Guide
If you want to apply your template to a specific page, go to that page and edit it.

Click Edit to edit


1 the page.

2 Select Page Properties.

You can change the page


3 template on the Page
Properties dialog.

In the next section, we will look further into the main template file: default.master.

29
Administrator & Developer’s Guide
Creating a Template
Now we will look further at how to create a template. The main template file is the default.master file,
which contains mainly regular HTML code with placeholders for various elements (menu, title, body
content, etc). You can create and edit this file using any text editor. We would recommend that you use
Visual Web Developer which you can download from the Microsoft website.

Below are the basic requirements for the default.master template file:

It must inherit from InsiteCreation’s


1 BaseMaster class

A header element with the runat


2 property set to “server”

A link to default.css. You can copy & modify the


3 default.css from the InsiteCreation’s prebuilt template.

5
A Form element in the Placeholders to display
4 form of <frm:Form ...> title, body content, etc.

30
Administrator & Developer’s Guide
Here is a simple example of a template with more placeholders and previews:

31
Administrator & Developer’s Guide
Here is how your site would look with the template applied:

Besides the above placeholders, below are examples of other available placeholders you may use in your
templates.

32
Administrator & Developer’s Guide
Here are empty placeholders that
you can use for any purpose.
You can embed modules in all
these placeholders by clicking the
Add Modules link.
Note: placeholderBody is the
placement of page content.

placeholderMenu_Tree placeholderLoginForm placeholderPageTools

33
Administrator & Developer’s Guide
Placeholder Configuration
Several placeholders are configurable using the file: default.xml. This file is optional and can be added in
your template folder.

Placeholder Configuration file

Here is the default.xml content:

34
Administrator & Developer’s Guide
Template Stylesheet
The stylesheet for a template is called default.css, located in the template folder. In this css file,
placeholders can be formatted according to your site design.

TIP: you can use/copy the default.css from any built-in template and modify it according to your site
design.

35
Administrator & Developer’s Guide
Optional Theme/Skin
A skin is used to format several controls used in your website, for example: GridView, TreeView,
Calendar, etc. Skins are optional.

To create a Skin, create a folder under the App_Themes folder with the sama name as your template
folder. For example, if you have a template located at: <yourwebsite>/templates/simple_01/ you would
then create a folder: <yourwebsite>/App_Themes/simple_01/

Skin file

TIP: You can copy SkinFile.skin from <yourwebsite>/App_Themes/global/ and modify it according to your
needs.

In the Skin folder, you can also have a stylesheet file and even an image folder. The stylesheet will be
applied automatically to your site.

Image folder

Stylesheet file

36
Administrator & Developer’s Guide
Here is the Skin’s Stylesheet.css file:

Creating a Template that allows Online Design


Several built-in templates in InsiteCreation support online design. This means you can easily modify design
aspects of the templates using an online design panel without any coding required. Go to your Dashboard
and select the Templates link.

Try clicking the Design link on the


1 Gradient 01 template.

37
Administrator & Developer’s Guide
The Design panel will be displayed. Here you can fill-in the header text
2 (site name), upload a header image, change the background, etc.

When placing your cursor into the Background Color textbox, a color picker is displayed which allows you
to choose a color easily.

38
Administrator & Developer’s Guide
To create a template that supports online design, you need to add a few things in default.master and
default.xml files. To do this, follow the steps below:

Default.master 1 Give an ID=”pageBody” to the BODY element

Create a Panel with the ID=”panelHeader”.


Give a CssClass=”header”. This is for the
2 header element.

Create an Image control with the


3 ID=”imgLogo”. This is for placing a logo.

Create a Literal control with the ID=”litSiteName”.


4 Give a default text, such as: your.website.name
This is for placing the header text/site name.

Create a Literal Control with the ID=”litCopyright”. Give a


5 default text, such as: @2010, Your Company Name…
This is for placing copyright info.

Then on the header section, add css rules for formatting body & header elements.

Default.master

Here you specify a default


6 background image and color.

Here you specify a default


7 header.

As a summary, there are 5 elements required in the default.master file:


• pageBody
• panelHeader
• imgLogo
• litSiteName
• litCopyright

Finally, in the default.xml file, you must specify default settings for the
design elements above that will be used by the Restore Default
Settings button in the Design panel in order to return any changes
made back to their original settings.

39
Administrator & Developer’s Guide
Here you specify the default
8 settings of the design elements.

Creating Multiple Designs from a Single Template


A template which supports the online design feature is able to be used to create multiple templates with
different design settings. For example, you store your template in the folder: gradient_01 and then register
the template by giving it a name: Gradient 01.

After saving, the template is registered and by using the Design panel, you can modify the design aspects of
this template.

40
Administrator & Developer’s Guide
InsiteCreation allows you to create another new template by using the same gradient_01 folder. For
example, you give a new name: Gradient 01 new.

1 Different Name

2 Same folder

As a result, you now have another new template in which you can specify different design settings in the
Design panel. With this feature, a single template can produce multiple templates with different design
settings.

41
Administrator & Developer’s Guide
Module Development
Creating a Module
A module in InsiteCreation is simply an ASP.NET (ascx) User Control. You can find many references on the
internet about how to create ASP.NET User Controls. With ASP.NET User Controls you can create any
application and embed it onto any InsiteCreation page.

There is only one basic requirement for an InsiteCreation module:

A module should inherit from


1 InsiteCreation’s BaseUserControl
class. This line is a must.

Embedding a Module
First, you need to register the module.

Copy your module file into the modules folder on your


1 website. In this example, the module file is
helloworld.ascx.

42
Administrator & Developer’s Guide
To register the module,
2 open your Dashboard,
then select the Modules
link. A list of built-in
modules will be displayed.

Enter the module


name and the ascx
3 file name.
Click Save to finish.

Now, your module is ready to use.


To be able to embed a module on a page, first go to the page where you want to embed your module. If
you have an Administrator or Module Manager role, you will see the Add module link.

43
Administrator & Developer’s Guide
Select the Add Module link to open
the Add Module dialog. 4

You will see your module is


5 listed here. Click the Add link
next to the module.

6 Your module is now embedded.

44
Administrator & Developer’s Guide
Creating an Advanced Module
Using modules, you can enhance your InsiteCreation website with added applications.
A module/application sometimes requires some settings. For example, if you want to create a Youtube
module, you would need to specify which video you want to display.
You can hard-code this information, but this can reduce the flexibility of your module.
InsiteCreation allows you to define your own variables in your module (for example: youtube video tag,
width & height of the video, etc).

Here is an example of a module that allows you to specify a Youtube Video tag.

Video Tag from


1 Youtube.

The Settings
link is displayed
2 on the module
to open the
Settings dialog.
The Video Tag
3 is entered in
the module’s
settings.

4 Youtube video will be displayed after saving the settings.

By using custom settings (in this example: Video Tag, width & height of the video), you can use the same
module to display various Youtube videos with flexible dimensions for the video display.

For storing the settings data as well as reading it, InsiteCreation provides several methods you can use:
- SetModuleData()
- SaveModuleData()
- GetModuleData()

45
Administrator & Developer’s Guide
Below, you will see how to create the Youtube Video module. We have named the file youtube.ascx.
Here is the full listing of youtube.ascx:

46
Administrator & Developer’s Guide
47
Administrator & Developer’s Guide
We will look further at the code below.
Prepare a placeholder for the module’s settings.
1 In this example, we named the placeholder ID:
“plhSettings”.

Create textboxes to
2 enter the Video Tag,
width, and height of
the video.

Use this block for the visibility settings of your module.


3
4 Add a Save button to save the Video Tag.

Add a link that will open


the Settings’ dialog. 5
Here you can use Literal control to Prepare a placeholder to show the module.
7 display the Youtube video. 6 In this example we name the placeholder ID:
“plhModule”.

48
Administrator & Developer’s Guide
8 Listed here is the Save settings method.

9 InsiteCreation provides a SetModuleData method where


you can define a variable to store any data. In this
example, we named the variable “VideoTag”.
If you have more than one variable, you call this method
multiple times.
Here is an example:

Then SaveModuleData should be called to save the data.

Now you can read the data from the


10 “VideoTag” variable. To read the data,
you use GetModuleData.

Add this block for the


11 module’s visibility
settings (see step 3).

49
Administrator & Developer’s Guide
If the module setting hasn’t been specified,
12 do not display the module.

If Video Tag is specified, then you can


13 display the module/video.

Here you would need to specify who can


14 access the module settings.

The following is how to open the setting’s panel. Use the


16 method: mDialoginline and specify the panel Setting ID, This block is required for
width & height of the panel dialog, and a title.
15 the module’s visibility
settings (see step 3).

50
Administrator & Developer’s Guide
If your module requires user authorization, you can check the user’s roles using the following properties:
- IsUserLoggedIn; checks if user has logged-in. Value: true/false.
Example: Me.IsUserLoggedIn
- IsPublisher; shows if user has a Publisher role. Value: true/false.
Example: Me.IsPublisher
- IsSubscriber; shows if user has a Subscriber role. Value: true/false.
Example: Me.IsSubscriber
- IsAuthor; shows if user has an Author role. Value: true/false.
Example: Me.IsAuthor
- IsEditor; shows if user has an Editor role. Value: true/false.
Example: Me.IsEditor
- IsResourceManager; shows if user has a Resource Manager role. Value: true/false.
Example: Me.IsResourceManager
- IsAdministrator; shows if user has an Administrator role. Value: true/false.
Example: Me.IsAdministrator
- IsReader; shows if user doesn’t have any role assigned or has a Subscriber role. Value: true/false.
Example: Me.IsReader

A custom module can also obtain several items of page/site information:


- PageID; ID of the current page where the module is embedded.
Example: Me.PageID
- Culture; Culture name of the current page where the module is embedded.
Example: Me.Culture
Sample value: ‘en-US’ or ‘de-DE’ (depends on the culture setting of the current site - See the
Sites & Localization panel)
- RootFile; Home page of the current page.
Example: Me.RootFile
Sample value: ‘default.aspx’ or ‘default-de.aspx’ (See the Sites & Localization panel)
- RootID; ID of the Home page.
Example: Me.RootID

51
Administrator & Developer’s Guide
Listing Template Development
Listings in InsiteCreation are template-driven. With a listing template you can format the look and feel of
your listing and specify its behavior.

Below is an example of the “Photo Gallery” listing template applied to a page:

52
Administrator & Developer’s Guide
Creating a Listing Template
To create a listing template, go to the Dashboard and select the Listing Templates menu.

Add a new listing template


here. Enter a name and
specify any existing listing
template to use as a base
1 template that you can
modify later. In this example,
we named the listing
template: File Explorer.

2 Click Save.

The File Explorer listing template is now


3 created. Click Edit to customize the
template.

53
Administrator & Developer’s Guide
Here you can configure the listing template.
4 A listing template contains 4 HTML templates:
- Header
- Footer
- Item (a recurring HTML to display listing entries)
- Script (can be used to embed javascript)
In item template, for example, you can add some
TAGS:
[%TITLE%] for displaying a title,
[%SUMMARY%] for displaying a summary, etc.

To create a File Explorer style of listing, enter this


5 HTML code in the Header field.

Try this HTML code in the Item field. This will


7 format each listing item to look like the
following:

In the Footer field, add closing tags for


6 the two DIV elements you added on the
Header. You’ll see later that this will
create a simple box where we will
display our listing:

The Calendar-based Listing feature is provided


8 to manage periodically updated content such as
newsletters, journals, blogs, etc.
Leave this setting unchecked.

The General Listing feature is provided to manage


9 general purpose listings such as directories, FAQ
pages, knowledge base pages, photo galleries, or
even e-commerce enabled product lists.
For this example, this option is checked.

The Use categories to organize listing There are 2 options for a General Listing page:
11 entries option allows you to organize
listing entries using custom categories.
10 - Include listing entries in the sitemap
- Exclude listing entries from the sitemap
You can leave this option unchecked. If you choose Exclude listing entries from sitemap, your
listing entries will not be displayed on the site menus.
Content Template is a template used to format page This option is recommended for managing a large
number of entries. You will also be able to specify the
12 content (title, body content, etc.). Use General Content
for basic formatting. listing ordering.
To modify Content Templates, go to your Dashboard, and
select the Content Template menu.

Click Save & finish.


13 Now, we are ready to use the listing template.

54
Administrator & Developer’s Guide
Try creating a new page and
14 check the “Make this page a
listing/gallery” option.
The “File Explorer” is available
on the listing templates
selection.
Choose this template and
publish the page.

On the newly created page try


15 uploading some files.

16 Finished! Here is the result.

55
Administrator & Developer’s Guide

You might also like