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?

rockface
 
Mnkras replied on at Permalink Reply
Mnkras
personally, the basic block is horrible, in your c5 site, go to /concrete/blocks and pick a block and copy it out and edit :)
andrew replied on at Permalink Reply
andrew
Horrible? Really?

Is the "Hello World" tutorial that ships with every single language "horrible" as well?
haptiK replied on at Permalink Reply
haptiK
I lolled
kingpangilinan replied on at Permalink Reply
I tried to download the file and seems like it is completely fine.
andrew replied on at Permalink Reply
andrew
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.
TheRealSean replied on at Permalink Reply
TheRealSean
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
rjlowecsn replied on at Permalink Reply
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!
jordanlev replied on at Permalink Reply
jordanlev
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!
rjlowecsn replied on at Permalink Reply
Very cool! It worked nice and smooth, and provided a great example block. Thanks tons for your suggestion! And kudos for being the author :)
rjlowecsn replied on at Permalink Reply
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!
jordanlev replied on at Permalink Reply
jordanlev
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:
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).
rjlowecsn replied on at Permalink Reply
Totally Awsome! I'd have my mom bake you some choc. chip cookies if I could! :D Thanks again for the prompt answer!
jordanlev replied on at Permalink Reply
jordanlev
Oh boy you shouldn't have joked about cookies with me -- I'll totally send you my address if you're serious!