We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30023
    • 172 Posts
    This is an auto-generated topic for ResourceEditor 1.0-beta2 by TimGS.

    Brief Description:

    Development of NewsEditor by Raymond Irving. Beta version already in use on one large commercial site, but the various options are not all thoroughly tested as yet.
    Feedback on usage, type of usage and success (or otherwise) is appreciated and will aid development.
      • 5699
      • 46 Posts
      computersolutions.cn Reply #2, 15 years, 7 months ago
      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.
        • 23610
        • 37 Posts
        First of all - thank you TimGS for a great addon!
        Quick review: it’s easy to setup, powerful and just works.

        The only bugs/missing features I found so far:
        -(bug) missing "$" in line 575 in "!aliasPreserve"
        -(bug) aliases are updated even if I set aliasPreserve to 1
        -(feature) parameter to define document group

        I’m implementing your code in my new project and it works like a charm.
        Thank you again!

        EDIT:
        There was a conflict with CustomAlias plugin and ResourceEditor.
        Anyway I found a main bug in line 575 creating problem with preserving alias:
        if (!aliasPreserve || empty($existing_resource['alias'])) $flds['alias'] = $alias;

        Should be:
        if ($aliasPreserve=='0' || empty($existing_resource_row['alias'])) $flds['alias'] = $alias;
        if ($aliasPreserve=='1') $flds['alias'] = $existing_resource_row['alias'];
        

        And I changed line 488 from:
        if(!$aliastitle)

        to:
        if($aliastitle=='0')

        Now it works as it should smiley