We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29796
    • 91 Posts
    I managed to do any project in MODX .. but next one is a little problematic so i need some advice.

    I have to create a system for a lot of small affiliate webpages. Basicly each new client needs it's own page with two or three resources and few banners. They need an option to edit those resources and manage own banners.

    I allready done multiple sites with multiple domains before, but in this case i don't know how many affiliates will have .. so i need a quick way to add a new affiliate wich means:

    1. add new context
    2. create default resources in that context
    3. create permissions for that context
    4. create a user with permissions to edit own context ...

    if i needed to setup this for few users no probem.. but new users will be added daily .. if i need only to duplicate some context, change settings and create an user .. that's ok ... but to create permissions for that user / context each time is a little problematic, because that has to be done by our administration without programming or modx knowledge..

    More or less i know how to do it, but it involves a lot of custom programming ... so i'm asking if there is some simple solution i don't know ?

    Basicly i need a way that allows me to add new affiliate page with few clicks ...
      • 22019
      • 390 Posts
      Do you have to use different contexts, or could you just use containers? In Bob Ray's book he outlines how to create Member Pages - which is effectively what you're doing here. Starts on p 489.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 29796
        • 91 Posts
        well .. i have to use a lot of different domains and on each domain will be a small site .. basicly one page with some text, contact inf. and few banners ..

        for multi-domain i allways used contexts for such things .. i don't know how to display different resources in speciffic domains ...

        i'll check it out official guide .. but i don't think that i need member pages ... all pages will be public visible .. page owners must have a chance to edit them ...
          • 3749
          • 24,544 Posts
          You might think about creating two plugins, one to add a context selection to the user form (connected to OnDocFormPrerender) and the other to create the necessary settings and permissions (connected to OnUserFormSave, but only operating on new users).


          There's an example in the book of adding fields to the user form and processing them in a plugin.


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 29796
            • 91 Posts
            I'll check it out thanx ...

            just to be clear .. for each site i need:

            -one Context
            -one user group with permissions to access that context
            -one user in that user group
            -one media source

            so basicly for 10 sites i will have 10 context 10 users and 10 user groups ? ... i have also to figure out tohse media sources how to use them

            Is there a shortcut for those user groups .. i mean .. is possible to limit user acces