Customizing Themes & Blocks - Read Here First

Permalink 1 user found helpful

You'll want to check out the following sections of the documentation:

Understanding and Building Themes in Concrete5

Understanding Blocks


andrew
 
elygen replied on at Permalink Reply
elygen
I've read all these. But they don't really tell you how to use concrete to connect to the database. I don't want to have to create my own connection and wrappers. What files would i have to include ect...
Maynar replied on at Permalink Reply
Maynar
I have the same problem. Isn't there a list with all classes and their functions and what they do. Now I am just searching for a needle in a haystack in other blocks looking for a function that might resemble the function I am looking for.
frz replied on at Permalink Reply
frz
http://www.concrete5.org/api/
Maynar replied on at Permalink Reply
Maynar
As a matter of fact I have. I think I have seen every page in the support and help section right about now. In the API: can't say it's easy to find things in there. Alright, alright, I haven't read the whole thing, but the places I would expect to find it; no luck.
frz replied on at Permalink Reply
frz
the idea of a quick ref for popular functions has come up in our documentation discussions. If you've been through help, the best i can tell you is get active in the documentation forum area and keep poking around
fyrus replied on at Permalink Reply
That's exactly what i'm looking for, where everything's is properly listed, well-documented and easy to navigate in.

What I think is the biggest drawback of c5 now is the lack of proper documentation and guidelines. Everything else seems brilliant, except I dont really know how to use it and get my hands dirty.
abra100pro replied on at Permalink Reply
abra100pro
Yes, I support that: Documentation is a real issue. I've spent 2hrs finding out how to implement a (left-side-only-) navigation into my template so that it is on every new page by default. I still have no clue.
cgrauer replied on at Permalink Reply
cgrauer
http://www.concrete5.org/index.php?cID=4669

You can also call a block from within your template so it appears on every page (also existing ones) and can't be removed:
http://www.concrete5.org/community/forums/customizing_c5/how_to_aut...
andrew replied on at Permalink Reply
andrew
I think you're right - it's tough to find things in there. Sadly unless the inline documentation of your codebase is obsessively maintained (*cough* Zend Framework *cough*) it's going to get messy, and that is what has happened to our API section.

