Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created January 30, 2025 13:20
Show Gist options
  • Save sitefinitySDK/3768108aa15aab88b0cc69d4a4ea7bfd to your computer and use it in GitHub Desktop.
Save sitefinitySDK/3768108aa15aab88b0cc69d4a4ea7bfd to your computer and use it in GitHub Desktop.
import React from 'react';
import { StaticSectionEntity } from './static-section.entity';
import { ViewPropsBase } from '@progress/sitefinity-nextjs-sdk/widgets';
import { RenderWidgetService } from '@progress/sitefinity-nextjs-sdk';
export function TwoMixedView(props: ViewPropsBase<StaticSectionEntity>) {
const column = (containerName: string, className: string) => (
<div className={className} data-sfcontainer={containerName}>
{props.widgetContext.model.Children.filter(x => x.PlaceHolder === containerName).map(x => {
return RenderWidgetService.createComponent(x, props.widgetContext.requestContext);
})}
</div>
);
return (
<section {...props.attributes} className="row" >
{column('Column 1', 'col-4')}
{column('Column 2', 'col')}
</section>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment