cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic content for CMS component

frnk83
Explorer
0 Kudos

Hi everyone,

We are currently using SAP Commerce On-Prem 2205.13 and there is a requirement to modify one of the pages with some dynamic content, more specifically adding a download URL that could be maintained by the end user in the Back-Office.

The page in question is being delivered via ImpEx script which updates the CMSParagraphComponent setting the HTML as a static string in the content[lang = en] column. My first idea was to concatenate the "static" string with a dynamic property, but I haven't found a way do so... Is even possible to reference a dynamic property inside of an ImpEx script?

Another idea was to use directly a media file URL, but same situation, can I reference the media object inside the ImpEX script?

Since I'm fairly new with this content changes for Hybris, does anyone have a suggestion or a better solution?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

adamreisberg
Active Participant

Hi @frnk83 

Not knowing the full requirements, I'll give some general recommendations.

If the requirement is to have an explicit download URL (triggers a download from a browser), I'd recommend creating a new CMS Component that can handle this. The new CMS Component type can contain a reference to a MediaModel. Depending on your front-end approach, you may need additional Controllers/Renders/JSP (if using Storefront) or updated Angular components (if using Composable Storefront/Spartacus)

For examples of how to reference a MediaModel in ImpEx, reference "powertoolsstore", "apparelstore", and "electronicsstore" as a good way to see how to pull in images and/or media via ImpEx.

Hope this helps.

frnk83
Explorer
0 Kudos

Hi @adamreisberg,

Thank you for your quick response, I'll check your suggestions to see how they fit to my requirements.

Regards,

 

Answers (0)