235 posts
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
GraphiTivity
says

Hey guys is it possible to make working short codes in html templates to build widgets etc as we do in wp.

Ex

If I add some code like [calendar] in a html page it should display a calendar. Is this possible? If so please share any helpful links

Thanks V

1559 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE
says

It’s possible with Javascript templating languages, for example: https://github.com/janl/mustache.js

38 posts
  • Has referred 1+ members
  • Sells items exclusively on Envato Market
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+1 more
PixelDima
says
31 posts
  • Sells items exclusively on Envato Market
  • Located in Italy
  • Has sold $5,000+ on Envato Market
  • Has been part of the Envato Community for over 2 years
+2 more
Epeo
says

The shortcodes are fine but if you do an html version is better to not include them, the reason is the same that makes it possible: JS. If there is an error with js or is simply deactivated the template will lose all the content. That’s why the CMS like WP, Joomla, etc uses PHP.

1172 posts Yes We Can
  • Has been part of the Envato Community for over 2 years
  • Has referred 100+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+7 more
CRIK0VA
says

The shortcodes are fine but if you do an html version is better to not include them, the reason is the same that makes it possible: JS. If there is an error with js or is simply deactivated the template will lose all the content. That’s why the CMS like WP, Joomla, etc uses PHP.

+1. No needs to use Shortcodes in HTML.

1883 posts The Last Man Standing
  • Had an item that became a weekly top seller
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Helps us moderate the forums
+11 more
ImanGM
Moderator
says

The shortcodes are fine but if you do an html version is better to not include them, the reason is the same that makes it possible: JS. If there is an error with js or is simply deactivated the template will lose all the content. That’s why the CMS like WP, Joomla, etc uses PHP.

+1

If you want to do this in a special situation, it’s ok but generally it’s better to leave it as a simple HTML page.

66 posts Umbrella
  • Made it to the Authors' Hall of Fame
  • Became a Top 20 Author of the Month
  • Had an item that was trending
  • Had an item that became a weekly top seller
+8 more
UmbrellaStudios
says

Hi

I just found a Shortcode Parser which does what you need.

https://www.npmjs.org/package/shortcode-parser

Peace.

235 posts
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
GraphiTivity
says

WOW! thanks so much… you guys are awesome. it would have taken me ages to discover all this…

by
by
by
by
by
by