Issue #514💬 AnsweredOpened November 13, 2017by krunal0390 reactions

Template/ Blocks/ Components

Quick answerby artf

Well, with data-gjs-* attribute you can even use objects (JSONs) but, for bigger templates, I'd recommend block definition via an object instead

Read full answer below ↓

Question

We have requirement to create custom templates for different areas and all templates has below 4 variables anchor link, anchor target, image source, image hover text, title. We want to create one custom component and it will provide mechanism to select variables via traits. Is there way to provide template via block and use that under custom component rather than generation template in component? We want to decouple component and block so block will provide template(i.e attached image) and component will replace placeholder with user selected values?

Answers (2)

artfNovember 14, 2017

Well, with data-gjs-* attribute you can even use objects (JSONs) but, for bigger templates, I'd recommend block definition via an object instead

lock[bot]September 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.