Jump to:

3402 Posts in 979 Topics by 855 members

Template Questions

SilverStripe Forums » Template Questions » Creating a table in templates or importing a CSV file

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1315 Views
  • redcirce
    Avatar
    Community Member
    22 Posts

    Creating a table in templates or importing a CSV file Link to this post

    I am creating a site for a traditional-type auction house. They have sales catalogues that list items for auction at upcoming events and may have more than one of their catalogues online at any one time.

    Ideally, I'd like to be able to create some sort of data table into which they can upload a CSV file (or similar) that will populate their sale catalogue. I think I could use CsvBulkLoader for this, but am not sure and I'll need to look into it.

    In the interim, is it possible to create a table in a .ss template so the layout for the catalogue is already there for them to type the data into? I've given it a go, but it's not showing up in the template at all.

    Thanks in advance.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Creating a table in templates or importing a CSV file Link to this post

    Can you please post the content of your .ss template?

  • redcirce
    Avatar
    Community Member
    22 Posts

    Re: Creating a table in templates or importing a CSV file Link to this post

    Hi Sam. The table shows up in the published site, but not in the admin/editor.

    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
          <h2>$Title</h2>
       
          <div class="ramindpageholder">
    <div class="ramphoto">$Photo.SetHeight(200)</div>
             <div class="ramindpageline">
             <div class="rambox"><p>Event:</p></div>
             <div class="ramdataindbox"><p>$EventTitle</p></div>
          </div>
          <div class="ramindpageline">
             <div class="rambox"><p>Date:</p></div>
             <div class="ramdataindbox"><p>$EventDate</p></div>
          </div>
          <div class="ramindpageline">
             <div class="rambox"><p>Inspection Date:</p></div>
             <div class="ramdataindbox"><p>$InspectionDate</p></div>   
          </div>
             
          </div><!--ramindpageholder-->
          <table width="500" border="0">
           <tr>
              <td width="200"><p>Pen</p></td>
              <td width="200"><p>Tag</p></td>
              <td width="200"><p>ItemDate</p></td>
              <td width="200"><p>ItemColor</p></td>
              <td width="200"><p>ItemCondition</p></td>
           </tr>
           <tr>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
           </tr>
          </table>

    <div class="clear"></div>
       
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
       <% if Menu(2) %>
          </div><!--content-->
       <% end_if %>
       
       
    </div><!--typography-->

    Thanks!

    1315 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.