Enabling Shortcode
Enabling Shortcode Date

Shortcode Date embeds date with given time and format.

For example:
[date format="Y-m-d" /] or
[date time="now" format="Y-m-d" /] or
[date time="+1 year" format="Y" /] etc.

Ideal usage can be -dynamic year beside copy right symbol at footer. For example: ©2013.
So, now you don't need to enable PHP Code for this.

Default values:

  • time="now"
  • format="Y-m-d"

So, If you just write [date /] then it will print 2012-12-03 (Year-month-day).

time can be any string which supports by strtotime() and format can be any string supported by date() php function.

This module have dependency on core's Filter module and Drupal Shortcode API.

Configuration

  1. You must have to enable Filter Module from core.
  2. Then install Drupal Shortcode API module and this module.
  3. Go Administration » Configuration » Content authoring » Text formats.
  4. Click configure link for which text format you want to enable this shortcode.
  5. Check mark Shortcodes.
  6. At below of this page, under Shortcode tab check mark Enable Date shortcode and you are done.
  7. Write the short code where you need, but remember you are using the short code in correct text format.
  8. However, you would need Shortcode for WYSIWYG module if you use this in a WYSIWYG editor.

Project information

Releases