]> git.mxchange.org Git - friendica.git/blobdiff - doc/themes.md
Merge pull request #6356 from MrPetovan/task/6355-add-password-rules
[friendica.git] / doc / themes.md
index 63484b92bf869e75e30566f1f609bff70a72cd01..d2e4c59be3edee9fbcaf1f3454815eecefe02868 100644 (file)
@@ -6,7 +6,6 @@ To change the look of friendica you have to touch the themes.
 The current default theme is [Vier](https://github.com/friendica/friendica/tree/master/view/theme/vier) but there are numerous others.
 Have a look at [friendica-themes.com](http://friendica-themes.com) for an overview of the existing themes.
 In case none of them suits your needs, there are several ways to change a theme.
 The current default theme is [Vier](https://github.com/friendica/friendica/tree/master/view/theme/vier) but there are numerous others.
 Have a look at [friendica-themes.com](http://friendica-themes.com) for an overview of the existing themes.
 In case none of them suits your needs, there are several ways to change a theme.
-If you need help theming, there is a forum @[ftdevs@friendica.eu](https://friendica.eu/profile/ftdevs) where you can ask theme specific questions and present your themes.
 
 So, how to work on the UI of friendica.
 
 
 So, how to work on the UI of friendica.
 
@@ -168,6 +167,8 @@ The content of this file should be something like
 
     <?php
     /* meta informations for the theme, see below */
 
     <?php
     /* meta informations for the theme, see below */
+    use Friendica\App;
+    
     function duepuntozero_lr_init(App $a) {
         $a-> theme_info = array(
             'extends' => 'duepuntozero'.
     function duepuntozero_lr_init(App $a) {
         $a-> theme_info = array(
             'extends' => 'duepuntozero'.
@@ -180,13 +181,13 @@ Next take the default.php file found in the /view direcotry and exchange the asi
 So the central part of the file now looks like this:
 
     <body>
 So the central part of the file now looks like this:
 
     <body>
-        <?php if(x($page,'nav')) echo $page['nav']; ?>
-        <aside><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></aside>
-        <section><?php if(x($page,'content')) echo $page['content']; ?>
+        <?php if(!empty($page['nav'])) echo $page['nav']; ?>
+        <aside><?php if(!empty($page['right_aside'])) echo $page['right_aside']; ?></aside>
+        <section><?php if(!empty($page['content'])) echo $page['content']; ?>
                 <div id="page-footer"></div>
         </section>
                 <div id="page-footer"></div>
         </section>
-        <right_aside><?php if(x($page,'aside')) echo $page['aside']; ?></right_aside>
-        <footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
+        <right_aside><?php if(!empty($page['aside'])) echo $page['aside']; ?></right_aside>
+        <footer><?php if(!empty($page['footer'])) echo $page['footer']; ?></footer>
     </body>
 
 Finally we need a style.css file, inheriting the definitions from the parent theme and containing out changes for the new theme.
     </body>
 
 Finally we need a style.css file, inheriting the definitions from the parent theme and containing out changes for the new theme.
@@ -206,7 +207,7 @@ Basically what you have to do is identify which template you have to change so i
 Adopt the CSS of the theme accordingly.
 And iterate the process until you have the theme the way you want it.
 
 Adopt the CSS of the theme accordingly.
 And iterate the process until you have the theme the way you want it.
 
-*Use the source Luke.* and don't hesitate to ask in @[ftdevs](https://friendica.eu/profile/ftdevs) or @[helpers](https://forum.friendi.ca/profile/helpers).
+*Use the source Luke.* and don't hesitate to ask in @[developers](https://forum.friendi.ca/profile/developers) or @[helpers](https://forum.friendi.ca/profile/helpers).
 
 ## Special Files
 
 
 ## Special Files
 
@@ -247,6 +248,12 @@ These three pieces of information should be listed.
 If the original author is no longer working on the theme, but a maintainer has taken over, the maintainer should be listed as well.
 The information from the theme header will be displayed in the admin panel.
 
 If the original author is no longer working on the theme, but a maintainer has taken over, the maintainer should be listed as well.
 The information from the theme header will be displayed in the admin panel.
 
+The first thing in file is to import the `App` class from `\Friendica\` namespace.
+
+    use Friendica\App;
+
+This will make our job a little easier, as we don't have to specify the full name every time we need to use the `App` class.
+
 The next crucial part of the theme.php file is a definition of an init function.
 The name of the function is <theme-name>_init.
 So in the case of quattro it is
 The next crucial part of the theme.php file is a definition of an init function.
 The name of the function is <theme-name>_init.
 So in the case of quattro it is