Streaming live at 10am (PST)

Insert Dynamic Link Attribute via Javascript?


#1

I need to pull a value from a CMS Item and insert it into the custom A attributes field.

Since it's not possible to do this via the UI, but it IS possible to grab CMS data in the custom code fields for each template page, is there any fancy-pants javascript I can use to grab the data from the CMS and insert it into that link?

Anyone have some insight on how I'd pull this off? Clearly, I'm clueless when it comes to Javascript (which is why I use Webflow...).

Thanks in advance!
Chris


#2

This has nothing to do with JavaScript.

What you want is to put the dynamic purple link into the URLHERE part below, and dynamic purple text into the URLTEXT below:

<a href="URLHERE">URLTEXT</a>

See https://www.w3schools.com/html/html_links.asp


#3

So you think this should be done with a custom code block and not in the page's custom code section?


#4

So you think this should be done with a custom code block and not in the page's custom code section?

Yes