c5 Noob Vs Tricky Page Layout

Permalink
What's the best way to content manage a page like this in c5:

http://www.gscca.org.gg/careers-bursary-schemes.php...

So allowing the web editor to easily add new companies to that long list which is made up of floating divs and lots of spans and classes etc.

Thanks,

Rich

P.S. I'm fairly new to c5 but an experienced Web developer. (I even spotted/fixed a c5 Windows/IIS bug:http://www.concrete5.org/index.php?cID=6822... )

 
frz replied on at Permalink Reply
frz
whelp, there's no "right" way to approach this one.. here's a few options:

1) make a custom block type. It takes a image and text area, link, title - whatever you've got in each "row" of this list..
Upside: interface is simple and fast for client, you maintain complete control over presentation.
Downside: you gotta write the block, that takes time.. also on a huge list, the fact that new blocks are always added to the end will drive you crazy if you want the list to be reverse chronological. You can hack around that in the display area for the theme, but there it is..

2) make a page for each row, track this stuff in custom attributes and create a custom template for the page list block to display em. This is typically how my team approaches this stuff in the end.
Upside: the detail page you're making can grow to include other stuff over time. By having a page, you can do all sorts of stuff like moving things around the tree easier. Pagination in the page list block isn't hard to pull off, nor is reversing the list order.
Downside: its a pain for your client to have to make a page for each record, and you need to be sure theres a way for them to get to those pages if they're logged in as an editor later. You can get around this by making a single page custom editing interface if you really want to - but again - time, time, time..

3)? I'm not sure if this is still an option, but in previous versions of concrete cms we used fckEditor instead of tinyMCE. It had a little "templates" toolbar you could turn on which would basically dump some custom code in your html. Give em one HTML block and a template for each row.
Upside: easy for you.
Downside: not similar to any other experience they have in editing with concrete5, not sure you actually CAN do this with tinyMCE, and you get a huge mess of HTML in that block eventually that is hard for a client to cleanup.


That's the best I got for ya.. I wish there was a "oh flip this switch" answer but not today.. I'm eager to hear how you end up solving it..
Enlive replied on at Permalink Reply
Enlive
You could use the table tool in the context editor to create a 2 column table with many rows, set a fixed width for table and columns, and bobs your uncle.
tr309 replied on at Permalink Reply
I think I'm gonna go with frz's first suggestion of using custom block types. I'm planning on doing that today so I will report back and let you guys know how I got on.

Thanks,

Rich
tr309 replied on at Permalink Reply
Do I need to touch the database in order to achieve my custom block type or just modify the .xml schema file?

Can I simply copy the Content block type and rename it to Careers or whatever?

Thanks,

Rich

P.S. Do you have screencasts somewhere?
tr309 replied on at Permalink Reply
tr309 replied on at Permalink Reply
Okay that works like a charm - I've written a custom block.

One of the fields is an image file which I'm currently identifying with fID. Trouble is, image is not a mandatory field and so sometimes the fID field is empty which screws up the SQL query when writing to the database.

So after investigation I tried writing my own save() function in the controller which sets fID to zero:

intval($data['fID'])


The query seems to work and gets executed:

Query: update btBasicTest set fID = ?, companyTitle=?, companyDetail=?, companyUrl=?, companyEmail=?, companyPhone=? where bID = ?
Values: Array ( [0] => 0 [1] => Lightbulb [2] => test [3] => test [4] => test [5] => test [6] => 97 )


But I look in the database table and nothing has been written.

Any ideas?

Rich
tr309 replied on at Permalink Reply
I discovered I can just use this instead:

$data['fID'] = intval($data['fID']);
parent::save($data);


And it works yay!

Thanks for all the help peeps.

Rich
ScottC replied on at Permalink Reply
ScottC
that is another way to tackle it.
tr309 replied on at Permalink Reply
I added

<default value="0"/>


to the schema for that field but it was still failing when adding or editing for some reason. Maybe I hadn't refreshed the block type or something. I'll try that again - 5 years of PHP development makes you appreciate elegant code. 8)

Thanks.