Table Of Contents

  • Page link (pageref)
    • Attribute options
    • Edit mode
    • Using in the markup
Close
Logo
  • Issues
  • RU
  • Issues
  • RU
  • Features and non-features
  • Getting started
    • Introduction to ηCMS
    • Creating a new project
  • Server configuration
    • Example of ηСМС configuration file
    • Additional (Advanced) configuration items
  • Supported databases
    • IBM DB2
    • PostgreSQL
  • Administrator GUI
    • Page content management
    • File management in ηCMS (media repository)
    • Assembly Management
    • Assembly attributes
    • News feeds management
    • The visual editor of pages
    • Traffic management
    • User Management
  • HTTL markup
    • HTTL Basics
    • HTTL ηCMS extensions
    • Advanced HTTL
    • Utility methods of HTTL markup
  • Social networks integration
    • Support of Open Graph protocol
  • Deployment options
    • Deployment as an independent service
    • Deployment within a context of another website
  • Recipes and Best Practices
    • Defining templates for pages having a common structure
    • Define only page attributes that can be really changed during a page lifetime
  • Extending ηCMS
  • Misc
    • Use of table attributes in a page markup
  • Administrator GUI
  • Assembly attributes

Page link (pageref)¶

Attribute options¶

../../../../_images/pageref_img1.png

Attribute options

Option Description
Link The default value of the attribute (link)
Allow external links Switch allows to set external links. If it is off, the edit links dialog in the page management UI allows to specify only links to ηCMS pages.

Edit mode¶

../../../../_images/pageref_img2.png

Attribute on the page editor pane

Press the link button to select a target page for a link, edit link title or enter an external link.

../../../../_images/pageref_img3.png

Link selection dialog

Using in the markup¶

Type of attribute value: com.softmotions.ncms.mhttl.RichRef

Properties of RichRef:

Property Description
link Link URL
name Link Name
toHtmlLink() Create an html link

Generating links using the toHtmlLink() method:

#set(RichRef link = asm('pageref'))
$!{link.toHtmlLink(['class':'active'])}

This example creates a <a> link to the selected page with an additional attribute class =”active”.

Alternative example:

#set(RichRef link = asm('pageref'))
<a href="$!{link.link}" class="active">$!{link.name}</a>

com.softmotions.ncms.mhttl.RichRef objects can be used with linkHtml() method to create html links

An example of a link creation:

$!{linkHtml(asm('pageref'), ['class':'active'])}
  • Administrator GUI
  • Assembly attributes
ηCMS Github
Star Issue
  • Issues
  • RU
© Copyright Softmotions Ltd, 2017.