I think we will/should post some cheat sheets, like Franz says, and perhaps a human-edited version of the API, that more closely resembles something like Code Igniter's API documentation than automated output.
jjaeger replied on at Permalink Reply
jjaeger
I don't know if its do-able or not with how busy everyone is but I think the best help reference I've ever used is in Flash (namely CS3, I don't remember the help in previous version, whoops).

If it could be designed like this it would be VERY much helpful.
Doki replied on at Permalink Reply
Doki
We also need a good reference book written on Concrete5, like in line with the O'Reilly series.

I'm probably not the man for that job though, seeing as I just started with this stuff last week :) ....
matogertel replied on at Permalink Reply
matogertel
Hey, the templates page is gone!
frz replied on at Permalink Reply
frz
yeah thats because when we did the relaunch over new years we copied and moved a bunch of the help stuff around a lot to split it into developer and site owner specific sections, sadly there's nothing easy i can do about it..

it's much easier to find stuff in help now.. here's what you're lookin for:
http://www.concrete5.org/help/building_with_concrete5/developers/th...


http://www.concrete5.org/help/building_with_concrete5/developers/un...
ericlnu replied on at Permalink Reply
ericlnu
Thanks for posting the updated links.
earthtojeremy replied on at Permalink Reply
I can't get new blocks to show up in the dashboard for installation. I've tried the demo block in the developers download section, a modified HTML block, and a straight-up copy of the HTML block. I've uploaded to the /block folder and the /concrete/block folder. Nothing shows up in the Add Functionality section of the dashboard. Can't find any solution anywhere on the forums.

Someone suggested it was because the class name in controller.php had to match the folder name. I changed it to match, but it still doesn't work. Surely someone else has had this problem?
nemonoman replied on at Permalink Reply
nemonoman
From what I can tell, it's not the folder name that's the problem.

The block name and the controller's class name need to match --

so for:
protected $btName = "Widgets";

the class name needs to be:

class WidgetsBlockController

(some programmers do it this way
public function getBlockTypeName() {
return t("Widgets");
}

If your block name has spaces, remove them for the class name
protected $btName = "Wacky Widgets";

the class name needs to be:

class WackyWidgetsBlockController

You must also coordinate the name of the block with the TABLE NAME for the block found in the db.xml file.

If the blockname is "Widgets" the related table name must be 'btWidgets'. Caps Count.

<?xml version="1.0"?>
<schema version="0.3">
<table name="btWidgets">


The class name needs to be unique in your site's collection blocks -- both installed and uninstalled.
zoinks replied on at Permalink Reply
First, a general criticism: white type on dark grey is incredibly hard to read.

Second, I'm learning about blocks and am finding it pretty confusing, despite the fact that certain aspects are so very simple. It seems like a lot of knowledge is taken for granted. For example, the following quote:

"To make sure that the contents of the form are routed correctly to the blocks database table, you should name your form fields the same as your database table's columns. (Note: This is a guideline, but at the end of the day this is just a form. You can name it however you want. You don't have to use Concrete's form helper items either - although they may not be optional one day.)"

^ How am I supposed to know what my database table's columns are named? Concrete5 automatically fills out the database based on blocks. I haven't even interacted with my database since I pointed the Concrete5 to it during the initial installation. There was no prior mention of database tables in the article.
franko replied on at Permalink Reply
franko
I have followed the video precisely at leat three times, each with the same result - when I launch the dashboard, install the theme (I'm even using halloween to make sure I'm following along correctly) what I get is the html page without any images or styling. It seems that default.php is not calling the default.css file correctly but I cannot see why mine would be different from Andrew's demo. I've tried both versions of the code - the one in Andrew's video and the example given above; I've tried adding semicolons after the getThemePath()statement as per above answer and all without effect. I cannot move onto the next stage of editing the template because I cannot get the template to display in the same way Andrew does. What's the problem?
Pixelfixer replied on at Permalink Reply
Pixelfixer
I'm in the same boat. I have followed the instructions to C5 a new theme and I'm close, but I can't get any of the image links within default.php to work. All the paths in my CSS files are working fine. I'm sure I have followed Andrew's instructions precisely....more than once. I have also installed direct paths, and still no images showing up. Here's the link to my default.php page:http://mainideas.com/MLL/
Any ideas for me?
okhayat replied on at Permalink Reply
okhayat
If you view your page source, you'll see you're missing the equal sign = after src
Pixelfixer replied on at Permalink Reply
Pixelfixer
THANKS!! I suspected it was something SIMPLE and STUPID on my part. Just couldn't see it.
fastcrash replied on at Permalink Reply
fastcrash
hi.. is there a way we download the api ?
http://www.concrete5.org/api/

as pdf or html offline maybe ?

thanks.
mohitsrs replied on at Permalink Reply
Can anybody please help me, to solve this problem. I've been constantly trying to load a block on a page, via AJAX.

What am I trying to achieve ?
Actually, I want to implement a popup, not on page load but on AJAX. Suppose, I've a link (say, <a href="..">View Description</a>), then when I click on view description, I want to generate a dynamic data, in that popup. So, how can I really implement this.

Help to me, is really appreciated. Thanks in advance.
jbx replied on at Permalink Reply
jbx
jQuery can do this for you (and lots more!)

jQuery is already loaded with C5, so you can go right ahead and start using it.

The docs are all here:http://docs.jquery.com

Check out this one for a popup:
http://docs.jquery.com/UI/Dialog...

And this for dynamically loading data using ajax:
http://api.jquery.com/category/ajax/...

Hope that helps

Jon
mohitsrs replied on at Permalink Reply
Thanks for the reply, I shall try this out.

But, one more question that wanders inside my brain is, How can we call any block of the page using AJAX. Is it possible to call a block on the page using AJAX.

Means, suppose I have created a block popup (this block initially has only the facility of setting its height, width and id property, also initially it contains no data and is hidden). Can this block be filled with dynamic data and made visible when the user click some link on the same page.

Please, help me to solve this problem as well.
Thanks for the quick response.
mohitsrs replied on at Permalink Reply
Is it possible to render a block of the page, with all its content, be it static or dynamic, using AJAX. If so, can anybody explain with example, how this can be achieved.
jbx replied on at Permalink Reply
jbx
Yes, of course - this is what jQuery does.
eg. you have a div called myBlock:
<div id="myBlock" style="height: 400px; width: 400px; display: hidden"></div>


And a link:
<a href="#myBlock" id="displayMyBlock">Display the magic block</a>


And some jQuery:
$(document).ready(function() {
  $('#displayMyBlock').click(function() {
    $('#myBlock').load('helloWorld.php', function() {
      $('#myBlock').fadeIn(500);
    });
    return false;
  });
});


if you then create a file called helloWorld.php in the same directory that contains
<?php echo 'Hello World!';
Then clicking that link will load "Hello World!" into your div and fade it in.

Simples.

But Read the documentation on the jQuery site! It's good documentation and it's invaluable!

Jon
mohitsrs replied on at Permalink Reply
Thanks a lot..........

It was very good to get such a good help from you, thanks a lot.

I tried it out, but not working for me (the helloWorld.php is not loading in that DIV). Where has to be that file placed in order to run its data in the div, Can I load any file in that, the view of the block that I created, is it possible to do so. ?????
chadsmith729 replied on at Permalink Reply
chadsmith729
Hey Andrew,

Might want to fix the link for "Understanding Blocks" since after-all this is a sticky message.