Skip to content

ITernovtsii/nd_contentmodel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Norse Digital Content Model extension for eZ Publish 4.x

Installation

  • include 'extension/nd_contentmodel/config.php' in your ez publish config
  • define your models :)

What is it?

Adding possibility to define custom models for any eZ content objects.

Usage example

You have content class "my_city" with complex calculation of country.

class eZContentModelMyCity extends eZContentObject {

protected static $callbackAttributes = array(
    'country_name' => 'getCountryName'
);

protected function getCountryName()
{
    $countryName = 'Ukraine';
    // some code here
    return $countryName;
}

}

In template:

{def $city = fetch('content', 'node', hash('node_id', 150))} Country is {$city.country_name}

The same in php:

$node->country_name; // country name from object will be returned

$object->country_name;

PS: Let me know if you need the same for tree node

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages