Altering forms from Silverstripe CMS - silverstripe

I'm a beginner to silverstripe and am happy for someone to just point to a relevant section of the docs if they know where I should read. I just haven't been able to find very good instruction on this.
So I have created an Enquiry form for a site I'm building, and have:
/template/Layout/EnquiryPage.ss
/mysite/code/EnquiryPage.php
/mysite/code/EnquirySubmission.php
All are working well, users can upload enquirers and they are stored in the database.
What I want however is, as an admin, to be able to see/edit/delete these forms from within a tab in the CMS. What do I need to know about to be able to do this?
Thanks

Sounds like you want a ModelAdmin.
Pro tip: Don't forget to set your canEdit(), canDelete(), etc. permission methods on your DataObject.

Related

Wordpress - CRUD operation from the front end

I'm in a bit of crux here. I have this application designed that basically allows users to enter info, create an entry, etc. etc. all the usual CRUD operations from the front end only. No user should ever have to mess around with the admin page.
When this was designed, I was thinking of using the standard way of just using JavaScript to grab all the necessary info, put it into a JSON object, and send that back to the SQL database.
However, there are a few issues with this. I'm not sure how to hook up javascript code to a button in wordpress that will fetch the entered info and upload this to wordpress SQL database, and then later retrieve this information.
I've seen lots of plugins, for instance, wpdataaccess, which is create in terms of creating an SQL database and such, but it doesn't really have much functionality for a customizable CRUD front-end. There are shortcodes, which are about the closest that you can come to this.
But ideally I'd like to somehow just have a button with JavaScript code that says like ok grab the info from each of the fields and upload it to the SQL database.
Is this only possible with a custom-coded plugin? Or do plugins for this already exist? Or do I even need a plugin?
Really any help would be appreciated here.
Also, you're probably wondering why I'm using wordpress... I don't really have an option here - I've got a raspberry pi OS that was built on top of WordPress so I sort of have to stick with it.
Thank you so much
I was able to find a solution to this. Use the plugin gravity forms to have users enter their data. Then, you can display the data back with another plugin, gravity view.

Silverstripe URL Mapping

I'm trying to understand how URL Mapping works. I've gone through numerous pages, but I can't seem to wrap my head around what I'm trying to do.
Its really simple, I use DataObjects as pages approach and I have a member extension written to the member class. And I have the typical actions, show, edit, add.
So if I go to www.mywebsite.com/members/show/1 I can see the first user. If I change show to edit, I can edit the first user. Now if I go to www.mywebsite.com/members/add I can create a new user. This is working all as expected due to the functionality I created in the add method.
My problem is in the fact that when you go any website, you don't register to the website by going to members/add, you register by going to website.com/Register or something similar. From code management perspective, it is a lot easier for me to leave the code the way it is now. I don't want to have to create a Register page and move the code there, instead I am trying to figure out if it is possible to go to www.mywebsite.com/Register and have it load www.mywebsite.com/members/add. I am not talking about a redirect link that would update the url, I want users to still see Register in the url and not see /members/add.
Vice versa, if users were to go to www.mywebsite.com/members/add I want the link to update to Register or say page not found.
Is this possible with Silverstripe Framework?
I am not 100% sure, but I believe this is called URL Masking.
This is very possible, firstly I'd advise that you look over...
silverstripe-memberprofiles
...because even if you dont' want to use an existing module I'm sure there would be useful information. There is a great example of "pure" routing (i.e. silverstripe no cms) that leads on to "nested" routes - which is what I think you are asking for, so I highly recommend reading the slides below and then the created todo app
silverstripe-framework-building-without-the-cms
todo app source

ASP.NET MVC Entity admin CRUD

Im looking for something similar to rails admin for asp.net.
Essentially I need to write an admin layer that allows most table data to be changed / searched etc.
I could generate basic scaffolding however I'm wondering if there is a free or commercial admin package that would give a nice UI admin interface to the data.
Ideally I need to be able to control and add logic to it also.
I create Ilaro.Admin and it is exactly what you looking for, but please keep in mind there are a lot of stuff to do.

Starting out with Wordpress - Creating a text book application

I am basically a Java/Oracle guy. I was told that it is possible to build any simple Web app with Wordpress.
I successfully installed Wordpress on my machine and am trying to create a text book app. For this purpose, it is an employee database, with fields Name, Address, Department, Designation. I need to have the usual create/edit/search/delete functionality.
The problem with Wordpress is, I really don't know where to start, or how to customize pages.
Am I barking up the wrong tree? Is Wordpress more for blogging/news style websites than for traditional database applications? If not, how do I customize Wordpress to create the application described above?
Thanking you in advance.
Viability
Wordpress is a great system for many different applications, not just blogging/news style websites.
There are many articles out there that go in to great depth on this, but here is a good one right of: http://torquemag.io/app-dev/
Getting Started
As with any project, there clearly is more than one way to skin this cat, but right off, here are some basics I'd recommend you check out about customizing your Wordpress install:
How to create a child theme: http://codex.wordpress.org/Child_Themes
How to create a page template: http://codex.wordpress.org/Page_Templates
How to develop a plugin: http://codex.wordpress.org/Writing_a_Plugin
Plugins
In addition to this, i'd highly recommend a few plugins, which will help make things easy for you:
Advanced Custom Fields
•Makes it really easy to add Custom Fields, to allow you to store custom information, associated with a post, page, taxonomy, user etc. really easy to use, has great documentation and support, as well as a really nice UI. I'd also recommend paying the 25 bucks for the repeater field, which is really useful.
Custom Post Type UI
•Easy way to add custom post types to your wordpress instal, the default post types are: posts, links, pages. With this plugin you can add custom post types for things like say, employees.
Conclusion
In conclusion, I don't think you're barking up the wrong tree, I think that wordpress can be a simple elegant solution for a web application, and can easily be molded into almost anything you can come up with.
For developed such kinds of application you need to develop a wordpress plugins. You can handle any kinds of database operation there. You can add create/edit/search/delete functionality

Drupal - form or content type and general how to do it?

(I know there is a module, but I'm trying to learn on my own)
I basically want some kind of form or page where I create a form for an administrator.
So, the administrator can fill in the question and can add more than one right answer. Sorta like a multiple choice question with more than one answer.
The user will go ahead and answer the question.
Do, I create a content type? Do I use form api instead. Not sure at this moment how to go about it.
Thanks.
The Quiz module provides tools for authoring and administering quizzes through Drupal. A quiz is given as a series of questions, with only one question appearing per page. Scores are then stored in the database.
From what I get, you can create a custom drupal module and use form api for creating Multipage forms and add pragmatically add validaters for adding you correct result before moving to the next page/form.
Writing a simple. Hope this helps and contact if you need help.

Resources