User Tools

Site Tools


en:public:developer:template_system:urlresources

This is an old revision of the document!


UrlResources

This file (urlresources.txt) is located under the cfg directory and contain all the url definitions (like translations of each url for exemple). below the format of each items:

  [URL_ID|PAGE_ID]<Param1=a><Param2=b>..<ParamN=z>
  LANGUAGE_ID = URL_PATH
  LANGUAGE_ID = URL_PATH
  ...

the URL_ID is an arbitrary name you gave to the item. If omitted then URL_ID = PAGE_ID
the PAGE_ID is the path found in the cfgpages. for exemple if in the cfgpages you have theses nodes :

  <page name='/'>
    <page name='about'>  
      <page name='careers'>  
      </page>
    </page>
  </page>

that mean you have these 3 Page ID

  1. /
  2. /about/
  3. /about/careers/

then in the UrlResources.txt you would have these 3 items :

[/]
FRA = /
RUS = /
USA = /
PTG = /
ESP = /
DEU = /

[/about/]
FRA = [/]a-propos/
RUS = [/]about/
USA = [/]about/
PTG = [/]about/
ESP = [/]about/
DEU = [/]about/

[/about/careers/]
FRA = [/about/]recrutement/
RUS = [/about/]careers/
USA = [/about/]careers/
PTG = [/about/]careers
ESP = [/about/]careers/
DEU = [/about/]careers/

Note: The FRA = [/about/]recrutement/ will be converted to FRA = /a-propos/recrutement/

Another more detailed exemple:

[ComForSale|/real-estate/commercial/for-sale/]<property_category=2><transaction_type=1>
FRA = /immobilier/entreprise/vente/
RUS = /real-estate/commercial/for-sale/
USA = /real-estate/commercial/for-sale/

This instruct the engine that variable property_category = 2 (commercial) and transaction_type = 1 (for sale). these variables can be used later by the engine (or the templates) via <#UrlInfos> to define the default property category and/or the default transaction type. Also here the URL_ID = ComForSale so it's mean that to retrieve the link from the <#url> tag you must use ComForSale for the Url_ID

The header line ([URL_ID|PAGE_ID]<Param1=a><Param2=b>..<ParamN=z>) can contain special params that will instruct the engine on with exact version (mobile, secure, etc) of the website the definition is for :

Tag Definition
<#https> 1 if the url definitions is ONLY for HTTPS protocol.
0 if ONLY for http protocol.
If ommited URL definition is for both protocol.
EX: [BaseHref]<url_https=0>
<#mobile> 1 if the url definitions is ONLY for mobile version.
0 if ONLY for desktop version.
If ommited URL definition is for both version.
EX: [BaseHref]<mobile=1>

Each definition line (LANGUAGE_ID = URL_PATH) can contain some tags like for exemple :

Tag Definition
<#property_id> The Id of the property.
Ex: USA = [/minisite/v1/]<#url_property_id>/
<#propertyRequest_id> Id of the property request.
Ex: USA = [/alerts/]<#url_propertyRequest_id>/
<#contact_id> Id of the contact.
Ex: USA = [/blogs/members/]<#url_contact_id>/

This file can contain also HTTP redirect mapping instructions. Ex

=>301 [/forums/f2/]
DEU = [/forums/]
ESP = [/forums/]
FRA = [/forums/]
PTG = [/forums/]
RUS = [/forums/]
USA = [/forums/]

This instruct to redirect (Http 301 redirect) [/forums/] to [/forums/f2/]

Also this file must contain some const declarations like

  • [BaseHref]: Specifies the base URL/target for all relative URLs;
  • [StaticBaseHref]: Specifies the base URL/target for all relative URLs that point to static files (like .jpg, .js, .css, etc.);
  • [PropertyListings]: Specifies the URL of the property listings
  • [PropertyDetails]: Specifies the URL of the property details
  • [listings]: The “listings” keywords
  • [page]: The “Page Number” keywords
  • [rss]: The “rss” keywords
en/public/developer/template_system/urlresources.1443125214.txt.gz · Last modified: 2015/09/24 23:06 by svanderclock