Convert 'inline_text field' to URL Slug

Hi,

it is possible to convert a ‘inline_text’-field to a SEO url slug within the widget module?

I want to create anchor links from a text.

<div id="{% inline_text field="anchor_pillar_page" value="{{ module.anchor_pillar_page }}" %}">

text = Lorem ipsum Dolor?

slug= lorem-ipsum-dolor

Thanks

Flo

@FloStu - I think you want to do something like this, text will be easier to work with than inline_text, if you add the export_to_template_context attribute:

{% text "anchor_text" value="add pillar name here" export_to_template_context="true" %}
<div id="{{widget_data.anchor_text.value|lower|replace(' ','-')}}">

If this answer helped, please, mark as solved :grinning_face_with_smiling_eyes:


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me on slack.

Hey Tim,
Thanks a lot for your help. Can I just confirm that I should:
1) create a text field in the module

2) inside the <a/> tag add the

id={{widget_data.anchor_text.value|lower|replace(' ','-')}}"

3) and wrap it in the

{% text "anchor_text" value="add pillar name here" export_to_template_context="true" %}

? :slightly_smiling_face:

Finally got thsi to work - Thanks Tim for setting me on the right path.
I created a text field in my component. added the

{% text "anchor_text" value="add pillar name here" export_to_template_context="true" %}

just above my anchor tag. Then inside the anchor tag, I referenced the text field which contains my url eg

<a href="{{ module.link_url }}"/>

That’s it :grinning_face_with_smiling_eyes:

@Rachel-Marvel - awesome, I did comment on your original question if you haven’t seen the answer there.

yeah it was great - the only change I needed to make was to use module.name.value rather than widget_date.name.value - this may help others too :slightly_smiling_face: