Skip to content

Commit

Permalink
Merge pull request #714 from Timo-Breumelhof/feature/713-TEXT-SKO
Browse files Browse the repository at this point in the history
Tut. > Theme Objects > Add TEXT and move ControlPanel #713
  • Loading branch information
david-poindexter authored Apr 21, 2024
2 parents 78bc15c + 3b637f9 commit a657d3f
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locale: en
title: DDRMenu XSLT Templates Overview
dnnversion: 09.02.00
previous-topic: ddrmenu-token-templates
next-topic: designers-home
next-topic: text
related-topics: theme-objects,themes,create-theme
links: ["[DNN Wiki: DotNetNuke Skins](https://www.dnnsoftware.com/wiki/dotnetnuke-skins)","[DNN Community blog: DotNetNuke Skinning 101 (Part 3) by Joe Brinkman](https://www.dnnsoftware.com/community-blog/cid/131995/dotnetnuke-skinning-101-part-3)","[DNN Professional Training: Creating HTML Skins](https://www.dnnsoftware.com/services/professional-training/training-videos-subscription/skinning-2-creating-html-skins)","[Skinning Tool / Online Reference for DNN Skins & Container Objects by 10 Pound Gorilla](https://www.10poundgorilla.com)"]
---
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/themes/theme-objects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ The <dnn:BREADCRUMB...> block should be placed in the Theme on the spot you want
|[BREADCRUMB](xref:breadcrumb)|Displays the path to the current tab (`>` is the default separator). Example: `PageName1 > PageName2 > PageName3`|
|[CSSINCLUDE](xref:cssinclude)|Load Custom Stylesheet for your Theme|
|[CSSEXCLUDE](xref:cssexclude)|Prevents a stylesheet reference from being included in the page.|
|CONTROLPANEL|Displays the DNN control panel. If the **CONTROLPANEL** theme object is not used in the theme, then DNN inserts a control panel control at the top of the page.|
|[COPYRIGHT](xref:copyright)|Displays the copyright notice for the website.|
|[CURRENTDATE](xref:currentdate)|Displays the current date on the server.|
|[DDRMENU](xref:ddrmenu-overview)|Displays a menu using the **DDRMenu** control.|
Expand All @@ -143,7 +142,7 @@ The <dnn:BREADCRUMB...> block should be placed in the Theme on the spot you want
|SIGNIN|Displays the login control.|
|TAGS|Displays the **Tag** control allowing users to view and edit tags associated with the page or module.|
|TERMS|Displays a link to the Terms and Conditions page of the website.|
|TEXT|Displays localized text in your theme and supports the use of token replacement.|
|[TEXT](xref:text)|Displays localized text in your theme and supports the use of token replacement.|
|TOAST|Adds the toast notification control to the page. Toast messages will be shown when a new user notification or message is received.|
|USER|Displays a **Register** link for anonymous users or the user's name for authenticated users.|
|USERANDLOGIN|Displays a **Register** / **login** / **User** block.|
Expand All @@ -157,6 +156,7 @@ The <dnn:BREADCRUMB...> block should be placed in the Theme on the spot you want

|**Legacy Theme Object**|**Description**|**Replaced by**|
|---|---|---|
|CONTROLPANEL|**Obsolete in DNN 9+.** Displays the DNN control panel. If the CONTROLPANEL theme object is not used in the theme, then DNN inserts a control panel control at the top of the page.|
|LEFTMENU|Displays a vertical menu layout.|DDR Menu with the appropriate template|
|LINKS|Displays a flat menu of links associated with the current tab level and the parent node.|DDR Menu with the appropriate template|
|NAV|Displays a menu according to the type specified in the ProviderName attribute.|DDR Menu with the appropriate template|
Expand Down
114 changes: 114 additions & 0 deletions content/tutorials/themes/theme-objects/text/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
uid: text
locale: en
title: TEXT Theme object
dnnversion: 09.02.00
previous-topic: ddrmenu
next-topic: theme-objects
related-topics: theme-objects,themes,create-theme
links:
---

# TEXT Theme Object Introduction

Displays Localized text in your theme / skin, also supports the use of DNN Core Token replacement.

The text will be loaded from a resource file (*.resx), you need a separate resx file per language.

These should be located in a folder named "App_LocalResources" (in the Theme folder).



## Naming convention:

When your skin file = index.ascx:
Default language: index.ascx.resx
French: index.ascx.fr-FR.resx
German: index.ascx.de-DE.resx



## Resource file content:

~~~
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="Welcome.Text">
<value>Welcome</value>
</data>
</root>
~~~


**Current Version:** 01.00.00


## Include in Theme

### ASCX
``` html
<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
<dnn:TEXT runat="server" id="dnnTEXT-Welcome" ShowText="Welcome, " ResourceKey="Welcome.Text" ReplaceTokens="False" />
```

### HTML Token
[TEXT]

### HTML Object Token
``` html
<object id="dnnTEXT" codetype="dotnetnuke/server" codebase="TEXT"></object>
```

| Attribute | Description | Default | Posssible Values | DNN Version |
| --- | --- | --- | --- | --- |
| ShowText | The text to display if there is no text<br/>available from a resource file. | | | 01.00.00 |
| CssClass | This value is the name of a CSS class that will be added to the rendered HTML.<br/>(the text will be rendered inside a span) | Normal | | 01.00.00 |
| ResourceKey | The name of XML element's content in the resource file (*.resx) to be used. | | Hello.Text | 01.00.00 |
| ReplaceTokens | This true/false value will tell DNN to look for system tokens and replace them with the appropriate text | False | True<br/>False | 01.00.00 |

## Tokens
> [!NOTE]
>
Below is only a small selection of the tokens that can be useful, but you can use all of the supported Core Tokens




| Name | Value | Description |
| --- | --- | --- |
| User Display name | [User:displayname] | The display name of the current user |
| User First Name | [User:firstname] | The first name of the current user |
| User Lastname | [User:lastname] | The last name of the current user |
| Portal Name | [Portal:portalname] | The name of the current Portal |




## Examples:

### Text Theme Object Fallback text
Show Fallback text as the Resourcekey is not found

~~~html
<dnn:TEXT runat="server" id="dnnTEXT-fallback" ShowText="Fallback" CssClass="dnn-text" ResourceKey="Main.Text" ReplaceTokens="False" />


~~~


### Text Theme Object EN, FR, NL text
Example for English, French and Dutch

~~~html
<dnn:TEXT runat="server" id="dnnTEXT-Demo" ShowText="Demo" CssClass="dnn-text" ResourceKey="Example.Text" ReplaceTokens="False" />
~~~


### Text Skin Object Tokens
Use Tokens for a personalized message

~~~html
<dnn:TEXT runat="server" id="dnnTEXT-Tokens" ShowText="Tokens" CssClass="dnn-text" ResourceKey="Token.Text" ReplaceTokens="True" />
~~~

1 change: 1 addition & 0 deletions content/tutorials/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
####[Razor Templates Overview](xref:ddrmenu-razor-templates-overview)
####[Token Templates](xref:ddrmenu-token-templates)
####[XSLT Templates](xref:ddrmenu-xslt-templates)
###[TEXT](xref:text)
##[Persona Bar Style Guide](xref:persona-bar-style-guide)

#[JWT](xref:jwt)
Expand Down

0 comments on commit a657d3f

Please sign in to comment.