Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by
If we ask question under main category "Agriculture" and sub category "Plantation" , in the question view page the question displays only category "Plantation".

I want to display both main category and sub-category of question in view question page.
Q2A version: 1.6.3

1 Answer

+1 vote
edited by

I haven't tested or even tried practically but you can try by overriding the function and add backpath last (base) item.


The backpath column contains the parent categories path. So if it has two parents than cat1/cat2 and if it has only one parent than cat1 etc..

So you can either explode by / and get last item by using end($array) which will gives you last item of the exploded array. If you want to display every item of the backpath than just run the foreach loop to list every item of the exploded array.

I just landed back to the country so not able to add any example at the moment but will add in future if get time.

Hope this will helps you guyz

@jatin.soni I also want to know about this, but I am not that good in coding and stuff. So can you please tell this in detail that what we have to do and how?
@jatin.soni Thank you very much for your answer. As Gurjyot Singh commented above could you please give more help (details) to do this? I also have no good idea in coding.
I have added some sort of description how to do. Please check and let me know if it helps you.
Thank you very much again. I will try this and tell you.
i am unable to do it, i really that know where to look for the code to edit, if you can directly me. that will be great. thanks