Results 1 to 3 of 3

Thread: Page Parameters to Templates

  1. #1
    Join Date
    Jul 2010
    Posts
    16

    Default Page Parameters to Templates

    Hi there!
    Is there a way to define some Parameters in the page xml file to pass the parameters to the template? For Example every page has its own icon and i want to pass the icon-url to the template wich renders my pages.
    Is that possible and how?

    thx for help and best regards!

  2. #2
    Join Date
    Jul 2010
    Posts
    16

    Default

    OK, i found the solution:
    in the page definition XML add:
    <properties>
    <yourPropertyName>yourValue</yourPropertyName>
    </properties>

    it is accessable in the template like ${context.page.properties.yourPropertyName}


    regards!

  3. #3

    Default

    That is correct, you can do this for most of the surf objects i.e. pages, templates and components. Put any name/value pair into the <properties> element within the descriptor file and it will be made available for the appropriate object context. It is commonly used for simple component configuration - as because like all WebScript + Surf artifacts, the descriptor files can be overridden in a custom configuration and those properties overridden with it.

    Cheers,

    Kev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •