English 中文(简体)
Modx assign default date to template variable
原标题:
  • 时间:2009-11-27 07:10:07
  •  标签:
  • modx

I have a template variable of input type date but I d like to have a default value of the current date at the time the document was first saved.

I ve noticed that using the date formatter widget gives an option to "If no value, use current date" however it seems to use the date at the time it is being viewed rather than the date at the time the document was created.

Any help appreciated.

问题回答

I think the only way to get the date when the article was saved for the first time is to use [ * createdon * ]

If there is a way to add the created date to a TV, I am not sure. I think your best shot would be to see if you have an event that you could "hook" you Template Variable, and then use the createdon variable everytime the article is saved! I am not sure this works, but This could be a possible!





相关问题
predefine template for new resource/document

I would like to set the new child documents to default to a set template that is different from the parent. I ve looked through managermanager, but looks like it is unable to do this. mm_inherit can ...

Modx css issue not pulling in styles on the form

I m editing a site using Modx cms. I m trying to add a contact form to the contact page. I already have one in the sidebar specified in a template. The code on the contact page form points to the same ...

PHP MODx mysql Parse error? Where do I change the settings?

Hi I m using MODx on a site, but something has gone wrong with the database. Any idea how I can change the PHP to point to my database? « MODx Parse Error » MODx encountered the following error while ...

Print a table in modx to send info for mail by eForm

My question is, how can I create a table with dynamic fields (I will explain this later), and send them values by mail with eform? In the table, on the left, I want to print all the document children ...

Simple PHP CMS as an alternative to hacking Wordpress

For creating common user modifiable site I ve been forcing Wordpress to do the work of a CMS. It s worked and the back-end is purdy but it s just too hacky for my tastes. So I d like a simple CMS that ...

Modx assign default date to template variable

I have a template variable of input type date but I d like to have a default value of the current date at the time the document was first saved. I ve noticed that using the date formatter widget ...

热门标签