aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/page/main.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-10-24 21:02:06 +0200
committerThomas Lange <code@nerdmind.de>2017-10-24 21:02:06 +0200
commit95b3eef6eb910b4af1f61c3e262e7824df47bdd6 (patch)
tree1aab6c508ad459ac457cd781ab2a4f844de058d1 /core/include/page/main.php
parent88c4effebd6efa93f41cc3d11d2c3a3fa3e6649f (diff)
downloadblog-95b3eef6eb910b4af1f61c3e262e7824df47bdd6.tar.gz
blog-95b3eef6eb910b4af1f61c3e262e7824df47bdd6.tar.xz
blog-95b3eef6eb910b4af1f61c3e262e7824df47bdd6.zip
You can now access item data in the main.php template (the file which contains the basic HTML framework) for pages, posts and users. This makes it possible to use the optional argument field in the content editor to add additional HTML <meta> tags (or something else) for a specific page, post or user if you implement this functionality into your template. The following snippet shows how you can access the item data in the main.php template and which parameters are defined for each type of item (currently, there are three types: PAGE, POST and USER):
if(isset($TYPE)) { switch($TYPE) { case 'PAGE': # $PAGE and associated $USER is accessible var_dump($PAGE['ARGV']); break; case 'POST': # $POST and associated $USER is accessible var_dump($POST['ARGV']); break; case 'USER': # $USER is accessible var_dump($USER['ARGV']); break; default: # Nothing } }
Diffstat (limited to 'core/include/page/main.php')
-rw-r--r--core/include/page/main.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/include/page/main.php b/core/include/page/main.php
index e50445a..7f1aa02 100644
--- a/core/include/page/main.php
+++ b/core/include/page/main.php
@@ -52,6 +52,11 @@ try {
'OG_IMAGES' => $page_data['FILE']['LIST']
]);
+ # Get access to the current item data from main template
+ $MainTemplate->set('TYPE', 'PAGE');
+ $MainTemplate->set('PAGE', $page_data);
+ $MainTemplate->set('USER', $user_data);
+
echo $MainTemplate;
}