235 posts
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
  • 5 Years of Membership
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

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

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

38 posts
  • Affiliate Level 1
  • Exclusive Author
  • Author Level 4
  • Collector Level 1
+1 more
PixelDima
says
32 posts
  • Trendsetter
  • Exclusive Author
  • Italy
  • Author Level 4
+3 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.

1190 posts Yes We Can
  • 2 Years of Membership
  • Affiliate Level 4
  • Author Level 9
  • Collector Level 1
+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.

1891 posts The Last Man Standing
  • Weekly Top Seller
  • Author Level 8
  • Beta Tester
  • Moderator
+10 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.

67 posts Umbrella
  • Featured Author
  • Top Monthly Author
  • Trendsetter
  • 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
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
  • 5 Years of Membership
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