Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsthe 3.3.0 versionthe 3.3.0 version
Previous
 
Next
New Post
6/17/2006 6:16 PM
 

The new template does not work.  If you mix announcements without read more and with read more. The read more will show up in both cases.
The feature to add a date to the title was very good it works better than  using the created date. Both for some countries  and if you like to have a static date. You cant change the creation date.

Maybee it is bugs or maybee by design ?

 

 
New Post
6/20/2006 1:25 PM
 

A few related things:

1) Adding the URL tag to any link (As when you make the title a link) will direct the link to the same page. Maybe enclosing tags would better to handle this. For example:

[URL][TITLE/][URL/] Then the title would be rendered within a link when apropriate.

2) Adding the URL tag to text when the URL returns nothing should hide the text.


Do you know the truth when you hear it?
Néstor Sánchez
The Dúnadan Raptor -->Follow Me on Twitter Now!
 
New Post
6/21/2006 7:47 AM
 

My comments are valid for the 3.3.1 version too.

An other observertion.

In the settings you change the value template a value that are a translatable resource field. This pattern mixes settings and translating. In this stage of DNN the harm is not a big deal due to the fact that just static fields are translatable.

If you alter the template setting the resource field will not bee read for the module.

For the future, I hope, this will not bee so good. Maybee a redesign of this in this stage would bee a better solution.

By the way a lot of helpfield are not in place yet.

Jan

 
New Post
6/23/2006 5:26 PM
 

I had a look at the empty link url "problem". 2 Issues are at hand:

* the "read more..." link should be invisible/deleted when no link is provided
* if the title is linked, the title should not be invisible/deleted, it should just not be a link

I took a shot at solving this with a regular expression. My first attempt looked like this:

strContent = Regex.Replace(strContent, "<A\b[^>]*>(.*?)</A>", "$1", RegexOptions.IgnoreCase Or RegexOptions.Singleline)

this looks for any string that looks like this: <a [...]>[innertext]</a>, and replaces it with just [innertext], in effect removing the hyperlink. For the title this is a fine solution, for the "read more..." it isn't, because i would like to delete "read more..." instead of just removing the link. This reveals another issue: "read more..." should be localized, because, as Jan already mentioned, if someone changes the template, it is no longer read from the resource file, and thus can no longer be localized. My solution for this is to add a new token [MORE], which can be localized, and also be used for generic deletion of the link in case it's empty, that is done like this:

strContent = Regex.Replace(strContent, "<A\b[^>]*>\[MORE\]</A>", "", RegexOptions.IgnoreCase OrRegexOptions.Singleline)

This will just delete any complete hyperlink that looks like <a ...>[MORE]</a>

Wrapping it up, my final lstAnnouncements_ItemDataBound looks like this now:

Private Sub lstAnnouncements_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles lstAnnouncements.ItemDataBound

   Dim strContent As String = strTemplate
   Dim strValue As String
   Dim clearURL As Boolean

' add content to template
Dim objProperties As ArrayList = Common.Utilities.CBO.GetPropertyInfo(GetType(AnnouncementInfo))
Dim intProperty As Integer
Dim objPropertyInfo As PropertyInfo
For intProperty = 0 To objProperties.Count - 1
   clearURL =
False
   objPropertyInfo = CType(objProperties(intProperty), PropertyInfo)
   strValue = Server.HtmlDecode(DataBinder.Eval(e.Item.DataItem, objPropertyInfo.Name).ToString())
   
Select Case objPropertyInfo.Name.ToUpper
      
Case "URL"
         
If strValue <> "" Then
            
strValue = FormatURL(strValue, CType(DataBinder.Eval(e.Item.DataItem, "TrackClicks"), Boolean))
         
Else
            
clearURL = True
            
strValue = ""
         
End If
      
Case "CREATEDDATE"
         strValue =
CType(strValue, Date).ToLongDateString
      
Case "NEWWINDOW"
         
If CType(strValue, Boolean) Then
            
strValue = "_new"
         
Else
            
strValue = "_self"
         
End If
   
End Select
   
If Not strValue = "" Then
      
strContent = strContent.Replace("[" & objPropertyInfo.Name.ToUpper & "]", strValue)
   
End If
      
If clearURL Then
         
strContent = Regex.Replace(strContent, "<A\b[^>]*>\[MORE\]</A>", "", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
         strContent = Regex.Replace(strContent, "<A\b[^>]*>(.*?)</A>", "$1", RegexOptions.IgnoreCase
Or RegexOptions.Singleline)
      
End If
Next intProperty

strContent = strContent.Replace("[MORE]", Localization.GetString("More.Text"))

' assign the content
Dim lblContent As Label = CType(e.Item.FindControl("lblContent"), Label)
lblContent.Text = strContent

End Sub

My first change to the Announcements module as (yet unofficial) Announcement Module Team Lead ;)

Cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
6/25/2006 3:40 PM
 

It just occurred to me that the regex used would also turn of other links in the template if the announcement link was none. I changed the regex to be this: <a[^>]*\[URL\][^>]*>(.*?)</A>, so it would match an url that would look like this: <a href="[URL">some text</a>, but not something like this: <a href="http://www.google.com">some text</a>

cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsthe 3.3.0 versionthe 3.3.0 version


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out