Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of comments index for administrators #87

Open
newscloud opened this issue Oct 9, 2018 · 5 comments
Open

Example of comments index for administrators #87

newscloud opened this issue Oct 9, 2018 · 5 comments

Comments

@newscloud
Copy link

Nice widget, thank you!

Could you please give an example of setting up comments/index?

My test site uses paths
e.g. http://localhost:8888/cityx/site/about

But http://localhost:8888/cityx/comments/index fails to 404

'urlManager' => [
          'enablePrettyUrl' => true,
          'showScriptName' => false,
          'rules' => [
            '<controller:\w+>/<id:\d+>' => '<controller>/view',
            '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
            '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
          ],
      ],

I am logged in as a user role admin

Thank you.

p.s. One suggestion. I was confused when I first displayed comments and they just showed 0 with o form. It may help to remind people they need to be logged in to the creation form.

@ihorchepurnyi
Copy link
Contributor

Hi, you can check comment configuration in the following template - https://github.com/yii2mod/base

@newscloud
Copy link
Author

newscloud commented Oct 11, 2018

Hi, again, aiming for simplification ... can you please clarify where on that page?

Do you mean in config main that does address comments/index? (I'm not sure how to access the admin view either).

'comment' => [
            'class' => 'yii2mod\comments\Module',
            'controllerMap' => [
                'manage' => [
                    'class' => 'yii2mod\comments\controllers\ManageController',
                    'layout' => '@app/modules/admin/views/layouts/column2',
                ],
            ],
        ],

Also, is there a way to customize the text for the comments button e.g. "Add your comment" instead of "comment".

THANK YOU

@ihorchepurnyi
Copy link
Contributor

ihorchepurnyi commented Oct 15, 2018

If you need to override the comment view file, in your case "change the button text" you can just create your view file and override this property - https://github.com/yii2mod/yii2-comments/blob/master/widgets/Comment.php#L37

@ejcramer
Copy link

ejcramer commented Dec 4, 2018

FYI,

In my yii2 with enablePrettyUrl, I found the comment index worked at this url:

http://sample.com/comment/manage/index

Normally I would translate the url listed in the readme from:

http://localhost/path/to/index.php?r=comments/index

To:

http://sample.com/comments/index

But this one didn't work.

Thanks for the module!

@undefence
Copy link

In my Yii2 app i found comment edit page on same link, like @ejcramer at

example.com/comment/manage

instead of url from readme

example.com/comments/index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants