filer
block_1
news_2
news_2
meny
statistik
Contributors:
  • Klobber
Last edited: 1/19/2023

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>



This website uses cookies to improve your user experience, for security routines and for statistics. By continuing to use the website, you agree to the use of cookies.

This website uses cookies to improve your user experience, to provide a basis for improvement and further development of the website and to be able to direct more relevant offers to you.

Feel free to read ours privacy policy. If you agree to our use, choose Accept all. If you want to change your choice afterwards, you will find that option at the bottom of the page.

Cookies