Thanks for visiting Marketpath. We use cookies to make this website work better for you and to track site visits anonymously.

Tell Me More Ok, Continue

Fieldset Objects Add Unlimited Flexibility

November 25, 2020 by Matt Zentz

Building a website requires planning and serious attention to detail. Every element on every page needs consideration for how editors will add or update its content. For most content, developers can easily create a list of editable regions and then display them on a page. But what about a repeating list of custom data, like a person’s certifications or degrees? Or a product technical specifications that varies from one product to the next?

Prior to Marketpath’s latest release, Operation Discollama (aka Release 1.3.1), developers could use a datastore to create objects with custom fields. Datastores are very powerful containers and the items within them can have their own pages and templates, can be linked to other datastores, and be queried throughout the entire site (fig. 1).

datastore-item-page
Figure 1 - Datastore Item page

This works well if data needs to be normalized and reusable in other areas of the site. But if the data only applies within the context of a single page, a Datastore is overkill. It also adds extra work and potential confusion for editors.

Fieldsets

fieldset-multipleThe Marketpath CMS Fieldset object provides the capability to create repeatable lists of custom and complex content types without the extra overhead of a datastore.

A Fieldset object contains a set of fields such as text, html (WYSIWYG), checkbox, radio, link, image, document, etc. It can even add other fieldsets for repeatable lists inside repeatable lists!

Creating a Fieldset

A Fieldset can be added to templates, datastores, custom profile settings, and custom site settings. The Fieldset object type appears all the way at the bottom of the New Field dialog. Once selected you can begin to add fields to it (fig 2).

fieldset-template-create
Figure 2 - Adding a new Fieldset object and its fields

Fields inside a fieldset can also be conditional on other fields inside that fieldset and enforce validation of the content.

Editing a Fieldset

One major benefit of using a Fieldset is that the editing takes place inline with all the other editable fields (fig. 3). You never leave the context of the page or entity you’re editing, unless the Fieldset field requires a selection of some sort. Those lists are also sortable - making it easy to reorder content with a simple drag-and-drop interface.

fieldset-editor
Figure 3 - Editing a fieldset, adding degrees

Displaying Fieldset Data

Displaying the fieldset data is incredibly easy to do in Marketpath CMS templates. In the example below, the Fieldset id is degrees_certifications. We simply iterate through its items and reference the individual fields, such as degrees_certifications.institution.

{% for degrees in entity.degrees_certifications %}
  <h5>{{ degrees.name }}</h5>
  <div>{{ degrees.institution }}</div>
  <div>{{ degrees.year }}</div>
{% endfor %}

The sample page will render out like figure 4. Of course, we’ve stripped some wrapper tags and classes to simplify the example.

fieldset-rendered-example
Figure 4 - Example of a rendered Fieldset list of custom objects

Unlimited Flexibility

Marketpath CMS was already quite powerful and flexible before Fieldsets but now there are unlimited ways to build and make content editing easier than ever. Save editors time and confusion by incorporating Fieldsets into your site today.

 

Related Tags: Development,

Matt Zentz, founder of Marketpath

Matt Zentz

Matt Zentz launched Marketpath from a small Broad Ripple bungalow in February 2001 with a focus on custom web application development. He built the first, basic version of a hosted CMS called Webtools and shortly afterward expanded his team and created the first version of Marketpath CMS.

Matt has worked for a national consulting firm, taught computer programming to high school juniors and seniors , and led the information technology arm of the auxiliary business units at Indiana University.

Matt graduated from Indiana University in 1999 with a B.S. in Computer Science and has built custom web applications since 1995. Matt is husband to an amazing & supportive wife, has three beautiful children, and supreme master to Archimedes (Archie) the dog. He coaches various kid sports, enjoys building furniture, and plays guitar and piano. Matt is very active within his church community and several area not-for-profits.

Ready to see Marketpath CMS in action?

Schedule a Demo Now