Sitecore Query Strings Parameters

Sitecore gives different querystring parameters like choosing item, language, device, etc. stuffs to manage them easily without any configurations, etc. Also, it uses many querystring parameters to manage Content Editor efficiently.

Content Editor

There are many parameters Sitecore uses to manage content editor.

sc_content

- It changes the Sitecore database for the context of Content Editor. If querystring has value as sc_content=web, then content editor will open items from web database.

sc_lang

- It changes the Sitecore's default language. It is not exactly Item's language, but you can say language of the Sitecore's ribbon. For example, if sc_lang=en-GB, then in Content Editor, it will render the whole ribbon as en-GB language. If we pass this parameter for Preview/Page Editor/Normal mode, then it will set Items' language.

fo

- It will request Content Editor to open the given item directly. the item passed will be autopopulated from the tree and its properties will be shown without traversing the tree.

As per below snap, Products item has Item ID: {07D9A696-A2FE-4A59-88FB-A57FE386B8AD}. Now, if we want to open Products item directly in Content Editor, then we can pass querystring like fo={07D9A696-A2FE-4A59-88FB-A57FE386B8AD}. We can also pass Item Path instead of Item ID

ro

- It will request Content Editor to open the given item directly, but will be shown as a root item, means its parent will not be shown in the tree. Producta item has Item ID: {07D9A696-A2FE-4A59-88FB-A57FE386B8AD}.

If we pass querystring like ro={07D9A696-A2FE-4A59-88FB-A57FE386B8AD}, will open it as below.

Page Editor/Preview/Normal mode

There are many parameters Sitecore uses to preview pages.

sc_content

- It changes the database context for current requested page. If we request as sc_content=web, then it will render the whole page using item values from web database.

sc_lang

- It changes the language context for current requested page. If we request as sc_lang=de-DE, then it will render the whole page using item values from German language version. LanguageResolver processor is responsible for determining Context Language, which determins it using sc_lang querystring parameter or by current language cookie set in browser.

sc_itemid

- This parameter is mostly used for previewing particular item from Content Editor. When we preview any item from Content Editor, it opens preview/page editor window to view selected item's rendering. ItemResolver processor is responsible for determining Context Item, which determins it using sc_itemid querystring parameter or URL/site requested.

sc_device

We can change device using this parameter. If we pass sc_device=mobile, then mobile device will be set to Context Device. DeviceResolver processor is responsible for determining Context Device, which determins it using sc_device querystring parameter or by Browser agent.

Media(Images) Requests

There are many parameters Sitecore uses to alter image on-the-fly. You can refer my earlier post to see different querystring parameters for requesting images in Sitecore: Sitecore image control and querystring parameters

2 comments:

  1. Nice post. Thought I knew em all, but two where new to me.
    Find it a bit funny that "sc_datestart" or "sc_version" is not available options.
    Would be nice to send a preview url for a specific date e.g.

    ReplyDelete
    Replies
    1. Hi Anders, thank you for reading and commenting on the post.

      That's really a good idea to preview page for specific date by URL, and you are right, Sitecore does not provide these values in querystring. It stores date in Website#sc_date Cookie to persist preview date. The only workaround we have is to customize any pipeline to create date cookie from querystring.

      Delete