Basic Block example
Permalink
The basic block template file (http://www.concrete5.org/files/14981212950798basictest.zip) has been corrupted and will not open inside winzip. Can someone replace it or point me to another copy?
personally, the basic block is horrible, in your c5 site, go to /concrete/blocks and pick a block and copy it out and edit :)
Horrible? Really?
Is the "Hello World" tutorial that ships with every single language "horrible" as well?
Is the "Hello World" tutorial that ships with every single language "horrible" as well?
I lolled
I tried to download the file and seems like it is completely fine.
I have never had any trouble unzipping this file. Others, however, have – and I think it may be Windows vs. Non-Windows.
I have updated the tutorials that link to it, however, and linked them to this file instead:
http://www.concrete5.org/files/7212/9710/3658/basic_test2011.zip...
This I believe should be non-corrupted.
I have updated the tutorials that link to it, however, and linked them to this file instead:
http://www.concrete5.org/files/7212/9710/3658/basic_test2011.zip...
This I believe should be non-corrupted.
I just happened to download this today by accident and thought it had been changed, now I realise this was just a name change.
It is a great start but is pretty much a hello world only,
it would be nice to maybe have a slightly more advanced block like a "hello Universe" with a bit more function like validation and some functions like the on_view|before_page_render|edit|save
It is a great start but is pretty much a hello world only,
it would be nice to maybe have a slightly more advanced block like a "hello Universe" with a bit more function like validation and some functions like the on_view|before_page_render|edit|save
Sorry to necro this thread, but I can't unzip this file either. I've tried winzip and 7zip, both report corrupt or invalid archive. I haven't had any issues with other zip, tar, or gz files. Could someone who has the contents of this file on a windows box please archive it (preferably w/ winzip or 7zip) on a windows box and upload it? Many Thanks in advance!
I don't have a windows box handy (hopefully someone else can provide this for you), but did want to point you in the direction of the "Designer Content" addon which in my humble opinion (although I'm biased because I'm the author) has much better/cleaner/more useful code than the tutorial block:
http://www.concrete5.org/marketplace/addons/designer-content...
Install this addon and create a block with just one text field, for example, then go examine the generated block's code. A lot of people have found it useful for learning purposes like this.
-Jordan
PS - I love your phrase "necro this thread" -- never heard that before, will be using it a lot from now on though!
http://www.concrete5.org/marketplace/addons/designer-content...
Install this addon and create a block with just one text field, for example, then go examine the generated block's code. A lot of people have found it useful for learning purposes like this.
-Jordan
PS - I love your phrase "necro this thread" -- never heard that before, will be using it a lot from now on though!
Very cool! It worked nice and smooth, and provided a great example block. Thanks tons for your suggestion! And kudos for being the author :)
Follup question... So I got the example working and I've been playing around with the controller.php and view.php pages. I'm also somewhat new to Concrete5 (but not PHP), so here's something I noticed, and I'm assuming this is "standard behavior" in C5.
If I edit something in the controller.php or view.php files, the changes are not immediately reflected if I simply reload the page, I have to clear the cache first. But if I let the page sit there for awhile (5min or maybe even less) and then reload, the changes are reflected without having to clear the cache.
I'm assuming some cookie timer somewhere has timed out (?). Is there a way to adjust that timer to something much closer to zero? I'd rather have a reload actually reload the page from the server, not from the cache (at least while the site is in development.)
Thanks!
If I edit something in the controller.php or view.php files, the changes are not immediately reflected if I simply reload the page, I have to clear the cache first. But if I let the page sit there for awhile (5min or maybe even less) and then reload, the changes are reflected without having to clear the cache.
I'm assuming some cookie timer somewhere has timed out (?). Is there a way to adjust that timer to something much closer to zero? I'd rather have a reload actually reload the page from the server, not from the cache (at least while the site is in development.)
Thanks!
You can (and should) disable the cache while developing. Go to Dashboard -> Sitewide Settings, and down in the "Speed Settings" section check the "Disabled" box under "Basic Cache", then click the "Update Cache" button.
Alternatively, you could adjust the cache settings on that one block you're working with by modifying these lines at the top of the controller.php file:
(change the 300 to something else, or turn it off entirely by setting all the "true"'s to "false" -- or delete all of those lines entirely and it won't cache I believe).
Alternatively, you could adjust the cache settings on that one block you're working with by modifying these lines at the top of the controller.php file:
protected $btCacheBlockRecord = true; protected $btCacheBlockOutput = true; protected $btCacheBlockOutputOnPost = true; protected $btCacheBlockOutputForRegisteredUsers = true; protected $btCacheBlockOutputLifetime = 300;
(change the 300 to something else, or turn it off entirely by setting all the "true"'s to "false" -- or delete all of those lines entirely and it won't cache I believe).
Totally Awsome! I'd have my mom bake you some choc. chip cookies if I could! :D Thanks again for the prompt answer!
Oh boy you shouldn't have joked about cookies with me -- I'll totally send you my address if you're serious!