File tree Expand file tree Collapse file tree
src/Libraries/SmartStore.Services/Cms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ public enum StoryAssetKind
4545 /// <summary>
4646 /// The property value is a manufacturer identifier.
4747 /// </summary>
48- Manufacturer
48+ Manufacturer ,
49+
50+ /// <summary>
51+ /// The property value is a link builder expression.
52+ /// </summary>
53+ Link
4954 }
5055}
Original file line number Diff line number Diff line change @@ -70,6 +70,31 @@ public string Link
7070 }
7171 }
7272
73+ /// <summary>
74+ /// Creates the full link expression including type, value and query string.
75+ /// </summary>
76+ /// <param name="includeQueryString">Whether to include the query string.</param>
77+ /// <returns>Link expression.</returns>
78+ public string GetExpression ( bool includeQueryString = true )
79+ {
80+ if ( Value == null )
81+ {
82+ return string . Empty ;
83+ }
84+
85+ var result = Type == LinkType . Url
86+ ? Value . ToString ( )
87+ : string . Concat ( Type . ToString ( ) . ToLower ( ) , ":" , Value . ToString ( ) ) ;
88+
89+ if ( includeQueryString && Type != LinkType . Url && ! string . IsNullOrWhiteSpace ( QueryString ) )
90+ {
91+ return string . Concat ( result , "?" , QueryString ) ;
92+ }
93+
94+ return result ;
95+ }
96+
97+
7398 public override string ToString ( )
7499 {
75100 return this . Link ;
You can’t perform that action at this time.
0 commit comments