Add block doesn't work
Permalink 1 user found helpful
Hello,
i'm trying to create a new block based on the existing Image block (my block also needs to contain an image but with extra info).
i was able to install my block without errors, de database table got created, but when i want to add my block to a page notting happens (the add button doesn't seem to respond)
how do i start debugging this?
thanks
Marco
i'm trying to create a new block based on the existing Image block (my block also needs to contain an image but with extra info).
i was able to install my block without errors, de database table got created, but when i want to add my block to a page notting happens (the add button doesn't seem to respond)
how do i start debugging this?
thanks
Marco
This maybe a stupid question. But did you add code in the view.php file to display the block?
There are no such things as stupid questions
is what my view looks like but the add window doesn't close to begin with, is this normal?
the getContentAndGenerate function is in my controller.php
greets
Marco
is what my view looks like but the add window doesn't close to begin with, is this normal?
the getContentAndGenerate function is in my controller.php
greets
Marco
can you post your block, or just the files you've changed? there are a number of things that could be going wrong with it- controller, edit and add.php, and auto.js its likely that its just a small syntax error, but thats all it takes.
The idea of the block is to have a simple way to add some products to a website for sale.
there are some text fields for description and some other text fields for prices and a possibility to insert an image.
The problem i have right now is when i click the add button in the add window notting happens, the window stays opened and notting is added.
Remember, i'm new at this :-)
greets and thanks for checking
there are some text fields for description and some other text fields for prices and a possibility to insert an image.
The problem i have right now is when i click the add button in the add window notting happens, the window stays opened and notting is added.
Remember, i'm new at this :-)
greets and thanks for checking
The answer to your question "how do I start debugging this" is to try and isolate what is causing the problem. Once you know what is causing the problem then it will be easier to figure out what the problem actually is (instead of the other way around where you try to figure out what the problem is first and then find where it is that's causing the problem).
What I did was to install your block, test it out, see that it didn't work. Then I deleted all of the fields in add.php, and then it worked (well, it let me save the block). So I know the problem is somewhere in the fields. Then I put back all the fields and then deleted only half of them. The problem came back. So I removed that half and put the other half in. This time it worked -- now I know it's in the top half of the code. I went one by one to try to isolate exactly which code in add.php was causing the problem, and what I realized is that you have several closing </div> tags without an opening div tag for each of them. I don't know why this would cause the button to not work, but it did -- this is what I mean about finding the problem without needing to understand what it is first.
I think it's great that you're learning to do this yourself and the knowledge you gain from it will be valuable. But in case you just want to get this done and don't care about learning to do it, you could use the Designer Content addon to create this block for you:
http://www.concrete5.org/marketplace/addons/designer-content...
Best,
Jordan
What I did was to install your block, test it out, see that it didn't work. Then I deleted all of the fields in add.php, and then it worked (well, it let me save the block). So I know the problem is somewhere in the fields. Then I put back all the fields and then deleted only half of them. The problem came back. So I removed that half and put the other half in. This time it worked -- now I know it's in the top half of the code. I went one by one to try to isolate exactly which code in add.php was causing the problem, and what I realized is that you have several closing </div> tags without an opening div tag for each of them. I don't know why this would cause the button to not work, but it did -- this is what I mean about finding the problem without needing to understand what it is first.
I think it's great that you're learning to do this yourself and the knowledge you gain from it will be valuable. But in case you just want to get this done and don't care about learning to do it, you could use the Designer Content addon to create this block for you:
http://www.concrete5.org/marketplace/addons/designer-content...
Best,
Jordan
Thanks Jordan,
this was indeed my problem and i do want to learn this stuff.
i used to build websites from scratch but than i discovered cms, took a short look at joomla a bit longer look at drupal but now i'm stuck with Concrete5 and lovin it.
greets
marco
this was indeed my problem and i do want to learn this stuff.
i used to build websites from scratch but than i discovered cms, took a short look at joomla a bit longer look at drupal but now i'm stuck with Concrete5 and lovin it.
greets
marco
I'm glad it worked. I also used to build websites from scratch. I think that's an important thing to do so that you understand how everything works. But after the 10th site from scratch I stared getting bored of writing the same thing over and over again and realized it would be good to benefit from another system that already has a lot of development put into it. I also worked with Joomla and Drupal (and Wordpress and CMS Made Simple and ModX and Silverstripe and some other ones I can't remember), and Concrete5 blows them all away for content-managed informational websites.
-Jordan
-Jordan