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?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Austin Catcher@acatch03
Austin Catcher - 0 likes
You must log in to post replies.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> <text>$pages->year</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>Make:</label> <text>$pages->make</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>Model:</label> <text>$pages->model</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>Gearbox:</label> <text>$pages->gearbox</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>Horsepower:</label> <text>$pages->horsepower</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>Torque:</label> <text>$pages->torque</text>";
$body .= "<br>";
$body .= "<br>";
$body .= "<label>About Car:</label> <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!