Skip to main content
ccsimmons_FAVER
Inspiring
April 13, 2017
Answered

Dreamweaver CC 2017 Adding dynamic variables to a snippet

  • April 13, 2017
  • 2 replies
  • 1751 views

In ColdFusion Builder (and other IDEs including DW at one point) there is an ability to use certain "built in" variables in snippets which are translated upon running the snippet.  Below is an example of variables (and the syntax).  Does DW 2017 have this?  If so what is the syntax?  This is infinitely useful in creating snippets for sharing with team members.

  • $${DATE}
  • $${MONTH}
  • $${TIME}
  • $${DATETIME}
  • $${DAYOFWEEK}
  • $${CURRENTFILE} - Current file name (just the file)
  • $${CURRENTFOLDER} - Current folder (just the folder)
  • $${CURRENTPATH} - Current path (full file name)
  • $${USERNAME} - Current user
  • $${MONTHNUMBER} - Month as a number
  • $${DAYOFMONTH} - Day of month as a number
  • $${DAYOFWEEKNUMBER} - Day of week (the week starts on Sunday)
  • $${DATETIME24} - DateTime24 - a 24 hour clock version of datetime.
  • $${YEAR} - Current year.
  • $${YEAR2DIGIT} - Current two digit year.
This topic has been closed for replies.
Correct answer Preran

Thanks for your reply, but I am not looking to make ColdFusion snippets.  I mentioned ColdFusion Builder as an example of a product Adobe owns that uses what I am looking for.  DW also had it at one point years ago.

I am looking to make snippets that can utilize built in variables so that the snippet can automatically generate something such as a comment which has the current user name and the date in a specific format rather than me having to type my user name and type the current date.

This functionality would be useful because I could share it with my team and everyone could generate the same text formatted the same way with minimal input.


Hi Christopher,

You can make a feature request to the team directly using Adobe Dreamweaver: Ideas: Hot (1431 ideas) – Adobe Dreamweaver CC: Feature Ideas If your idea gets enough traction, it will surface to the top and help the team prioritize your request.

Thanks,

Preran

2 replies

ccsimmons_FAVER
Inspiring
May 4, 2017

Git is not what I am looking for.  I'm simply looking to access some "system variables" within snippets I am creating.  Please take a moment to read the "System Variables" section of this post: https://www.monkehworks.com/coldfusion-builder-snippets/  to see how this is handled in ColdFusion Builder snippets.  Maybe it will clear up, or better explain what I'm looking for.

pziecina
Legend
May 4, 2017

I think that functionality was only included when the CF extension was installed, the extension though was removed from distribution with the removal of the server behaviours in CS6.

ccsimmons_FAVER
Inspiring
May 4, 2017

I don't know the history so that could be true.  What I am asking for, however, is not a ColdFusion behavior or related to ColdFusion.  It is simply the ability to have a snippet like this:

<!-- $${MONTHNUMBER}.$${DAYOFMONTH}.$${YEAR}: $${USERNAME}: $${Comment Text} -->

So that when the user runs it Dreamweaver fills in the monthnumber, dayofmonth, year, and username (of the computer they are working on) so they don't have to type them.  Additionally, in a perfect world, based on the example above, they would be prompted with a dialog that said "Comment Text" and they could enter in some text.  The result that Dreamweaver would output the following:

<!-- 05.04.2017: ccsimmons: Text the user entered when prompted -->

My initial question was whether or not system variables existed.  They obviously don't.  I think the best course of action is for me to do a feature request as suggested by @Preran so that maybe this could be added if I can describe it so enough people see the value in it.

ccsimmons_FAVER
Inspiring
May 3, 2017

No one?

BenPleysier
Community Expert
Community Expert
May 3, 2017

Dreamweaver has been neglecting ColdFusion over the years, hence the snippets that you are looking for do not exist. You can produce your own snippets as per Learn how to reuse code in Dreamweaver with the Snippets panel

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
ccsimmons_FAVER
Inspiring
May 3, 2017

Thanks for your reply, but I am not looking to make ColdFusion snippets.  I mentioned ColdFusion Builder as an example of a product Adobe owns that uses what I am looking for.  DW also had it at one point years ago.

I am looking to make snippets that can utilize built in variables so that the snippet can automatically generate something such as a comment which has the current user name and the date in a specific format rather than me having to type my user name and type the current date.

This functionality would be useful because I could share it with my team and everyone could generate the same text formatted the same way with minimal input.