Create a new file views.php:
<?php
return [
'default' => [
'images/' => __DIR__ . '/graphics',
],
];
/mod/my-plugin/views.php
.elgg-page-footer {
background: url(<?= elgg_get_simplecache_url("images/my-image.png"); ?>);
}
elgg_get_simplecache_url("images/name.jpg");
to call any images from your directory /mod/my-plugin/graphics
Thank you.. I shall give this a try. One question I need to verify is. where should my 'myFooter.css' be located in my directory structure for my plugin?
I believe it should be at /my-plugin/views/default/my-plugin/myFooter.css but still not working.
Really don't understand what happend on your installation.
If you've any issues with the custom plugin then upgrade them.
If you've any problem with upgrade then try to search my post on Community - how to upgrade Elgg 2 on Elgg 3:
Shortly:
UPGRADE 2.3 > 3.1
- backup DB
- backup production
- backup /mod
- backup elgg-config/settings.php
- login as Administrator
- turn off all plugins
- turn off all simple caches' options (Dashboard -> Advanced settings)
- go to Dashboard and stay on there
- format your DB, tables and columns to utf8mb4 and InnoDB
- change a new .htaccess \ nginx
- delete old /vendor and files
- copy the new 3.1 /vendor and files
- add new changes in elgg-config/settings.php
- turn on $CONFIG->image_processor = 'imagick'; in elgg-config/settings.php
- delete old /mod
- delete in /data folders: /views_simplecache and /system_cache
- clean opCache
- run upgrade.php -> go to admin/upgrades and run Upgrades -> return on Dashboard
- copy new /mod
- activate only bundled plugins
- run upgrade.php \ flush the caches
Again, search my replies on Community for very advanced tips.
Overriding means the views provided by a plugin totally replace the original core view (or the corresponding view provided by a plugin higher in the plugin list). Overriding views is one way of modifying views if you want to change some code in the view. As the core views probably have changed between Elgg 2 and 3 you can't simply override the views of Elgg 3 using the modified views of your plugin based on the Elgg 2 core views.
It shouldn't be necessary at all to copy ALL views into the views folder of your plugin. Only the views you need to modify need be copied and altered. Question is why it doesn't work without the views in your plugin as Elgg should just use the unmodified core views in this case. Have you references to these views elsewhere in your plugin (using elgg_extend_view is NOT necessary when overriding views btw.!). Not knowing your plugin I can't say if anything else needs to be updated in your code to work on Elgg 3.
Yeah... it's weird and I'm not sure why I would need to override ANY of those views. I think if I were to open the site, go to admin panel, remove my version of the page/elements directory, then flush the cache it may work. Fingers crossed.
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.