SLUG: reemplazo de caracteres no válidos por sus equivalentes en inglés

62 views
Skip to first unread message

Mercedes Jiménez Bolívar

unread,
Feb 17, 2023, 7:03:01 AM2/17/23
to AtoM Users
¡Buenas tardes!

Mi consulta es preguentarles por el ajuste que hay que hacer en AtoM para que de forma automática  los caracteres no aceptados del español (caracteres acentuados o la ñ ) se reemplazan con caracteres equivalentes del alfabeto inglés en vez de con guiones. La razón es que este segundo modelo hace el slug bastante incomprensible:

En español, Málaga (España) se convierte en m-laga-espa-a

Muchas gracias por vuestra atención.

Mercedes





Dan Gillean

unread,
Feb 17, 2023, 8:28:26 AM2/17/23
to ica-ato...@googlegroups.com
Hi Mercedes, 

There are two options that might help you. 

Option 1 - use the permissive slug setting

First, AtoM has a setting that will allow your slugs to use more characters. By default, AtoM's slugs will only allow for digits, letters, and dashes. Any special characters, accents, etc - essentially non-ascii characters - are replaced. 

However, if you enable the following setting then going forward, future slugs will use any valid UTF-8 character including accented characters, and even some special characters like , - _ ~ : = * @. See: 
There are two things to remember before enabling this setting: 

First, enabling this setting will NOT automatically update existing slugs. If you want your existing descriptions to use slugs that match the new permissive setting, then you will need to re-generate them. You can use the slug generation task with the --delete option to replace existing slugs - it will respect and use this setting if it is activated. The CLI task: 
I would recommend that you clear the application cache, restart PHP-FPM, and repopulate the search index after as well, so everything is up to date. Links to all of these tasks can be found from the Troubleshooting page: 
Second, keep in mind that when using this setting, it means that accents, capitalization, and any other variations will make unique slugs - so you will have more slugs that are very similar to one another overall. For example,  Málaga, málaga, and Malaga would now all be 3 different valid slugs pointing to 3 different descriptions. Without the setting on, all of these would be automatically sanitized to just malaga, and then you would have malaga, malaga-1, and malaga-2 as your slugs. 

Option 2 - use the rename module

If you just want to fix this description and not adjust all descriptions, your second option is to use the Rename module, which lets you manually edit the slug of a description. If you do this without changing anything else, you could easily change your slug from m-laga-espa-a to malaga-espana, for example. See:
However, this module will ALSO respect the permissive slug setting described in Option 1 above. So if you want accented characters in this slug and in future slugs going forward but don't want or need to update all previous slugs, you could first enable the permissive slug setting, and THEN use the rename module to fix this particular slug. That should allow you to manually make it into Málaga-España, or málaga-españa, or similar. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/5e097125-990b-4875-aeef-72d69f8a8485n%40googlegroups.com.

Mercedes Jiménez Bolívar

unread,
Feb 20, 2023, 6:22:03 AM2/20/23
to AtoM Users
¡Hello, Dan!
I think I'm not explaining my problem very well. What I would like is for AtoM slugs to only allow digits, letters, and hyphens. For example "malaga-espana" instead of "Málaga-España", but with AtoM's default option, the special characters: accents and Spanish "eñe" are converted to hyphens and the result is "m-laga-espa-a".
What can I do to convert these special characters to their corresponding English characters?
Thank you so much
Mercedes

Dan Gillean

unread,
Feb 21, 2023, 2:48:44 PM2/21/23
to ica-ato...@googlegroups.com
Hi Mercedes, 

I see what you mean. Unfortunately, this will require development to support - you can't do it easily at the moment. So for now, you will need to edit those slugs manually! 


Regards, 


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Mercedes Jiménez Bolívar

unread,
Feb 22, 2023, 5:13:32 AM2/22/23
to AtoM Users
Hola otra vez, Dan. 
Me extraña que no se pueda hacer en la última versión de AtoM, ya que en la versión 2.6.4 - 184 si funciona como a mí me gusta. Te pongo un enlace que se ha generado automáticamente:
Por si arroja luz.
Muchísimas gracias

Dan Gillean

unread,
Feb 22, 2023, 8:23:14 AM2/22/23
to ica-ato...@googlegroups.com
Hi Mercedes, 

You're right - it seems to work out of the box. I've tested created a description called "Málaga, España" in the public demo site, even while in the English UI, and it has successfully created the slug as malaga-espana. I then repeated the test in an internal 2.7.x test site, and it worked the same for me. 

However, in that case... I'm not sure why it's not working for you!

Is it all descriptions, or just that particular description where the slug character replacement is not working as expected? Is there any chance that the title was cut and pasted from somewhere else when entered into AtoM, rather than typed out? Have you tried creating another description by typing out the title to see if it works?

Anything else you can tell me about your site that might impact this is welcome! 

Cheers, 


Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Reply all
Reply to author
Forward
0 new messages