Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.6k views
in Q2A Core by

I want to change the name of these URLs

  • questions = posts
  • answers = comments

I have commenting disabled within the admin panel and want to use the answering as commenting by editing the language files.

I tried setting the following in the qa-config.php

$QA_CONST_PATH_MAP=array(
    'questions' => 'posts',
    'answers' => 'comments',
    'categories' => 'categories',
    'users' => 'members',
    'user' => 'member',
    'ask' => 'submit',
);
They work but, so do the old names would this be a protential problem with duplicate content?.

I also have an issue on the public profile page sub navigation, the names have not been changed. 

  • /user/username/questions
  • /user/username/answers

I tried editing the qa_user_sub_navigation in qa-app-format.php

'questions' => array(
'label' => qa_lang_html('misc/nav_user_qs'),
'url' => qa_path_html('user/'.$handle.'/posts'),
),
 
'answers' => array(
'label' => qa_lang_html('misc/nav_user_as'),
'url' => qa_path_html('user/'.$handle.'/comments'),
),
Which does change the names but, /user/username/posts goes to a 404.
 
Any input would be great, thanks in advance :)

 

Q2A version: 1.6.2

1 Answer

+1 vote
by
If you are not linking to the other URLs it should be fine I think. If it does become a problem you could set up some redirects from the old URLs to the new ones.
by
Thank you very much for the input, do have have any idea how to change the names on the sub navigation bar within the profile page?

/user/username/questions <- change this to 'posts'
/user/username/answers <- change this to 'comments'

Also, I have a network setup with 2 sites and would like to add a link on the sub-navigation bar, profile page to the profile page on the other website in the network.

Do you know where I would need to edit the code?

Hope that makes sense :)
by
Funny enough, I asked that same question a while back: http://question2answer.org/qa/18970/possible-map-segments-subfolders-using-qa_const_path_map
Unfortunately there is no way to do it currently.
by
In addition to changing the URLs like you have above in qa_user_sub_navigation, you also need to make an edit in qa-page-user.php.

Find the switch for qa_request_part(2) (about line 58) and change the cases appropriately. This worked for me.
...