summaryrefslogtreecommitdiffstats
path: root/core/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/functions.php')
-rw-r--r--core/functions.php42
1 files changed, 39 insertions, 3 deletions
diff --git a/core/functions.php b/core/functions.php
index 726e96f..471c14f 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -308,9 +308,9 @@ function excerpt($string, $length = 500, $replace = ' […]') {
return $string;
}
-#====================================================================================================
+#===============================================================================
# Generate a valid slug URL part from a string
-#====================================================================================================
+#===============================================================================
function makeSlugURL($string) {
$string = strtolower($string);
$string = str_replace(['ä', 'ö', 'ü', 'ß'], ['ae', 'oe', 'ue', 'ss'], $string);
@@ -319,4 +319,40 @@ function makeSlugURL($string) {
return trim($string, '-');
}
-?>
+
+#===============================================================================
+# Function to get data from specific page in templates
+#===============================================================================
+function PAGE($id) {
+ try {
+ $Page = Page\Factory::build($id);
+ return generatePageItemData($Page);
+ } catch(Page\Exception $Exception) {
+ return NULL;
+ }
+}
+
+#===============================================================================
+# Function to get data from specific post in templates
+#===============================================================================
+function POST($id) {
+ try {
+ $Post = Post\Factory::build($id);
+ return generatePostItemData($Post);
+ } catch(Post\Exception $Exception) {
+ return NULL;
+ }
+}
+
+#===============================================================================
+# Function to get data from specific user in templates
+#===============================================================================
+function USER($id) {
+ try {
+ $User = User\Factory::build($id);
+ return generateUserItemData($User);
+ } catch(User\Exception $Exception) {
+ return NULL;
+ }
+}
+?> \ No newline at end of file