Icons in Pages Plugin

I have edited my pages plugin to show a cars page.  I added several fields to add additional info to pages. I want to be able to  upload an icon when creating a new page. The icon will then be displayed on the profile and on the actual page like the group plugin. I was able to add the file input to edit page, but do not know how to make sure it is saved and displayed. Any help?

  • Post some/all of your code here so that we can study and determine the problem.

  • In the start.php file I added so that a file upload will appear on edit/add page:

    $CONFIG->pages = array(
                'title' => 'text',
                'icon' => 'file',
                'year' => 'text',
                'make' => 'text',
                'model' => 'text',
                'gearbox' => 'text',
                'horsepower' => 'text',
                'torque' => 'text',
                'description' => 'longtext',
                'tags' => 'tags',   
                'access_id' => 'access',
                'write_access_id' => 'access',
            );

    How do I get the file uploaded to replace the current icon in pages/views/deault/icon/object/page and page_top? I also changed to view.php body to:

    $body = elgg_view('pages/breadcrumbs', array('page_owner' => page_owner_entity(), 'parent' => $parent));
       
        $body .= elgg_view_title($pages->title);

        $body .= "<label>Year:</label>&nbsp<text>$pages->year</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>Make:</label>&nbsp<text>$pages->make</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>Model:</label>&nbsp<text>$pages->model</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>Gearbox:</label>&nbsp<text>$pages->gearbox</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>Horsepower:</label>&nbsp<text>$pages->horsepower</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>Torque:</label>&nbsp<text>$pages->torque</text>";
        $body .= "<br>";
        $body .= "<br>";
        $body .= "<label>About Car:</label>&nbsp<text>$pages->description</text>";

    I have read the docs on plugin hooks and events that show replace icons, but do not know where to put/modify code. I need to update annotation, river, pages list on profile, and page list. also to add the same icon but bigger on the actual page. Hope this helps!