Alexander / Aebian

Alexander / Aebian

Who am I?

Musician, Programmer, Linux Geek and what not.  more...


The Categories



Stuff

Legal
Media Creations
My Projects
My Hardware
Some Spotify


April 18th at 11:20pm
Report an Issue
Sidebar ➠

❬ Back to Blog


Useful Codes for your octobercms installation


Some useful codes that you can use to extend your octobercms installation

by

In this Post I will show some twig / php codes useful for your own site.

Will be updated from time to time

How to display the User who posted the blog post?:

{{ post.user.first_name }} {{ post.user.last_name }}


How does my Disqus Comments Button work?:

Comments
The code requires that you have set-up disqus on your blog post page.


How to get the page id?

{{ this.page.id }}
Add this somewhere to your site. Then Preview. The variable is replaced with the exact page.id


Active Blog Tab also on Blog Posts

function onStart() { $this['activeMenu'] = 'blog'; }
Apply this to every page (blog post, blog posts, blog categories) of the Blog.
And the li code for it:

  • Blog