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

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/]<url_property_category=2><url_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 url_property_category = 2 (commercial) and url_transaction_type = 1 (for sale). these variables can be used later by the engine (or the templates) 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

URL_PATH can contain some tags like :

  • <#url_https>: 1 or 0 if protocol is https or not
  • <#url_mobile>: 1 or 0 if mobile or not
  • <#url_property_id>: Id of the property
  • <#url_request_id>: Id of the request
  • <#url_contact_id>: Id of the contact
  • <#url_thread_id>: ID of the forum thread
  • <#url_GeoPlace_Path parent_GeoPlace_ID=“FR-241095-241110” Shorten=“1”>:
for /real-estate/for-sale/cannes/ url_GeoPlace_Path = cannes/ 
  IF Shorten <> 1 then: 
    The ID of the geo place can be found without error thanks to the params parent_GeoPlace_ID
      IF parent_GeoPlace_ID = FR-241095-241110 (alpes-maritimes) then url_GeoPlace_Path = cannes/
      IF parent_GeoPlace_ID = FR-241095 (provence-alpes-cote-d-azur) then url_GeoPlace_Path = alpes-maritimes/cannes/
      IF parent_GeoPlace_ID = FR (france) then url_GeoPlace_Path = provence-alpes-cote-d-azur/alpes-maritimes/cannes/  
      IF parent_GeoPlace_ID = '',XW,XA,XE,XI,etc. (empty, world or continent) then url_GeoPlace_Path = france/provence-alpes-cote-d-azur/alpes-maritimes/cannes/
  IF Shorten = 1 then:  
    url_GeoPlace_Path = cannes-241110/ (label-GeoPlaceID)
  • <#url_GeoPlace_HaveChilds>: 1 or 0 if the geo_place point by the url_geo_label_path have childs
  • <#url_PageNumber>: The page number (ex: for /real-estate/for-sale/france/provence-alpes-cote-d-azur/alpes-maritimes/cannes/page2/ the page number is 2)
  • <#url_Propertylistings_type>: The type of Property listings (Wide listings (1), My Ads listings (2), Member''s listings (3))
  • <#url_output_format>: The format of the output (Html (1), Rss (2))
  • <#if condition=”…” true=”…” false=”…”>: Conditionally return the the value of true or false, depending on the condition
  • <#caseof expression=”…” statement_<1>=”…” statement_<n>=”…”>: Although, we can use the if statement for very complex (nested) condition testing, the caseof statement is usually easier to read (debug!) and the code runs more quickly
  • *: An asterisk matches any number of characters

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;
  • [StaticContentBaseHref]: Specifies the base URL/target for all relative URLs that point to static files (like .jpg, .js, .css, etc.);
  • [PropertySearch]: Specifies the URL of the Search Engine
  • [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.1354877534.txt.gz · Last modified: 2012/12/07 14:52 by admin