[Resolved] How to get the permalink of a category

Post Reply
kriztho
Jr. Bludit
Posts: 4
Joined: Wed Apr 11, 2018 5:20 pm

Fri Apr 20, 2018 4:09 pm

Hello,
How can I get the permalink of the category of a content ?
When a page is displayed, I want to have a link with the category to display all the content of this category.
Again, sorry for my bad english !
Thank's for your help.
Last edited by kriztho on Sat Apr 21, 2018 8:35 am, edited 2 times in total.
User avatar
bayerberg
Master Bludit
Posts: 68
Joined: Wed Jun 07, 2017 1:05 pm

Fri Apr 20, 2018 4:40 pm

i use something like this :

Code: Select all

      <?php
        if ($page->category()) {
        echo '<a href="'.DOMAIN_CATEGORIES.$page->categoryKey().'">'.$page->category().'</a>';
        };
      ?>
add it to page.php
i do things, check them out on behance | check out startups undiluted - london's startup ecosystem
kriztho
Jr. Bludit
Posts: 4
Joined: Wed Apr 11, 2018 5:20 pm

Fri Apr 20, 2018 4:58 pm

Great !
It was exactly what I wanted
Thank's a lot !
User avatar
diego
Site Admin
Posts: 716
Joined: Sat May 16, 2015 2:53 pm
Contact:

Sat Apr 21, 2018 3:30 pm

Hi,
I going to add to the documentation this snippet code https://docs.bludit.com/en/developers/categories

Also, I going to add the method $page->categoryPermalink() on the next version.
Post Reply