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

1547 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 $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+1 more
PixelDima
says
29 posts
  • Located in Italy
  • Has sold $1,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
+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.

1100 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
+4 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.

1859 posts The Last Man Standing
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Helped several times protecting Envato Market against copyright violations
+9 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
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Has sold $500,000+ on Envato Market
+5 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…

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by