Changes between Version 4 and Version 5 of Ticket #5452


Ignore:
Timestamp:
01/14/2019 04:06:32 PM (10 months ago)
Author:
kvas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5452 – Description

    v4 v5  
    77Create two global functions: 
    88 
    9 - `get_page_url(page[, locale, redirect=True])` that accepts a page path and locale and returns a full url based on website configuration and arguments. If locale is not provided, a link with the locale of the current page should be generated. By default, the function should verify that the page exists in the target locale and should raise an exception if it doesn't. But, if `redirect=True`, it should return the URL in the default locale. If the source has been configured to use relative links, the returned link should be relative. 
     9- `get_page_url(page[, locale, redirect=False])` that accepts a page path and locale and returns a full url based on website configuration and arguments. If locale is not provided, a link with the locale of the current page should be generated. By default, the function should verify that the page exists in the target locale and should raise an exception if it doesn't. But, if `redirect` is set to `True`, it should return the URL in the default locale. If the source has been configured to use relative links, the returned link should be relative. 
    1010- `page_has_locale(page, locale)` that accepts a page path and locale and returns `True` if the page exists in that locale and `False` if it doesn't. 
    1111