0

We have a website that uses a lot of search indexes, and today some of the dropdowns are displaying "$name" as the first item in the dropdown list. I've done some googling and some say it is due to indexes needing to be rebuilt. I've rebuilt all of them but the issue is still happening.

Is there anything else that could be causing this?

Thanks so much in advance!

  • Depending on how wide your search is, you may need to explicitly filter standard values items from the search results. I'd recommend taking a look at your search logs and looking at the actual result set being returned. – Justin Laster Feb 1 '17 at 16:13
6

$name is a token (value set on Standard Values item) which is replaced by new item new when new item is created.

If if wasn't there before and for some reason now it's there in dropdowns, most probably someone in your team set this token for the field used in dropdown on Standard Values but for the items which are already there, token is not replaced and it won't be replaced automatically.

And here is a blog from John West explaining how to expand Standard Values tokens in existing items https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/expand-standard-values-tokens-in-existing-items-with-the-sitecore-asp-net-cms

1

I had this issue in the past. The reason why you may having $name on your site is because Sitecore did not get the version of the item being displayed.

Since Sitecore did not get the version, it will fall back to the Standard Values to retrieve the value, hence causing $name if the field has this token on the Standard Values.

Some ways to troubleshoot the issue is:

  1. Check if the item being configured contains a version
  2. Check if the version of the item is the Context Language of the site.
  3. If you are using the datasource field, make sure that the item in the datasource path is correct.
  4. Check if there is no invariant language in the version language list
1

Sometime it happens in case if you created items before defining the tokens. In this case all the previous item will get field value $name (tokens), now there is no out the box way provided by Sitecore to replace those. Better to write custom script to make thing change or you can use https://github.com/rauljmz/Sitecore.Rocks.ReplaceMacros tool to automate this.

0

$name is a special Sitecore that you put in Standard Values of Sitecore fields. When an item is created $name is replaced with name of your name.

You have $name in your site because you created items and after you put in standard field $name.

0

It's also worth pointing out that if the tokenised value comes from Standard Values, and you reset the field (or the whole item) back to standard values, it won't run the token expansion pipeline so the "$name" will remain as-is.

There's not really any way of working around this, you'll simply have to re-enter the correct field value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.