sidor
statistik
inställningar
statistik
employee_1
inställningar
Bidragsgivare:
  • Klobber
Senast ändrad: 2023-01-19

Code sample comparison

To get an understanding of how the Easyweb.site-template code looks compared to other systems, we asked ChatGPT to generate how some sample output could look when using some common CMSÂŽs, and wrote the same sample code as it would look written in the Easyweb.site-template.

We asked:

How does a typical standard article page html view with 
h1, introduction, images and a link list look in X?

Wordpress

In reply for Wordpress, we received:

Here's an example of how the main content section of 
the HTML might look when using data fetched from WordPress:
<div class="main-content">
<p><?php the_excerpt(); ?></p>
<div class="featured-image">
<?php the_post_thumbnail(); ?>
</div>
<p><?php the_content(); ?></p>
<div class="link-list">
<ul>
<?php
$links = get_field('links');
if($links):
foreach($links as $link):
?>
<li><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></li>
<?php
endforeach;
endif;
?>
</ul>
</div>
</div>

Contentful CMS/Prismic CMS

In reply for Contentful CMS/Prismic CMS (only keys differed in the result), we received:

Sure, here's an example of how the main content section of 
an article page might look when using the Contentful CMS and its Content Delivery API:
<div class="main-content">
<p>{{fields.excerpt}}</p>
<div class="featured-image">
<img src="{{fields.image.fields.file.url}}" alt="{{fields.image.fields.description}}">
</div>
<p>{{fields.mainContent}}</p>
<div class="link-list">
<ul>
{% for link in fields.links %}
<li><a href="{{link.fields.url}}">{{link.fields.title}}</a></li>
{% endfor %}
</ul>
</div>
</div>

EpiServer CMS

In reply for EpiServer CMS, we received:

Sure, here's an example of how the main content section of 
an article page might look when using the EpiServer CMS:
<div class="main-content">
<p>@Model.CurrentPage.Excerpt</p>
<div class="featured-image">
<img src="@Model.CurrentPage.Image.Url" alt="@Model.CurrentPage.Image.Description">
</div>
<p>@Html.PropertyFor(m => m.CurrentPage.MainContent)</p>
<div class="link-list">
<ul>
@foreach (var link in Model.CurrentPage.Links)
{
<li><a href="@link.Url">@link.Title</a></li>
}
</ul>
</div>
</div>

Easyweb.site-template markup

When converted to common Easyweb.site-template markup, this is what the same example would look like:

<div class="main-content">
<p ew-for="excerpt"></p>
<div class="featured-image">
<img ew-for-src="image" />
</div>
<p ew-for="the-content"></p>
<div class="link-list">
<ul ew-list="links">
            <li><a ew-for-href="$this" ew-for="$label"></a></li>
</ul>
</div>
</div>



Easyweb icon

Den hÀr webbplatsen anvÀnder cookies för att förbÀttra din anvÀndarupplevelse, för sÀkerhetsrutiner och för statistik. Genom att fortsÀtta anvÀnda webbplatsen godkÀnner du anvÀndningen av cookies.

LÀs gÀrna vÄr integritetspolicy. Om du godkÀnner vÄr anvÀndning, vÀlj Acceptera alla. Om du vill Àndra ditt val i efterhand hittar du det alternativet lÀngst ner pÄ sidan.

Cookies