Alexander / Aebian

Who am I?

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


The Categories



Stuff

Arma CodeList
GitHub Projects
Media (Gallery)
Privacy Policy
My Hardware
My Wishlist


April 19th at 7:26am
Report a website issue
For best viewing experience use a 4k screen.

nethavn Logo

❬ Back to Blog


Useful Codes for your octobercms installation


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

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