Question: I have a keyword like "Click Menu Item" which takes an argument `${menuItem}`.It then clicks on the corresponding menu item making a dynamic locator xpath.
I need to define/set the `LocatorVariables` and their Xpaths in separate `Locators.robot` resource file so that my testcases/keywords are xpaths free.

```
** Keywords ***  
Click Menu Item  
    [Arguments]     ${menuItem}  
    Click Element    ${MenuBarLeft_MenuItem}  

```

So I want to accept the variable `${menuItem}` in a Global Scope so that it will be accessible in `Locators.robot` Resource file.

Though, I understand this can be achieved by using below:

```
"Set Global Variable    ${menuItem}    ${menuItem}" 

```

but i wanted to know is there an way I can skip this step by automatic defining the scope while accepting the variable in keyword.

Also please let me know if there is a better way to handle dynamic locators for such case.

Answer: 
You should use `object` name in template:

```
{% block content %}
    <h3>{{ object.title }}</h3>

    <h6> on {{ object.datetime }}</h6>

    <div class = "code">
        {{ object.content|linebreaks }}
    </div>
{% endblock %}

```

Or if you want to use `Tutorial` variable, you need to pass `context_object_name=Tutorials` to the view:

```
path('<int:pk>', DetailView.as_view(
            model=Tutorials,
            template_name="tutorials/post.html",
            context_object_name='Tutorials')),

```
{% block content %}
### {{ object.title }}

```
<h6> on {{ object.datetime }}</h6>

<div class = "code">
    {{ object.content|linebreak }}
</div>

```

{% endblock %}