eZtip: Get the current siteaccess from template

I'm currently working on a multilingual site and had to use the name of the siteaccess in the template code. Easy I thought...well it took quite a while to find.

From http://ez.no/doc/ez_publish/technical_manual/4_0/templates/the_pagelayout/variables_in_pagelayout

VariableTypeDescription
$access_typearrayThe name of the siteaccess (as "name") and the ID number (as "type") of the access method that was used (1=URL, 2=Host, 3=Port).


Adding {$access_type|attribute(show,2)} to the pagelayout.tpl template will give the following:

name string 'ezwebin_site'
type integer 2


The siteaccess used to serve the current page is accessible via $access_type.name

Comments

  1. It would have taken a while to me if I didn't found your blog, thanks a lot !

    ReplyDelete

Post a Comment

Popular posts from this blog

eZ Publish 5 Virtual Machine

eZ Publish Admin redesign - Dashboard = OpenSocial?