We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2249
    • 60 Posts
    Hi All,

    I am building a 6 language site with modx revolution and babel - modx revolution is pretty new to me as im just switching from evolution.

    I have setup Babel and its working great, now im trying to setup some navigation. I have all of my contexts setup with and their start page id stored in the settings for each context. My question is how do i get at that id?

    Ive found the context like so:
    $modx->context->get('key');
    which returns the context code (de/fr etc). I was hoping i could do something like this:
    $modx->context->get('site_start');
    but i cant seem to fine a function that does that.

    This is what one of my contexts looks like:

    Name Key Value
    Base URL base_url /pfu/website/de/
    Culture Key cultureKey de
    Site Start site_start 14
    Site URL site_url http://192.168.0.246/pfu/website/de/



    Would really appreciate any help!

    Thanks
    Ash
      • 28215
      • 4,149 Posts
      get() gets the DB fields for the object, in this case the context. You're wanting to get Context Settings, which you should use getOption for:

      $modx->context->getOption('site_start');
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 2249
        • 60 Posts
        This is perfect. Thanks smiley