<![CDATA[ Support/Comments for CustomUrls - MODX Community Forums]]> https://forums.modx.com/thread/?thread=78843 <![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-556792 https://yadi.sk/d/ZbYsmNOD3SGQmk thanks in Advance. PS: the Russian-speaking community will thank You!!! This review was written using a translator, I apologize for any inaccuracies in this comment. I will also attach the original text of this comment.


Здравствуйте, специально зарегистрировался чтобы добавить комментарий. Добавьте пожалуйста в Ваш компонент Русскую локализацию (язык). Я его полностью перевел. Эта локализация доступна по ссылке https://yadi.sk/d/ZbYsmNOD3SGQmk Заранее спасибо. P.S.: Русскоязычное сообщество скажет Вам спасибо!!! Этот комментарий писал через переводчик, прошу прощение за неточности в этом комментарии. Также прикреплю оригинальный текст этого комментария.]]>
eduard Feb 10, 2018, 02:04 PM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-556792
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-506517
I tried the following 2 rules together:

#1
pattern: [[+cu.parent_uri]]
constraint field: template
constraint: 3

#2
pattern: [[+cu.parent_uri]]/[[+alias]]
constraint field: template
constraint !3

I added the second rule (don't know if you can exclude a template like that) because the first one wasn't working on its own. But the two rules together also don't work.

Can I exclude all resources with a specific template with one rule or is it not possible with CustomUrls? If it's possible, what should I do to make it work?

Thank you!]]>
michelle84 Aug 14, 2014, 10:01 AM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-506517
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-473375 Set CustomUrls, but it does not work with nginx. What rewrite rules you need to finish?]]> kennymccormick Jul 29, 2013, 09:08 AM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-473375 <![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-464634 sladdals Apr 28, 2013, 01:06 PM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-464634 <![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463985 Quote from: ben_omycode at Apr 22, 2013, 05:18 PM
Hi,

@sladdals

If "catalog" is a resource without parent, I think you can remove it from its direct children URIs (category, category2, category3) by creating that rule :

  • Pattern : [[+alias]]
  • Constraint field : parent
  • Constraint : *catalog_id*
  • URI, Override, Active : Yes

And for other resources, generate default URIs :

  • Pattern : [[+cu.parent_uri]]/[[+alias]]
  • Constraint field :
  • Constraint :
  • URI, Override, Active : Yes

Thank you!!! this helped a lot!

The only thing I've noticed is that the last rule ignores container suffix which is "/" by default. E.g. it generates url for containers as "category2/subcategory2" or category2/subcategory2.html depending on the content type settings (html/js etc.)instead of "category2/subcategory2/".]]>
sladdals Apr 23, 2013, 01:28 AM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463985
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463905
@sladdals

If "catalog" is a resource without parent, I think you can remove it from its direct children URIs (category, category2, category3) by creating that rule :

  • Pattern : [[+alias]]
  • Constraint field : parent
  • Constraint : *catalog_id*
  • URI, Override, Active : Yes

And for other resources, generate default URIs :

  • Pattern : [[+cu.parent_uri]]/[[+alias]]
  • Constraint field :
  • Constraint :
  • URI, Override, Active : Yes

Else, you can define your own snippet to generate your custom urls :

  • Pattern : [[your_snippet]]
  • Constraint field :
  • Constraint :
  • URI, Override, Active : Yes

Besides, at the moment, you're right, the only way to set default URIs is to create a rule with [[+cu.parent_uri]]/[[+alias]].
But it's a good idea, I think I will add a button to clear custom URIs in next release.

@tedlegendary

It's the MODx default behavior. Aliases are made from resources pagetitle. It's more convenient for your customers who don't want specify aliases.
In CustomURLs, if you use [[+alias]] in your pattern and set "Override" to "No", then aliases will not be overriden if they are specified :

  • Pattern : [[+alias]]
  • Constraint field :
  • Constraint :
  • URI : No
  • Override : No
  • Active : Yes

I hope my english isn't too bad to be understood. wink]]>
ben_omycode Apr 22, 2013, 12:18 PM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463905
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463852 But I can't understand, why alias generated from page title?

Why not just take the data from the relevant field?

Thx.]]>
tedlegendary Apr 22, 2013, 07:12 AM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463852
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463780 The only solution I found was to use [[+cu.parent_uri]]/[[+alias]] rule and regenerate the urls.]]> sladdals Apr 21, 2013, 12:32 PM https://forums.modx.com/thread/78843/support-comments-for-customurls?page=2#dis-post-463780 <![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls#dis-post-463776
e.g. I have the following structure:

catalog
-category
--sub_category
---product

-category2
--sub_category2
---product2

-category3
---product3

and urls are: catalog/category/sub_category/product or catalog/category3/product3. I need to remove "catalog" from the url.

Can't get how to do this(( Can you help please?]]>
sladdals Apr 21, 2013, 12:09 PM https://forums.modx.com/thread/78843/support-comments-for-customurls#dis-post-463776
<![CDATA[Re: Support/Comments for CustomUrls]]> https://forums.modx.com/thread/78843/support-comments-for-customurls#dis-post-451860 If there are multiple patterns, which one gets assigned to the resource alias? The first one with a constraint which matches with the resource or if there is no such pattern, the first pattern without any constraint.

What if the pattern is wrong? All of the aliases get trashed?
If a pattern is wrong, aliases will not be as expected. To fix them, you've just have to fix your pattern and regenerate aliases.

If you're using a pattern like [[+cu.parent_uri]]/[[+alias]] to generate a new alias, and we create bad aliases, how can we possibly get back to correcting them? This pattern uses the alias...
Not sure I understood the question but maybe this screencast will help : http://www.youtube.com/watch?v=iwJeUxxtazE]]>
ben_omycode Jan 24, 2013, 05:20 AM https://forums.modx.com/thread/78843/support-comments-for-customurls#dis-post-451860