Welcome!
It's my first topic here, so hello everyone. I'm warning you, i'm a little newbie in elgg, so please- be forgiving for me: )
I've got elgg 1.8, i've needed a plugin with widget, which takes data from another site something like simple javascript code or iframe. Haven't found anything like that, so i decided to write one (it shouldn't be hard, though - i thought!) When i finished and activated it, my website turned into white page without any styles, css with word content only. And that is the question:
What the heck is going on? Plugin is so simple to write, so i have no idea, whats wrong. Ill give you my start.php and view.php (from widget folder). If someone could give me a hand, because i''m gonna freaking out with that staff.
start.php
<?php
function kurs_init() {
add_widget_type('kursy', "Waluty na zywo", "Kursy walut na żywo");
}
register_elgg_event_handler('init','system','kurs_init');
?>
__________
view.php
<?php
$widget = $vars["entity"];
?>
<div id="tms_widget"></div>
__________
Ive got a proper declaration in head of page for that widget. : )
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.
If you disable your plugin, does your CSS come back? Is this repeatable?
If you view your CSS file, are there any clues or is it just an empty file?
Make sure you are not saving any of your files with a Unicode byte order mark (BOM http://en.wikipedia.org/wiki/Byte_order_mark). Some text editors give this as a configuration option.
>If you disable your plugin, does your CSS come back? Is this repeatable?
Yes, once i disable plugin, the styles come back.
>If you view your CSS file, are there any clues or is it just an empty file?
Every file of theme is alright, no matter if the plugin is activated or not.
>Make sure you are not saving any of your files with a Unicode byte order mark (BOM http://en.wikipedia.org/wiki/Byte_order_mark). Some text editors give this as a configuration option.
All files are in UTF-8.
I have no idea, whats wrong...
It's slightly different in 1.8 eg...
start.php
<?php
function kurs_init() {
elgg_register_widget_type('kursy', "Waluty na zywo", "Kursy walut na żywo");
}
elgg_register_event_handler('init','system','kurs_init');
?>
And the 'view.php' file has been renamed to 'content.php'.
I think that's right - I've just been changing a site + custom plugins over to 1.8.
Also, try turning off debug mode if you have that turned on.
So.. i've changed it, and nothing has happend. ; /
I just made a plugin with the exact code you pasted here and it worked fine. It's definitely your plugin but you haven't given us the information that we need to solve this. Maybe post your exact code here: http://pastebin.com/
But i gave you the exact code of this plugin, maybe you could just send me this plugin and i'll check if it works. Hmm... I can paste it there, but itll be the same code, like in here
Or maybe it's something with the theme?
Definitely turn off all non-bundled plugins and test just your plugin.
If you use pastebin, we can see your exact code. If you paste it here, we cannot tell where the text begins and where the code begins. For example, in PHP spaces outside of <?php and ?> can cause problems.
I turned of some of the plugins and its worked! Thanks, Cash! you're awesome : )
- Previous
- 1
- 2
- Next
You must log in to post replies.