BlogPost
The BlogPost server control displays an individual blog post on a page. There are 2 ways that this control displays a blog post.
- If a user is logged in as an Ektron or a membership user, the control displays the blog post, comments, and comments from the Web page.
- If a user is not logged in, the control displays only the blog post.
NOTE: The Enable Comments property in the Workarea must be enabled for comments and the comments form to appear.
Inserting the BlogPost server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the BlogPost server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:BlogPost ID="BlogPost1" runat="server" />
- Click on
BlogPost
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
BlogPost properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- CacheInterval (Double)
The number of seconds that a server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See also: Caching with server controls.
- DefaultContentID (Long)
The ID of a default blog post that appears where you inserted this server control if no other content block is identified, or is not available. If you don’t know the ID number of the blog post, use the CMS Explorer to browse to it.See also: Browsing your Ektron site using CMS Explorer
- DisplayXslt (String)
If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder. - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- DynamicParameter (String)
To make this blog post dynamic, select id. When you do, this server control uses the blog post passed as a URL parameter.
- GetAnalyticsData (Boolean)
Set this property to True if you want the following information for each content in the list. Returns Content View Count, Content Rating, Content Rating Average. Create your own XSLT styles to display this data.
IMPORTANT: This property provides reliable data only when the Business Analytics Feature is on. See Running Ektron Business Analytics.
- GetThankYouMessage (Boolean)
Determines whether a message appears after adding a blog comment.
- True. Displays "Thank you" message after adding a blog comment
- False. Do not display the message.
- True. Displays "Thank you" message after adding a blog comment
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- ShowType (String)
Shows a blog post’s content and its comments or only its comments. The default is Content.
- Content. Show blog post’s content and comments.
- Description. Show comments only.
- Content. Show blog post’s content and comments.
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.