Jump to:

3395 Posts in 977 Topics by 853 members

Template Questions

SilverStripe Forums » Template Questions » Frontend forms - edit record like show record?

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

Page: 1
Go to End
Author Topic: 609 Views
  • kharmer
    Avatar
    Community Member
    8 Posts

    Frontend forms - edit record like show record? Link to this post

    Hi all,

    I'm gradually getting to grips with SilverStripe. Currently building a load of frontend pages for specific admins to add new records to custom DB tables and found the '_show' suffix for showing a single record (i.e. 'record-details/show/23/' where 23 is record ID).

    Is there something similar for editing a record in the frontend?

    Best regards,
    K...

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: Frontend forms - edit record like show record? Link to this post

    Would like to know that myself, therefor bumped. The most important thing I would like to know is how to let users add pages from the front end.

    The only thing I have found is a way to give a group of people access to one page at a time (without sitetree or tools) in the backend with lots of conditional hiding and showing. I will get back to that later.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: Frontend forms - edit record like show record? Link to this post

    Basically you want content editors who have no rights and who will not be able to mess things up and who will not be confused by all the options in the backend. So create a content editor login who can only view and edit pages, nothing more.

    Then find the following files in /cms and change them.

    # CMSMain_Content.ss
    Instead of <% include CMSBreadcrumbs %>:

       <% if $CurrentMember.inGroup(2) %>
          <% include CMSBreadcrumbs %>
       <% else %>
          <a href="/Security/logout">LOGOUT</a>
       <% end_if %>


    Last two links:

       <% if $CurrentMember.inGroup(2) %> ... <% end_if %>


    Instead of $Tools:

       <% if $CurrentMember.inGroup(2) %>

       $Tools

       <% end_if %>

    #LeftAndMain.ss

    Instead of $Menu:

       <% if $CurrentMember.inGroup(2) %>
          $Menu
       <% end_if %>

    #Add edit this page and logout link to templates of pages that may be edited.

    <a href="admin/pages/edit/show/{$ID}" title="edit this page">Edit this page</a><% if CurrentMember %> | <a href="/Security/logout">LOGOUT</a><% end_if %>


    These notes are based on the idea that the admin group is group 2. And it was tested with 3.0.2.

    609 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.