Silverstripe Version: 4
Question:
Hey guys, I’m new to Silverstripe and I’d really appreciate some pointers. I’ve have been building a portfolio using it and have designed a custom page type ‘Project page’. My project pages follow this layout:
-----Header-----
Title | Information
Title | Information
Title | Information
-------Footer--------
The title and information boxes are in different sized Bootstrap columns within in a row, (each row has 2 columns). “Title” will be a Varchar and “information” a HTMLText.
I could add a bunch of pre-existing custom fields on each project page to pull onto the page (if the data exists) but as each project may have different amounts of rows this seems sloppy.
What I’d really like to do is have the ability to add or delete different rows at will (each row contains both variables, Title and Information) in the CMS. For example something like this on each Project page:
Row 1
Title: ____________
Information: ____________Add New Row | Delete Row
The fields from each row would be collected in a loop and each one will generate this markup to the page:
<section>
<div class="row">
<div class="col-md-5 col-sm-12">
<h3>Title</h3>
</div>
<div class="col-md-7 col-sm-12">
<div class="proj-info">
<p>Information</p>
</div>
</div>
</section>
Any ideas? Thanks heaps!