Streaming live at 10am (PST)

Assigning a unique id to a collection item

How can I assign a unique ID to a CMS item? I’m trying to add id="[value-from-a-cms-field-here]"to my resource link blocks on this page. Help? :smiley:

I can’t share my read-only link, unfortunately, as clients requests confidentiality. :confused:

I’m assuming no one has found a fix or a workaround?

I’m in the exact same situation, I need to add a Unique ID to CMS items.

There’s a few posts on the forums with this as the subject line asking for help, all with little response.

Any help, greatly received!

1 Like

Heya,

I’m after this too — I would like to assign unique IDs to items in a CMS collection so that for other pages in the site I could link to a specific CMS item in the full list view.

Does anyone have ideas on how to do this? :thinking:

Look here for unique custom IDs:

And here for even simpler, but not so custom solution:

Or even simpler, just add a custom embed in the collection item and use the built in custom field feature on an empty div with id. Like so:

<div id="CUSTOM_FIELD"></div>

ertyjhedr

Where CUSTOM_FIELD is whatever field you want from the collection. Slug is unique, so that works. Then you can link to that wherever.

I made a really simple guide for this

Hope it helps

2 Likes

Thanks Kyle. Should I put something ion the ID field? I added number fields and added a unique number on each collection item but I don’t see anything in the “in-page linking” drown.

I aded that second line of code into a embed container within the collection wrapper itself, Should that be outside?

Here’s my link: Webflow - Capital Techical Rescue

@engine7design Really sorry Tim I didn’t see your reply. Yes the code should be outside of the collection item, otherwise it will repeat which could cause conflicts. You don’t need to put anything in the ID field, you must have a text element inside your collection item with a class or ‘idtext’ which gets its text from the unique number field of that item.

No worry Kyle! While I have you on the phone, any chance you could give me some advice on having Hubspot AND Google Tag Master (or analytics) on this site? I think I added the codes to correct areas such as the above the body on each page for Hubspot and Special Code in the site settings for the GTM. Webflow - Directorie

@engine7design sorry Tim i have no idea on hubspot or GTM as i’ve never used them.