[Resolved] How to get the permalink of a category

Post Reply
kriztho
Jr. Bludit
Posts: 4
Joined: Wed Apr 11, 2018 5:20 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: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 7 times
Been thanked: 10 times
Contact:

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
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
kriztho
Jr. Bludit
Posts: 4
Joined: Wed Apr 11, 2018 5:20 pm

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

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