We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46580
    • 167 Posts
    I'm working on a documentary project.

    I'd like to 'broadcast' some web context resources (Extra Collections and their child resources/items) along localized web contexts (i.e: fr, en)

    I'm able share 'web' context Collections child-sources/items as lists along contexts 'fr' and 'en' using getResources :

    'web' context Collection (id)
    'fr','en' contexts : getResource (id) > output Collection child-resources/items as lists

    Therefore I'm searching a way to share Collections items/child-resources as items along
    'en' and 'fr' contexts.

    I'm thinking about 2 ways :

    1/ automatically create a symlink in 'en' and 'fr' for each 'web' Collection child-resource/item created with a plugin as described in these posts :

    https://forums.modx.com/index.php/topic,59415.0.html
    https://forums.modx.com/index.php/topic,66425.msg379597.html

    2/ use a special page to output dynamically each 'web' Collection child-resources/items in each localized contexts.

    Example :

    Collection items/child resources list (with getResources)
    id(1) > link to special page with &retrieveWebResourceId=1 > output WebResourceId=1 content in each context-localized 'special page', show the localized 'special page' with same alias than WebResourceId=1

    id(2) > link to special page with &retrieveWebResourceId=2 > output WebResourceId=2 content in each context-localized 'special page', show the localized 'special page' with same alias than WebResourceId=3

    id(n) > link to special page with &retrieveWebResourceId=n > output WebResourceId=n content in each context-localized 'special page', show the localized 'special page' with same alias than WebResourceId=n

    http://fr.website.net/doc/web-collection1-itemresource1/ > should output http://www.website.net/doc/web-collection1-itemresource1 in 'fr' context

    http://en.website.net/doc/web-collection1-itemresource1/ > should output http://www.website.net/doc/web-collection1-itemresource1 in 'en' context

    http://n.website.net/doc/web-collection1-itemresource1/ > should output http://www.website.net/doc/web-collection1-itemresource1 in 'n' context


    It supposes that the 'special page" (one for each localized context, unique ID) should have different aliases regarding retrieved collection items/child-resources.
    I guess it could have some consequences regarding SEO, maybe caching (?)...

    Please note I use Babel, but I obviously don't want to have to duplicate collections items/child-resources for each localized contexts.

    3/ Or, a third way -- but I didn't yet tested the extra -- with Contextualize 1.0.1-rc1 http://modx.com/extras/package/contextualize ?

    What is the best way? [ed. note: johnxx last edited this post 11 years, 10 months ago.]
      MODX lover
      -
      Développeur MODX / Webdesign / Solutions web
      • 6629
      • 60 Posts
      Try renderResources.
      I've used it to share news and job offers on a site with multiple contexts.
        • 46580
        • 167 Posts
        Working on idea n°2 :

        created a symlink resource
        with symlink value [[!#get.docid:stripTags]] (extra fastfield)

        setting_allow_forward_across_contexts = 1

        ../specialpage/?docid=23

        works fine but the specialpage cannot be cached to output right data...

        In order to have a more SEO friendly URL, I think I will easily use /specialpage/alias
        and retieve the correct ID for the symlink

        But I don't know exactly how search engines will consider this... [ed. note: johnxx last edited this post 11 years, 10 months ago.]
          MODX lover
          -
          Développeur MODX / Webdesign / Solutions web
          • 46580
          • 167 Posts
          Quote from: DasItsch at Dec 07, 2014, 07:02 AM
          Try renderResources.
          I've used it to share news and job offers on a site with multiple contexts.


          What is the difference with getResources?
            MODX lover
            -
            Développeur MODX / Webdesign / Solutions web