Block with multiple complex objects on (sort of solved)
Permalink
Edit: I've accomplished this by reversing my thinking and bringing some of the fields up into the page headers (using custom page fields) and using a custom-templates page list to do the output. It's a little more awkward to set up a new staff member but it works.
I'm writing a fairly complicated looking block. At least I'm trying to and I'm sure it's simple as hell... But I'm struggling.
It's supposed to show information about staff members (nothing to do with c5 dashboard users) in two contexts. The first is a list of staff members for a department where a thumbnail and extract are shown and the second is a special page that shows their full description with a larger image.
For simplicity, I want to do that in one block.
So there are the following fields:
- Name (varchar - text input)
- Qualifications (varchar - text input)
- Abstract (varchar - text input)
- Detail (text - TinyMCE HTML editor)
- Thumbnail (image - the new image selector)
- Image (image - the new image selector)
All fairly okay but I'm having some issues putting a rich editor on the same page as one of the image selectors. Whenever you select an image, it stuffs the image INTO the Detail content (obviously not what I want).
I'm hacking around using existing block code, so I might be being a moron... but it could be a limitation.
Somebody let me know if they've put those two controls onto the same block before. I'll be posting back with code once I've made sure I'm not being an idiot.
I'm writing a fairly complicated looking block. At least I'm trying to and I'm sure it's simple as hell... But I'm struggling.
It's supposed to show information about staff members (nothing to do with c5 dashboard users) in two contexts. The first is a list of staff members for a department where a thumbnail and extract are shown and the second is a special page that shows their full description with a larger image.
For simplicity, I want to do that in one block.
So there are the following fields:
- Name (varchar - text input)
- Qualifications (varchar - text input)
- Abstract (varchar - text input)
- Detail (text - TinyMCE HTML editor)
- Thumbnail (image - the new image selector)
- Image (image - the new image selector)
All fairly okay but I'm having some issues putting a rich editor on the same page as one of the image selectors. Whenever you select an image, it stuffs the image INTO the Detail content (obviously not what I want).
I'm hacking around using existing block code, so I might be being a moron... but it could be a limitation.
Somebody let me know if they've put those two controls onto the same block before. I'll be posting back with code once I've made sure I'm not being an idiot.
I need to get this working by yesterday. Any ideas?
Did you ever find a solution for this?
I also have this problem and have posted in the main forum and the service partner forum, but have yet to get a response. Surely this is possible... Can any of the Concrete5 Guru's help out on this one? It doesn't seem like a particularly odd request to want both an image and a content box within the same block. Must be a way to get it to work...
http://www.concrete5.org/community/forums/customizing_c5/need_a_block_and_for_you_people_-_should_be_a_easy_one/#17461
Hope that will help you!
Hope that will help you!
I took a look at what you have done there, but the way you have got the image selector to work is by disabling the custom toolbar for tiny_mce, so you can no longer add links or images or files into the content box. Unfortunately I need both working, so that wont work for me. Thanks for posting tho.
I haven't tested this code at all, but you'll get the idea. Basically you store the element that you're going to add the file manager object to in a class variable when you click the link to open the file manager and then depending on what that's set to you can decide where to return the file manger element. You'll have to do some copy/pasting of the existing editor_init code into your block's auto.js file.
<script language="javascript"> var MyBlocksClass = { addImageTo:null, chooseImg:function(elem){ this.addImageTo = elem; // jqyery element to add the image to, stored when this function is called ccm_launchFileManager('&fType=' + ccmi18n_filemanager.FTYPE_IMAGE); }, chooseAssetHandler:function(obj) { if(this.addImageTo.length) { this.insertOtherField(obj); } else { this.insertIntoEditor(obj); } } insertOtherField:function(obj) {
Viewing 15 lines of 61 lines. View entire code block.
The $bf# variables are null (as they are in the image-block's add.php).