Thought I’d add a comment, as I didn’t see anything yet.
This looks pretty good for our use as a front end editor for clients that don’t want the gazillion options of the backend visible as it confuses them.
You might want to integrate a front end listing or example of usage for people.
I’m also not clear on how you set the template editor to richtext or not.
Suggest add a how to use file in the package, or package instructions page.
eg
Here’s how to use ResourceEditor to administer pages.
In our example, we’ll setup a simple events editor interface.
Install ResourceEditor as a snippet.
Create a folder for the new / edited resources to go in. eg Events. Note the folder id
My folder ID is 51, so I’ll be using that in the examples below.
Create a new page called Add New Event
Add this to the page
[!ResourceEditor? &folder=`51` &scfields=`pagetitle,introtext,content` &requiredFields=`pagetitle,introtext` &aliastitle=`1` &logging=`1` &editOnly=0 !]
As we don’t pass &editID AND we set &editOnly to 0 this tells ResourceEditor to add a new page in our Events folder when we save this in the front end.
Create a new page called Edit Events set this to hidden from the menu (as we will call this from our page listing).
Note the page ID as we will need it later. My ID is 52 in the example
[!ResourceEditor? &folder=`51` &scfields=`pagetitle,introtext,content` &requiredFields=`pagetitle,introtext` &aliastitle=`1` &logging=`1` !]
Create a new page called List Events
Add this
[!Ditto &parents=`51`&orderBy=`createdon ASC` &display=`10`
&paginate=`1` &tpl=`EventsListtpl`!]
<p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Events | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong> </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>
Now add a chunk for our Events Listing called EventsListtpl
[+title+] <a href="[~52~]?editid=[+id+]">Edit[/a><br />
If you check, you’ll see we added the url for the page editor (52) as a url [~52~]?editid=[+id+]
This will make a link to our page editor with the id for the page we want to edit.
If you visit the List Events page it will show / allow you to edit any events you’ve added.
Simple!
This is a simple example of integrating Add / Edit functionality in the front end.
Lawrence.