I am renewing my programming skills (stopped after obtaining minor in 2002) to build a website. I feel like there has been an explosion in internet coding so I am brushing up my skills.
I have been trying to do the tutorials (on this site and youtube); however, I am not able to do some of the elementary samples. When I perform them, doing exactly what is told (copying files provided in the directories given), I do not get a correct response. I feel like this might be due to the Elgg version that I am using vs. what is in the tutorials. Does that make sense?
Specifically, for example, in the "My_Blog" tutorial, after setting up the form, when I go to view it on my site, the view of my site's body is the entire code text from the "save.php" file in myblog/views/default/forms/my_blog. Here is what the 'body' looks like:
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.
- Cim@manacim
Cim - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Ghazali@ghazali
Ghazali - 0 likes
- Cim@manacim
Cim - 0 likes
- Ghazali@ghazali
Ghazali - 0 likes
You must log in to post replies.This might seem like a silly question but did you activate your custom plugin in the admin > plugin page?
Don't touch /vendor folder.
Create your plugin in /mod folder, e.g.:
Now create your start.php, actions, pages, view(-s), forms
Yes, I activated the plugin.
I created everything in /mod folder. I was thinking maybe there has been a major structural tree change in the Elgg software without updating the tutorials? I am just not sure if the folders under /mod can inherit from folders in /vendor with the way the folders are structured with Elgg 2.2.3. Can they?
You only have to upload your custom plugin into the root/mod directory.
I noticed that there is a different tutorial for elgg 2.0. I am using 2.2.3.
I tried the tutorial for 2.0 and it works perfectly. I substituted the /action/my_blog/save.php files and now the 2.2.3 tutorial works!
I think I know the problem, I just don't know why. when we pass the "actions/my_blog/save.php" file containing the <div> tags to the elgg_view_form() in the resources/my_blog/add.php, the script works fine. The problem starts when we replace the <div> tags with:
echo elgg_view_field([
'#type' => 'text',
'#label' => elgg_echo('title'),
'name' => 'title',
'required' => true,
]);
For some reason, the elgg_view_form() simply returns the above code as a string and spits it out to the webpage.
I ran multiple tests, and I believe that the function elgg_view_field() is not identified. Does this make sense?