Increase the number of Characters for the URL in a Weblink

Is there a way to increase the number of Characters for the URL in a Weblink?

I searched through the system settings but did not find a setting.

Background, our website is for an Academic library. We have a set of reusable links (Weblink Resources) to store the URLs for specific links/tasks on our databases and catalog. We use Weblink resources since our database might change provider or alter their url parameters. Using reusable weblink resources allows us to COPE (create once publish everywhere).

Thanks,
Roy

What problem are you trying to solve exactly? The field used by Weblinks for the URL is the content field which is a MEDIUMTEXT datatype and so I think it will hold up to 16,777,215 characters. I can’t imagine your URLs are longer than that.

OOPS! I trusted the content editor about the URLs getting truncated. I saw your reply and put the 1115 characters URL in the content field without a problem.

Thanks,

Roy

For MODX 2.8.x sites, the Content field is MEDIUMTEXT (16,777,215 characters) and the URI field is text (65,535 characters).

For MODX 3 sites, the Content field is LONGTEXT (4,294,967,295 characters) and the URI field is MEDIUMTEXT (16,777,215 characters).

But for all versions of MODX, the Alias field only allows 255 characters, so for any URLs for regular pages in a MODX website, you’re not going to be able to generate a URL with 1115 characters in it! It’s curious that the URI field can accomodate a large number of characters, but the Alias field prevents being able to do that, even with URLs that include the aliases of parent resources in them.

I assumed that you can use Freeze URI for a regular resource page and then enter a very long URI in there, bypassing the Alias field altogether. But I tried that, and it didn’t work; I got an error saying the 255 is the maximum number of characters for the URI. What’s the point of having a large character count available for the URI in the database table, but then not allowing users to enter more than 255 characters (whether or not that might be considered good practice)?

I’ve entered a feature request here: Increase the number of characters allowed in Freeze URI field · Issue #16910 · modxcms/revolution · GitHub

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.