1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AlertHandler: Where can i edit the text?

Discussion in 'XenForo Development Discussions' started by cedivad, Nov 29, 2010.

  1. cedivad

    cedivad Active Member

    I really don't get it. Where can i create my custom "template" for the alert info?
    Here you can see that the last 3, made from me, are empthy.

    Schermata 2010-11-29 a 23.36.25.png

    I've create my alertHandler file, but in it i don't get what i have to edit
    Here it's the file:

    Code:
    <?php
    
    /**
     * Handler class for user profile post alerts
     *
     * @package XenForo_Alert
     */
    class tfTip_AlertHandler_tfTipPost extends XenForo_AlertHandler_DiscussionMessage
    {
        /**
         * Fetches related content (user profile posts) by IDs
         *
         * @param array $contentIds
         * @param XenForo_Model_Alert $model Alert model invoking this
         * @param integer $userId User ID the alerts are for
         * @param array $viewingUser Information about the viewing user (keys: user_id, permission_combination_id, permissions)
         *
         * @return array
         */
        public function getContentByIds(array $contentIds, $model, $userId, array $viewingUser)
        {
            return $model->getModelFromCache('tfTip_Model_ProfilePost')->getProfilePostsByIds($contentIds, array(
                'join' => XenForo_Model_ProfilePost::FETCH_USER_RECEIVER
            ));
        }
    }
    Thank you a lot!
     
  2. Kier

    Kier XenForo Developer Staff Member

    Can we see the title and content of the template you are using?
     
  3. cedivad

    cedivad Active Member

    The problem is that I'm not using a template at all. I don't get where I have to set one. (I copied the actual stuff from the profile post system!)
     
  4. Kier

    Kier XenForo Developer Staff Member

    Yes, that would indeed be a big problem.

    The template name is constructed from the content type and action, as you can see from the other alert templates. You don't explicitly set it, it just expects a template with a certain title to exist.
     
    Floris likes this.
  5. cedivad

    cedivad Active Member

    Wao, ok. I think i got it now.

    Thank you a lot!
     
    Kier likes this.

Share This Page