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 ForumsXMLXMLPortal current datePortal current date
Previous
 
Next
New Post
6/11/2007 6:23 AM
 

Hi

I'm using xml/xsl module to display corporate announcements. I've a XML file that stores metadata of what I've to display.

One of the metadata is the publishing date and the expiration date. There is no way to pass the browser/portal current date to the xsl like parameter to have this value in the xsl to filter data?

I see that XML and XSL parameters are varous, but no date it's available.

At the minute I use a javascript to create a remporary XML and create in a HTML module the transformation, but... this fails in browsers that are no IE and expecially on Mac this doesn't work.

Thanks in advance

Regards

Daniele

 
New Post
6/13/2007 12:46 PM
 

Just to clarify my request. XSLT has no functionality to retrieve the current date. there is a way to have this field available? I've tried to add a parameter with this value, but "static value" doesn't works.

any idea where locate something like "Date()" that retrieve current date?

Thanks

Daniele

 
New Post
6/13/2007 1:21 PM
 

Yes, you will need to alter the xml module.

You would need to add the needed code to the following files:
~app_code\xml\parameters\parametertype   ->add a new CurrentDate to the Enum
~app_code\xml\parameters\parameterinfo   ->alter Getvalue to support ParameterType.CurrentDate
~DesktopModules\XML\Parameters\ParameterEditor.ascx -> add a new listitem to cboparamType, please add it as last item

That is the idea. I will add tis enhancement to the next release.

 
New Post
6/18/2007 11:26 AM
 

Hi Stefan

I got a my colleague that made the mod for me. I had this issue that I think need to be considered for your futute XML/XSL release: the format used to display the date is strictly related with browser language selected.

IIn other words the initial mod based on the VB code:
                Case ParameterType.CurrentDate ' Custom CurrentDate
                    Return Date.Now.ToShortDateString()

gave a non consistent date format result. XSLT 1.0 has no functions to handle correctly dates, so I rebuild dates using format like substring-after(substring-before(xxx,'/'), '/')... and this is the format date is not consistent "dd/mm/yyyy" or "dd-mm-yyyy" or worst "mm-dd-yyyy" generate a huge complication to write and andle XSL.

 

I've asked myt colleague of something more consistent and what I've now:
                Case ParameterType.CurrentDate ' Custom CurrentDate
                    Return Date.Now.ToString("yyyy-MM-dd")

give a consistent result and I can handle date better than before.

I hope this "live" experience may help.

Regards

Daniele

 
New Post
8/8/2007 4:25 PM
 

Just wanted to add a bit to this discussion...

I was previously using an embedded script inside my xsl to accomplish this type of usage, but as Stephan pointed out, using embedded scripts incurs a heavy performance load, as well as opens up some security issues.  So, support of xsl scripting was removed from the latest release. 

So, I made the changes as previously mentioned, but with a slight difference which gives me the ability to use the module in the manner we need. The post title indicated that this would provide PortalDate info, but actually, the method illustrated is pulling the date info from the Server point of view.  So, I made my mods as follows:

        Case ParameterType.ServerDate ' Custom CurrentDate
                        Return Date.Now.ToString("yyyyMMdd")

        Case ParameterType.ServerDateTime ' Custom CurrentDate
                        Return Date.Now.ToString("yyyyMMddHHmmss")

You can see I named the options ServerDate, and ServerDateTime.  We did it in this manner to support using a custom xml file that contains button links that have a pubDate and ExpireDate.  With these 2 options, we can use XML/XSL to dynamically display the button links for the desired period of time.  It's an older method of providing user site navigation, but it was needed to support the client's need.

If the module is updated to include this kind of support for DateTime, it's important to implement it with the correct point of view, which means that support is needed to display the Server date time info, and the Portal date time info.  At least, that's what I'm doing, and I would like to see it incorporated in future releases, just to save me from making the mods myself, but now that we have the knowledge to do it, it's not that big a deal, but would be appreciated.

Thanks for sharing the info...

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLPortal current datePortal current date


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