Jump to content

Recommended Posts

Posted

It's possible to hook the $comments->render() function to show more data based on some default value of the comment?
My goal is to display the user's profile picture and i can get the picture using the "cite" value of the comment

Posted
Posted

I can post a working version of this tomorrow. I use page comments (with user profile images) as part of admin pages a lot.

  • Like 4
Posted

@renobird, i would be keen on learning more about having comments as part of an admin page - is it possible to have comments right on an editor page?

Posted

Here is a quick screenshot of an admin page we use to manage the initial hiring process of new employees.

The module hooks into FromBuilder and pulls in entries that are associated with the page. So all the information on the left is from a FormBuilder entry, the sidebar is a little more typical and just made up of the fields assigned to the template. I'll post more about that later.

We don't allow users to edit the comments, because they are part of the document trail, but they have a chance to review them in a modal before the actual submit happens. The "notify of comment" pulls in a list of people with particular roles. 

I'll post the code a little later, I need to put out a small fire first.

post-474-0-79791500-1422373519_thumb.png

  • Like 6
Posted

It would be really nice so see how you're doing some of these "custom" admin stuff. It's not your first screenshot, that made me curious about this.

  • Like 1
Posted

Renobird, that's some dope admin UI.................................. wait a minute renobird...........renotheme  ??? figures. nice admin ui

  • Like 1
Posted

I'm looking forward to see how to implement the avatars into comments :) Awesome design here.
Did you have the chance to play with the new comments system? I'm trying to show up the votes also but I'm having some issues, they don't display into comments using the options inside the render array. I asked here https://processwire.com/talk/topic/8912-display-votes-on-new-comments-system/

  • Like 1
Posted

Thanks. I do a lot of custom admin pages here. Looking now I have 10 Process Modules that create custom admin functions. Some are simple, some a super complex.

I'll get back here soon with some code examples.


Sevarf2,

Most of the things I've built that use comments were built long before the new comment system.

  • Like 2
Posted

Here are the 2 methods related to comments from the Process Module in the screenshot above.

You can do pretty much the same thing in a template instead of a module. 


Sorry I don't have time to explain further, or put it into a more complete write up. Hopefully you can pick that apart and get what you need.

:)

  • Like 1
Posted

Sorry I don't have time to explain further, or put it into a more complete write up. Hopefully you can pick that apart and get what you need.

Just one small thing, do you use InputfieldMarkup or hooks or some custom fieldtype to inject this stuff into the template?

Posted

That's the beauty of ProcessModules...you can pretty much throw anything at it and it will output it....plain HTML, whatever. I have had a quick look at the code and it's pretty much plain HTML in many places...added to that, some CSS to style it...

  • Like 1
Posted

LostKobrakai,

Forgot to mention, the reason it's all returning markup is that when I build the form, the comments get added like so:

// Comments
$field = $this->modules->get("InputfieldMarkup");
$field->markupText = $this->renderComments($page);
$form->add($field);
  • Like 1
Posted

Here is a paste that shows how the entire sidebar gets built. 

There's really nothing too fancy here. Pulling in specific FormBuilder entries and allowing edits that in turn update the associated page gets a little fancier, but nothing all that complicated really.


There are certainly other ways to build that sidebar, but I needed to have a lot of control over the settings, and the template has a lot of other fields that are specific to another part of the process, so I can't just foreach the fields.

  • Like 1
  • 7 months later...
  • 5 months later...
Posted

Here are the 2 methods related to comments from the Process Module in the screenshot above.

Here is a paste that shows how the entire sidebar gets built. 

Hey renobird, the content in both pastebin links seem to have been removed. Any change you can upload them (again)? Maybe a gist?

Posted

Hey renobird, the content in both pastebin links seem to have been removed. Any change you can upload them (again)? Maybe a gist?

Hi arjen,

I'll dig those up again. Not sure why I would have put an expiration on the pastes. 

  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...